PDA

View Full Version : Thread Stats in SHOWTHREAD



bestmilan
Fri 21st Aug '09, 8:01pm
Hi,

I have the simple piece of code displayed below inserted in my showthread template to show each thread's number of replies and views:


This thread has $thread[replycount] replies and has been viewed $thread[views] times.Is there any way to correct the english so it will say "this thread has 1 reply" or "this thread has 2 replies" etc.?

Thank you for your help!

bestmilan
Fri 21st Aug '09, 9:54pm
Ok, I wrapped some conditionals around the code and it seems to work...


<if condition="$thread[replycount] == 1"> This thread has 1 reply and has been viewed $thread[views] times </if>
<if condition="$thread[replycount] > 1"> This thread has $thread[replycount] replies and has been viewed $thread[views] times </if>
<if condition="$thread[replycount] == 0"> This thread has $thread[replycount] replies and has been viewed $thread[views] times </if>