MyBB Community Forums

Full Version: Total Number of Posts in a Thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Rather than simply showing the post # in the corner of each reply, I want to show a "Message 3 of 5" message that shows the post number out of  total replies to a thread.

This is my postbit_posturl template right now, but I can't figure out how to change it:
<div class="float_right" style="vertical-align: top">
Message<strong>{$post_number}</strong> of {$thread['posts']}
{$post['inlinecheck']}
</div>

{$thread['posts']} obviously isn't working, so I tried to use PHP to fix this and it won't work. Any suggestions?

Board URL: http://wspforums.com/thread-158.html
Unfortunately a variable used in one template may not necessarily work in another. 

{$thread['replies']} will work in the postbit template, but what you need is {$thread['replies']} + 1

then you can have something like:

<div class="float_right" style="vertical-align: top">
Message<strong>{$post_number}</strong> of {$thread['replies']} + 1
{$post['inlinecheck']}
</div>
Hey Ashley1,

I tried doing that prior to writing my post, and all it displays is the number of replies and the actual "+ 1".

I even tried doing a php print command like: <? php print({$thread['replies']} + 1Wink ?> and it still wouldn't work.  Undecided
Try the plugin template conditionals:
https://community.mybb.com/thread-31860.html

It allows you to use php in templates, further to that you will need to create a plugin to generate what you need.