Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 03-30-2008, 07:45 AM
PaulSonny PaulSonny is offline
 
Join Date: Dec 2006
Location: Middlesbrough, UK
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Programming Help

Hello Everybody,

I was wondering whether anybody could help me.

I currently have a plugin which has the following line of code:

Code:
$userinfo['userid']=$vbulletin->userinfo['userid'];
What I am wanting to do is work out how I would do it on a members profile page, basically I want to know the ID for the members profile page I am looking at and then it will carry on through the code and show the relevant information for that user.

I have tried, as someone suggested the following but it did not work.

Code:
$userinfo['userid']=$vbulletin->memberinfo['userid'];
Any help would be much appreciated.

Thanks, Paul.
Reply With Quote
  #2  
Old 03-30-2008, 08:26 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$userinfo['userid'] is the ID of the member you are looking at. The ID is already assigned to that variable.
Reply With Quote
  #3  
Old 03-30-2008, 08:59 AM
PaulSonny PaulSonny is offline
 
Join Date: Dec 2006
Location: Middlesbrough, UK
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I'm confused.

Because in the profiles it shows my information and not the members I am looking at.

Any reason why?

Thanks, Paul.
Reply With Quote
  #4  
Old 03-30-2008, 10:56 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You don't need any of the code you posted in the first post. Just use $userinfo['userid'].
Reply With Quote
  #5  
Old 03-30-2008, 11:24 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why are you running this plugin then? The default functionality is to grab the User's ID from the URL. With your plugin you are overwriting this, why your doing this I'm not sure. But that is why you can only see your own User Information and not that of others.
Reply With Quote
  #6  
Old 03-30-2008, 02:04 PM
PaulSonny PaulSonny is offline
 
Join Date: Dec 2006
Location: Middlesbrough, UK
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry I should have said in the original post.

I have just purchased and installed P3tz. The template edits supplied are only suitable up to version 3.6.8, and I have vBulletin Version 3.7 RC1.

So basically I was writing my own little code to show the Pet in a right hand side block. (template named memberinfo_block_petz)

Then inside the memberinfo I was calling this template using $blocks_petz.

Then I had two plugins, one was a template cache, and the other plugin was basically for when $blocks_petz is used, fetch the memberinfo_block_petz template, using the follow PHP Code.

Code:
if (THIS_SCRIPT == 'member') 
{
$userinfo['userid']=$vbulletin->userinfo['userid'];
include("petz/plugins/memberinfo.php");
eval('$blocks_petz = "' . fetch_template('memberinfo_block_petz') . '";');
}
I have done the a very similar thing to show your own pet on the index page. I am wanting to do this to show your pet in your profile, so when you view a profile, its shows that persons pet.

I have tried just using $userinfo['userid'] but it causes Database SQL Errors.

Thanks, Paul.
Reply With Quote
  #7  
Old 03-30-2008, 03:09 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think they use $prepared['userid'] in vB 3.7, have you looked at the source code for the member.php page?
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 07:50 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.10279 seconds
  • Memory Usage 2,213KB
  • 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
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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