PDA

View Full Version : Passing variable to a plugin?


atzaman
04-13-2010, 03:15 PM
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']