Page 1 of 1

Number of replies on viewtopic template

Posted: Wed Feb 01, 2012 9:29 am
by BrokenCrust
I'm developing a new viewtopic template where the first post is really an article and so I don't want it to be counted as a post. {TOTAL_POSTS} is used to display the post count from viewtopic.php which returns

Posts xx where xx is the total number of posts (e.g Posts 18)

I'd like to change this to have xx Replies (e.g. 17 Replies)

Is this possible without hacking viewtopic.php? I couldn't find a count of replies in there.

I hope this is the correct forum and I although I did search, I did not find an answer so apologies if this has already been asked.

Re: Number of replies on viewtopic template

Posted: Wed Feb 01, 2012 12:45 pm
by Brf
Yes, you would need to create a new template variable, like is done for total posts.

Re: Number of replies on viewtopic template

Posted: Wed Feb 01, 2012 1:39 pm
by BrokenCrust
Thanks. I know I can do this easily in viewtopic.php itself, but I'm not so keen to edit core files even to add just a new template variable. Perhaps there is a better way to do it without editing this core file via a hook or some other clever way?

Re: Number of replies on viewtopic template

Posted: Wed Feb 01, 2012 2:44 pm
by Brf
The simplest way is to add one line to viewtopic.php to add that one template variable. Then use that variable in the viewtopic_body template.

Re: Number of replies on viewtopic template

Posted: Thu Feb 02, 2012 10:22 am
by BrokenCrust
I was hoping for another less "hacky" way. Is there no hook for adding a template variable?

Thank you for the information.