Log in

View Full Version : How to Pull Self Userinfo From Server


evenmonkeys
12-05-2005, 04:34 PM
I'm making a blank page and I'm trying to list out information of the person. How would I do something like this...

Username: {person's username}
Posts: {person's posts}

You can get the idea there. I'm making a custom page with information on it, but I can't specify an exact location to look because I want it to pull the information for whoever is looking at it. If I look at the page, I want it to say xYarub with 1000 posts. Whereas if Bob is looking at it, I want it to say Bob with 200 posts. See what I'm getting at?

Can this be done without extra files? Is there just a phrase or something I can use? Please help.

Marco van Herwaarden
12-05-2005, 07:22 PM
Just include global.php in the top of your script. If someone is logged in, you will find all the user information in the $vbulletin->userinfo array.

evenmonkeys
12-05-2005, 08:09 PM
I'm using Dream's page wrapper to do this... so the global.php would already be in there, correct? I'm not making an actual php file or anything. I'm just creating a blank page through Styles & Templates.

evenmonkeys
12-06-2005, 10:07 PM
Still lookin. =\

Marco van Herwaarden
12-07-2005, 05:56 AM
Just include $vbulletin->userinfo[username] and $vbulletin->userinfo[posts] in your template.

evenmonkeys
12-07-2005, 06:42 PM
That's what I've been using.
<tr>
<td class="tcat">$vbphrase[view_profile]<span class="normal">: $vbulletin->userinfo[username]</span></td>
</tr>That shows as:

View Profile: Array[username]

Marco van Herwaarden
12-07-2005, 06:44 PM
Then use instead:
{$vbulletin->userinfo[username]}

evenmonkeys
12-07-2005, 06:51 PM
Thank you very much! You're a good guy, Marco. =D