The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
vB user name in header template??
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 [DATE]1192602067[/DATE] at [TIME]1192602067[/TIME] --------------- hrm. I don't know how koesher this is, but I just hacked the record in the template table and changed Code:
".(($show['guest']) ? (" <a href=\"/forum_login.php\">Sign In</a> | <a href=\"/forum/register.php\">Register</a> ") : (" Welcome Back! "))." Code:
".(($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> "))." if you are wondering about the wierd PHP syntax, it's called a ternary operator. Read: http://www.php.net/manual/en/languag...arison.ternary |
#2
|
|||
|
|||
You should never manually edit the tables in the database.
|
#3
|
|||
|
|||
Quote:
|
#4
|
|||
|
|||
This has nothing to do with coding i guess, you said you manually edited the table.
And yes, unless you know very good what you are doing, chances are huge that it will either not work or break something. With editing templates for example, they are stored in 2 different formats and also in other tables (datastore for example). |
#5
|
||||
|
||||
Did you try $bbuserinfo[username] right in the template?
|
#6
|
|||
|
|||
$bbuserinfo!!! awesome. It gave me [username], [userid], and [logouthash], which is exactly what i needed.
Thank you very much. Also, Mr. Herwaarden, thank you for your insight. The hack, however, did work fine (or at least as buggy as $bbuserinfo), but I agree that it is a bad practice, and it does make the built-in style manager useless, as saving any changes overwrites the manually changed record... Any insight on checking $bbuserinfo or $show[guest] accurately on the logout page? As of now, when I click logout, it logs me out, but still shows $show[guest] = '' in the header until i go to another page... |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|