PDA

View Full Version : Condition Question


StarBuG
08-06-2011, 11:02 AM
Hello

I need a condition in SHOWTHREAD for the number of posts in a thread.
In postbit legacy I use this: <vb:if condition="$post[postcount] % $vboptions[maxposts] == 2 AND !$post['islastshown']">

which displays something in the 2nd post (1st reply) if it is not the last post on the page.
I now need something similar for SHOWTHREAD
I want to display ads but only if there are less then 2 posts (initial post + 1 reply).
It must be in SHOWTHREAD template though.

Unfortunately <vb:if condition="$post[postcount] % $vboptions[maxposts] <= 2"> does not work (for showthread).

Can anyone help me plz

StarBuG

Badshah93
08-06-2011, 11:12 AM
for number of posts in a thread you can use

$threadinfo[replycount] + 1

TheLastSuperman
08-06-2011, 11:14 AM
You can try:

<vb:if condition="$GLOBALS[postcount] % $vboptions[maxposts] <= 2">Testing 123</vb:if>

StarBuG
08-06-2011, 11:26 AM
Thank you, that worked perfect :)