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 01-21-2011, 12:20 PM
sharpkiller sharpkiller is offline
 
Join Date: Aug 2009
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Using userid on a Different Page

Hello again,

I've completely written my hack in PHP, and now I'm actually looking to integrate it into vBulletin 3. So far I have created a vBulletin page which executes my php code. However, in order for this to work as intended, I'll to add a link to this page somewhere on thread display. I'll also need to pass the userid of the original poster, the threadid, and the userid of the user who is using this hack. However, I'm not certain how I might accomplish this.

Thanks for any help you can provide.
Reply With Quote
  #2  
Old 01-21-2011, 12:51 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you say thread display do you mean the output of showthread.php? If so, you could edit the template SHOWTHREAD and put in your link, and use $threadinfo[postuserid], $threadinfo[threadid], and $bbuserinfo[userid] for the data you need to pass.
Reply With Quote
  #3  
Old 01-21-2011, 01:55 PM
sharpkiller sharpkiller is offline
 
Join Date: Aug 2009
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oops, yes - sorry. I got it mixed up with forum display. Anyway, using those variables, how would I pass the correct data contained in $threadinfo[postuserid] and $threadinfo[threadid] to my PHP file? Thanks for your help so far.
Reply With Quote
  #4  
Old 01-21-2011, 02:03 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I guess the same way you'd do it for any html, like put the info in the url, or submit a form. For example, you could put this somewhere in the template:

Code:
<a href="myscript.php?threaduser=$threadinfo[postuserid]&threadid=$threadinfo[threadid]&userid=$bbuserinfo[userid]">Link to my script</a>
Then in your script it will be in $_REQUEST[]. If you included global.php in your script, you could use $vbulletin->input->clean_gpc() to make sure the values are integers and put them in $vbulletin->GPC[]. (There's an example of this in almost every "top level" vbulletin script).

Hopefully I'm understanding what you want to do.

ETA: just realized, if you did include global.php in your custom script then you don't need to pass the "current" user's id, you can get it in your script by using $vbulletin->userinfo['userid'];
Reply With Quote
  #5  
Old 01-21-2011, 02:51 PM
sharpkiller sharpkiller is offline
 
Join Date: Aug 2009
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's exactly what I needed. I just tested it and it works perfectly. Thanks for your help!
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 04:17 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.03568 seconds
  • Memory Usage 2,192KB
  • 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
  • (1)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_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