View Full Version : How to write this if statement?
Dribbles
06-19-2010, 12:59 AM
Trying to write an if statement to toss into postbit templates using these criteria:
If: forum ID=3 AND post#=1
insert a custom html code
end If statement
thnx
BirdOPrey5
06-19-2010, 07:07 PM
<if condition="$thread[forumid] == 3 AND $post['postcount'] == 1>
Custom HTML Code
</if>
You just have to make sure those elements are available in the template you are editing, which I guess is the postbit so should be OK.
If it doesn't work try taking the single quotes out.
Edited per borbole's suggestion.
borbole
06-19-2010, 07:16 PM
<if condition="$thread['forumid'] == 3 AND $post['postcount'] == 1>
Custom HTML Code
</if>
You just have to make sure those elements are available in the template you are editing, which I guess is the postbit so should be OK.
If it doesn't work try taking the single quotes out.
For forums it should be $forum[forumid] instead :)
BirdOPrey5
06-19-2010, 07:21 PM
You see that's what I thought but when I saw the quotes around 'postcount' I confused myself and changed it.
Dribbles
06-19-2010, 07:45 PM
thnx for the help :-) I was using && instead of AND and 'forumid' too ... lol. I'll try this out when I get home. ps- Is there a way to check for a certain tag in an if statement? lets say a thread has the tags "youtube, multimedia, kung fu bear, level4" ... is there some way to write an if statement such as:
if (youtube tag is present)
Boofo
06-19-2010, 07:46 PM
Those single quotes should be there in an if statement.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.