View Full Version : detecting number of posts in a thread
dethfire
12-06-2011, 02:19 PM
Is there an easy way to detect the number of posts in a thread? I want the reply button to be a quote button if there are no posts in the thread. Thus making sure people quote the original thread post for the first reply. Is there a variable already assigned in vB with this info? Maybe for show thread template? what do you think?
I think this should work:
<if condition="$GLOBALS['counter'] == 1 && $GLOBALS['limitlower'] == 0">
only one post
<else />
more than one post
</if>
ETA: added the check for $limitlower because I realized $counter is per page, so any page with one post would have triggered the "only one post" code.
dethfire
12-07-2011, 04:05 PM
thanks kh99! I will go and try this!
--------------- Added 1323278426 at 1323278426 ---------------
sadly it doesn't work. added to my show thread template
I guess it needs a space between the <else and the />, which I added above. I tried it in my SHOWTHREAD and it seems to work. What happens for you?
dethfire
12-08-2011, 02:03 AM
yes it works, thanks so much!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.