bobjones
10-17-2007, 12:01 AM
does anyone know a variable that contains the actual username of the logged in user that I can put in the header template? eval() wont read $vbulletin->userinfo['username']...
I tried stabbing in the dark at $show[user], $show[username], and [user, username] on $foruminfo, $threadinfo, $userinfo, and $vbotions to no avail
--------------- Added 1192602033 at 1192602033 ---------------
hrm. I don't know how koesher this is, but I just hacked the record in the template table and changed
".(($show['guest']) ? ("
<a href=\"/forum_login.php\">Sign In</a> | <a href=\"/forum/register.php\">Register</a>
") : ("
Welcome Back!
"))."
to
".(($show['guest']) ? ("
<a href=\"/forum_login.php\">Sign In</a> | <a href=\"/forum/register.php\">Register</a>
") : ("
Welcome, <b>".$vbulletin->userinfo['username']."</b>!
<a href=\"/forum/login.php?do=logout&logouthash=".$vbulletin->userinfo['logouthash']."\">
<font size=\"1\">Log Out</font></a>
"))."
It's a little buggy on the logout, but basically works. Hope this is useful to someone...
if you are wondering about the wierd PHP syntax, it's called a ternary operator. Read: http://www.php.net/manual/en/language.operators.comparison.php#language.operato rs.comparison.ternary
I tried stabbing in the dark at $show[user], $show[username], and [user, username] on $foruminfo, $threadinfo, $userinfo, and $vbotions to no avail
--------------- Added 1192602033 at 1192602033 ---------------
hrm. I don't know how koesher this is, but I just hacked the record in the template table and changed
".(($show['guest']) ? ("
<a href=\"/forum_login.php\">Sign In</a> | <a href=\"/forum/register.php\">Register</a>
") : ("
Welcome Back!
"))."
to
".(($show['guest']) ? ("
<a href=\"/forum_login.php\">Sign In</a> | <a href=\"/forum/register.php\">Register</a>
") : ("
Welcome, <b>".$vbulletin->userinfo['username']."</b>!
<a href=\"/forum/login.php?do=logout&logouthash=".$vbulletin->userinfo['logouthash']."\">
<font size=\"1\">Log Out</font></a>
"))."
It's a little buggy on the logout, but basically works. Hope this is useful to someone...
if you are wondering about the wierd PHP syntax, it's called a ternary operator. Read: http://www.php.net/manual/en/language.operators.comparison.php#language.operato rs.comparison.ternary