The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Avatars on none VB pages.
Hey all, I'm trying to get the avatar to link on a none vb page ??
Any help or ideas, Code as follows Code:
<img src="http://www.soulquestrpg.com/forum/image.php?u='.$vbulletin->userinfo[userid].'" alt="Your avatar" border="0" /> Would call the userid but I'm getting 0, Anyone ? |
#2
|
||||
|
||||
Where are you using that code - is it in a template or is it part of the php (don't use $vbulletin->userinfo in a template, use $bbuserinfo)? Are you trying to get the userid of the person viewing the page or ?? Did you include global.php in your page? You can't get the userid if you didn't.
|
#3
|
|||
|
|||
Quote:
I'm trying to get the userid if the person viewing the page. |
#4
|
||||
|
||||
If you have included global.php, then $vbulletin->userinfo[userid] should work. Perhaps you should post up your code.
|
#5
|
|||
|
|||
ok, Um, As par my sig I use VBB as my forum,
so its quite a complex system that mixes the two, Code:
$curdir = getcwd (); chdir('forum'); require_once('forum/global.php'); chdir ($curdir); ?> Image Here ?? <table cellpadding="0" cellspacing="0" align="left" style="margin-top:5px;"> <tr> <td> <?php echo '<img src="http://www.soulquestrpg.com/forum/image.php?u='.$vbulletin->userinfo[userid].'" alt="Your avatar" border="0" /></a> </td> </tr> </table>'; Thats pretty much everything needed. |
#6
|
||||
|
||||
Once you chdir to the forum directory, you don't need it in your include statement for global:
PHP Code:
|
#7
|
|||
|
|||
Hey Lynn,
Thanks for the reply, I changed the code as you said, but it's still feeding me back 0 as a userid........ Code:
Image Here ?? <table cellpadding="0" cellspacing="0" align="left" style="margin-top:5px;"> <tr> <td> <?php echo '<a href="http://www.soulquestrpg.com/forum/profile.php?$session[sessionurl]do=editavatar"><img src="http://www.soulquestrpg.com/forum/image.php?u='.$vbulletin->userinfo[userid].'" alt="Your avatar" border="0" /></a> </td> </tr> </table>'; echo $vbulletin->userinfo[userid]; |
#8
|
||||
|
||||
Are you getting the rest of the table to output? You may need to make $vbulletin global in your code. It's kinda hard to tell with just that little bit you posted.
Also, you need to include global at the very top of your page, before you output anything else. Have you looked at this - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|