PDA

View Full Version : Conditionals


Daggerzz
08-18-2008, 07:03 PM
Im trying to add a button to the thread view postbit controlls next to the edit and quote buttons. Adding the button is easy but Im trying to make it so only the original poster can see the button If i put in the conditional

<if condition="$vbulletin->userinfo['userid'] == $threadinfo['postuserid']">

everyone can see it

if i put in the conditional

<if condition="$threadinfo['postuserid'] == $bbuserinfo['userid']">

no one can see it
shouldnt both of these return the same result?

Dismounted
08-19-2008, 08:55 AM
<if condition="$thread['postuserid'] == $bbuserinfo['userid']">
The reason your first one will show to everyone is because $vbulletin->userinfo doesn't exist yet (I don't think), so it will match null, empty, 0, or false, unless you have used the identical operator. The second variable, $threadinfo, also does not exist.

In the second example, $bbuserinfo does exist, and will not match null, empty, 0, or false.

Daggerzz
08-19-2008, 12:29 PM
Ok after messing with that for about 6 hours I came to the same conclusion.
So my question is , is there a way to make a button appear in the postbit controls that only the original thread starter can see.

--------------- Added 1219195384 at 1219195384 ---------------

Thanks for the help i figured it out