PDA

View Full Version : If creator of thread


GCSkye
04-05-2009, 03:51 PM
Looking for an if statement for vbulletin, something like

if ($vbulletin->creator_of_thread

Reason being:
https://vborg.vbsupport.ru/showthread.php?t=183183

I would like to my members to have the ability to ban users from their own threads if they so choose.

Lynne
04-05-2009, 04:19 PM
I don't know where you are trying to use the variable, but have you tried $thread[postuserid] ? (postuserid is the name of the field in the thread table - and postusername is the user's name)

GCSkye
04-05-2009, 05:34 PM
if ($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator'])

That is where it givers permissions to users. I want it to instead give permissions to not only admins but also the creator of the thread.

Lynne
04-05-2009, 05:51 PM
So did you try adding in something like "AND $vbulletin->userinfo['userid'] == $thread[postuserid]" ?

That would be if the viewer of the page is the thread creator.

GCSkye
04-05-2009, 09:55 PM
Tried that with no luck. Even tried just the following:

<phpcode><![CDATA[if ($vbulletin->$vbulletin->userinfo['userid'] == $thread[postuserid])
{ $show['btu_canban'] = true; }]]></phpcode>

It allowed everyone to ban users from threads. I'm looking for something that will allow only the starter of the thread to be allowed to do this.

Lynne
04-05-2009, 10:19 PM
What variable you use and whether it is available for use really depends on what hook location you are using. You should look in the code right before the hook location is called and see how they are defining/using variables. That is your best clue on what to do.