Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-01-2009, 01:19 PM
dannyb2100 dannyb2100 is offline
 
Join Date: Feb 2009
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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" />
I would of thought $vbulletin->userinfo[userid],

Would call the userid but I'm getting 0,

Anyone ?
Reply With Quote
  #2  
Old 09-01-2009, 02:08 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 09-01-2009, 02:49 PM
dannyb2100 dannyb2100 is offline
 
Join Date: Feb 2009
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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.
Its a none template page, its part of the php, global.php is included yes,
I'm trying to get the userid if the person viewing the page.
Reply With Quote
  #4  
Old 09-01-2009, 03:02 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you have included global.php, then $vbulletin->userinfo[userid] should work. Perhaps you should post up your code.
Reply With Quote
  #5  
Old 09-01-2009, 03:14 PM
dannyb2100 dannyb2100 is offline
 
Join Date: Feb 2009
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 09-01-2009, 03:52 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Once you chdir to the forum directory, you don't need it in your include statement for global:
PHP Code:
chdir ('/forum');
require_once(
'./global.php'); 
Reply With Quote
  #7  
Old 09-05-2009, 02:46 PM
dannyb2100 dannyb2100 is offline
 
Join Date: Feb 2009
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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];
I really dont know whats wrong................
Reply With Quote
  #8  
Old 09-05-2009, 04:27 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:47 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04312 seconds
  • Memory Usage 2,233KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete