PDA

View Full Version : Looking for a variable - threadid


Mickie D
03-05-2017, 03:58 PM
I am writing a small log script that will eventually give me details on threads that are read over a day, week, month.

I want to know who is reading what so we can make decisions based on this information.

Anyway, I have almost all the data I want to collect on SHOWTHREAD COMPLETE plugin hook (i think that is the right location).

I am guessing/hoping that I can use


$vbulletin->thread[threadid]


Is that correct, without the need to select the information from the database

I know I can use


$vbulletin->userinfo['userid']


also is there a list of these globals anywhere?

--------------- Added 1488738917 at 1488738917 ---------------

Found it

$vbulletin->GPC['threadid']

Dave
03-05-2017, 06:06 PM
You can also use $threadid and $thread['threadid'], I would personally use these variables instead of $vbulletin->GPC['threadid'].

Mickie D
03-08-2017, 08:13 AM
Dave, It would not let me use the Like button again on you lol.

So thank you very much.

Can I ask why you prefer those over the one I found; is there more process power used, or a security issue???

Thanks again Dave.

Dave
03-08-2017, 01:40 PM
$threadid and $thread['threadid'] are pulled from the database and $vbulletin->GPC['threadid'] is a variable (but cast to an integer) that is supplied by the client.

Security wise there's no risk, for readability I would use $threadid though.

Mickie D
03-08-2017, 02:38 PM
Thank you Dave.

Mick