vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Getting Userid (https://vborg.vbsupport.ru/showthread.php?t=134952)

BeatificFaith 12-28-2006 01:15 PM

Getting Userid
 
I would like to use the userid field in a query in order to place the users custom field information in specified places on the member.php page.

I've tried using: $vbulletin->userinfo[userid] and $userinfo[userid] but both display my userid on every page, instead of the actual users id of the profile.

How would I instead call the user id of the profile instead of the user id of the viewer?

Tommy12345 12-28-2006 04:33 PM

try $post[userid] ?

BeatificFaith 12-29-2006 05:45 AM

Quote:

Originally Posted by Tommy12345 (Post 1146448)
try $post[userid] ?

No, that doesn't work either :( . AFAIK that displays the id of the person who posted the post in a thread.

Adrian Schneider 12-29-2006 05:48 AM

$userinfo[userid] is the userid of the profile you are viewing
$bbuserinfo / $vbulletin->userinfo [userid] is for the current user
$post[userid] is the poster's id

etc

BeatificFaith 12-29-2006 06:06 AM

I see my mistake... I was attempting to assign $userinfo[userid] to a variable as a plugin. When inserting $userinfo[userid] into the actual member.php template it displays the user id.

I'm still unsure why I cannot insert it into a variable in a plugin, but this works better for me anyway.

Thanks to all who helped.

Adrian Schneider 12-29-2006 06:08 AM

Which hook are you using for your plugin? The variable may be defined later, or you could be inside a class/function meaning it's not in scope.


All times are GMT. The time now is 02:44 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02042 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete