Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 04-10-2007, 04:06 PM
kinny05 kinny05 is offline
 
Join Date: Mar 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help! Username/ID variable vs Current Profile Variable

Okay, I?ve been digging through vB forums for a while now using 3.64. I?ve figured out how to pull the username for the current user, but I need help figuring out how the pull the username or ID of the user?s profile I visit? as vbulletin->userinfo[username], only seems to pull for the id of the person logged in. I need this to run querys specific to each user?s profile when a visitor visit a that profile.

Query syntax like
?..
Select?.x x x
where profile_being_viewed = $ profile_being_viewed

anyone know the variable(s)/array(s) I?m looking for?
Reply With Quote
  #2  
Old 04-10-2007, 04:36 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in the templates

User browsing the page is

$bbuserinfo $vbulletin->userinfo

User page is $userinfo
Reply With Quote
  #3  
Old 04-10-2007, 04:49 PM
kinny05 kinny05 is offline
 
Join Date: Mar 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Zach, I'll give this a try tonite when I get home and post back!
I'm trying to pull these values into a php script so I can include them back into vB through a plugin.

Looks like the variables changed in 3.64
$bbuserinfo ------ >$vbulletin->userinfo['x']

Works in templates, but my biggest issue is pulling this variable over to php.

I ran a query of all my array data in userinfo and it never changes the user id or user name from the user logged in to the info of the user profile i'm visiting. I'm thinking this values is not pulled from array...?
Still kinda stuck.
Reply With Quote
  #4  
Old 04-11-2007, 03:05 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$bbuserinfo << Templates only
$vbulletin->userinfo << anywhere not in the templates.
Reply With Quote
  #5  
Old 04-11-2007, 06:28 PM
kinny05 kinny05 is offline
 
Join Date: Mar 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is really wierd....
When I use $vbulletin->userinfo[username] directly in the template, it gives me what I want, which is the name of the user's profile (member page) i'm visiting. The problem is I can not get this value outside of the template because it always defaults back to the user logged in.

For instance, I'm logged in as Bobby, visiting Mike's page. $vbulletin->userinfo[username] should output Mike, but it pulls Bobby every time.

Tried to echo out through a pluggin hooked to the menber_start or global_start using...
Code:
ob_start();
echo $vbulletin->userinfo[username];
$givearray = ob_get_contents();
ob_end_clean();
Still alway defaults to the user logged in. Need to somehow caputer this value to get it into my PHP code.

Looks like the variable for the url location is consitent with what I need. I'll back door this unless some can provide a better solution.

Code:
<?php 
$findmember = $vbulletin->session->vars[location];                 // pull url location from vbulletin 3.6.5
$memberid = (str_replace("/forums/member.php?u=","",$findmember)); // fix string to filter down to the user id
echo $memberid;                                                    // verfy the proper id was pulled and held in memberid
?>
I strugged with doing it through vB for 3 days. PHP backdoor 5 minutes. Hope this helps someone else. Happy hacking
Reply With Quote
Reply

Thread Tools
Display Modes

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 03:38 PM.


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.04209 seconds
  • Memory Usage 2,197KB
  • Queries Executed 13 (?)
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
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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_postinfo_query
  • fetch_postinfo
  • 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