How to call number of replies from topic

Started by Mick., August 01, 2018, 05:04:16 PM

Previous topic - Next topic

Mick.

Alright guys, one more time. I used to have this in my old forum but i dont remember how i wrote it and wayback machine well, you cant view php.

What im looking for is the total of replies in post view. This is what i have and it's going into the display.template

echo'
<div style="text-align: left; font-size: 24px; margin-left: 25px; color: #72c1ae;"> ', $topic ['replies'], ' Comments</div>';


Obviously the word "comment" appears but it's not calling the total of replies. Could this be a global issue? And dont worry about the styling, i have it like that for testing purposes before i call it from the css file.

Image attached :)

Arantor

If you're doing this inside a topic, you should probably use $context['real_num_replies'] for the number of replies in the topic as this takes into account unapproved posts and whether the user can see them.

Mick.

Quote from: Arantor on August 01, 2018, 05:06:37 PM
If you're doing this inside a topic, you should probably use $context['real_num_replies'] for the number of replies in the topic as this takes into account unapproved posts and whether the user can see them.
Thank you brother...that worked!

https://www.idesignsmf.com/index.php/topic,536.0.html

Advertisement: