MyBB Community Forums

Full Version: Template conditionals, how to determine how many posts on page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to show an ad above the thread if there's only one post on the page (postbit). Attempting to utilize my own genius, I tried this:

{$ignore_bit}
<if $mybb->settings['postsperpage'] == "1" then>{myadvertisements[zone_1]}</if>		
<a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>

But that didn't work out for me. Sleepy
Display something if there is only 1 post on page:
a) for showthread template(s):
<if $postcount % $perpage == "1" && $page == $pages then>xxx</if>
b) for postbit template(s):
<if $postcounter % $mybb->settings['postsperpage'] == "1" && $thread['lastpost'] == $post['dateline'] then><strong>Hello</strong></if>
Extra butter baby. Very good. Ended up using it in showthread. Thanks again Destroy666.