vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Passing variable to a plugin? (https://vborg.vbsupport.ru/showthread.php?t=240376)

atzaman 04-13-2010 03:15 PM

Passing variable to a plugin?
 
Hey all

I hope someone can help me with this.

I know how to create separate php files but can anyone tell me how I can pass a variable from the template to the php file? eg. how can I send the threadid to my php script so that I can use it there?

Many thanks for looking and thanks in advance if you're able to help :)

EDIT:

OK. I've worked out that I need to use $vbulletin->userinfo['usergroupid'] type thing on the php file but what would that be if I wanted the threadid?

I'm editing threadbit and FORUMDISPLAY if that helps.

atzaman 04-15-2010 11:16 AM

Please can someone help me with this?

I'm editing the threadbit template as I'd like to add some additional information from new columns added to the thread table which will show on forumdisplay. I need to use the threadid in the database query on the plugin but there doesn't seem to be anyway that I can "pass" it through to the plugin?

I can use {vb:raw thread.realthreadid} in the actual template but it doesn't seem to work in the plugin as it just comes out blank.

Can anyone please tell me what I'm doing wrong?

Lynne 04-15-2010 01:58 PM

In the plugin, you would use php, so $thread['readlthreadid'] would be used. (Hard to tell though since you have not said what hook location nor have you posted your code.)

atzaman 04-22-2010 10:07 AM

Thanks for the reply.

I managed to work it out though :)

First time I've ever used vBulletin so taking a little time getting used to it especially as the documentation for 4.x seems to be next to nothing.

$GLOBALS['threadid']


All times are GMT. The time now is 07:19 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.00916 seconds
  • Memory Usage 1,710KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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