Log in

View Full Version : show some html if post > X


blackvborg
09-03-2007, 09:35 PM
I would put a block of html on a page only when the number of posts showed on the current page is bigger then X; what is the condition?

Is there a reference somewhere to the variables I can test in Conditions?

<if condition="$??? > 1">
...my html...
</if>

Thank you!

blackvborg
09-05-2007, 05:42 AM
any idea? it should not be hard for the vb experts :)

Opserty
09-05-2007, 12:33 PM
I think its


<if condition="$post['postcount']">
<!-- You HTML -->
</if>

blackvborg
09-05-2007, 01:03 PM
isn't $post['postcount'] the number of the post showed? I'm interested on checking the number of posts showed on the current page.

Eg. if a thread has 22 posts and I've 15 posts per page I would have 15 for the first page and 7 for the second one

Thank you!

Opserty
09-05-2007, 01:16 PM
I thought you meant the the number of posts on a page.

I'm not a 100% sure but you can try


<if condition="$thread['replycount'] > X">
<!-- You HTML -->
</if>

I don't know if it is fetched but you can try it.

blackvborg
09-05-2007, 09:34 PM
it works for the first page, but not for the second

$thread['replycount'] give the total number of replies to a thread; I need the number of replies on the current page.

I found this escamotage:

<if condition="$thread['replycount'] - $pagenumber*$perpage + $perpage > 1">

it works!

but this not:
<if condition="$thread['replycount'] - ($pagenumber-1)*$perpage > 1">

Thank you very much!