Log in

View Full Version : Conditional statement based on forum


gtsch
08-12-2006, 06:59 PM
I want to make it so people can only give rep in one forum. I figured the best way to do this would be to make a conditional statement around the rep icon. What would be the right way to do this?

<if condition="forumid=1"></if>

doesn't seem to work, what would be the correct way to do this?

peterska2
08-12-2006, 08:11 PM
<if condition="$thread[forumid]==1">blah</if>can be used in the postbit template. Just replace 1 with the forum id number that you want it to apply to.

Kirk Y
08-12-2006, 09:37 PM
I assume that you meant $thread, right?

peterska2
08-12-2006, 09:46 PM
ooops, yes. edited

gtsch
08-12-2006, 10:32 PM
thanks

what would be the correct syntax for multiple forums?

<if condition="$thread[forumid]==array(1,2,3)">blah</if>

Is this right?

peterska2
08-13-2006, 01:07 AM
it would be<if condition="in_array($thread[forumid], array(X,Y,Z))">blah</if>