Number of replies on viewtopic template

For support and discussion related to templates, themes, and imagesets in phpBB 3.0.
Scam Warning
Locked
User avatar
BrokenCrust
Registered User
Posts: 63
Joined: Mon Feb 11, 2008 8:43 pm
Contact:

Number of replies on viewtopic template

Post 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.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51998
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Number of replies on viewtopic template

Post by Brf »

Yes, you would need to create a new template variable, like is done for total posts.

User avatar
BrokenCrust
Registered User
Posts: 63
Joined: Mon Feb 11, 2008 8:43 pm
Contact:

Re: Number of replies on viewtopic template

Post 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?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51998
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Number of replies on viewtopic template

Post 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.

User avatar
BrokenCrust
Registered User
Posts: 63
Joined: Mon Feb 11, 2008 8:43 pm
Contact:

Re: Number of replies on viewtopic template

Post by BrokenCrust »

I was hoping for another less "hacky" way. Is there no hook for adding a template variable?

Thank you for the information.

Locked

Return to “[3.0.x] Styles Support & Discussion”