HTML Logo by World Wide Web Consortium ( Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS. ocPortal 9 is superseded by Composr 10.

Head over to for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.

Show number of comments in news block

Login / Search

 [ Join | More ]
 Add topic 
#4598 (In Topic #942)

Fan in training

Show number of comments in news block

Just a quick hack job. This will give you a COMMENTS value to place in your news template, to show the number of comments.

It actually grabs all the data of the comments instead of counting them. So it does create a bit of overhead, but this was really the only way to do it without modifying the source for every forum module. (Add a count_topic_posts() function and it would be a snap)

I just attached a diff of my sources/blocks/main_news.php to the one in ocP 2.1, you'll have to edit the template files yourself, just add {COMMENTS} where you want it to appear.

(file renamed to .diff.txt so that I am allowed upload.)

» Download: main_news.php.diff.txt (1.28 Kb, 1085 downloads so far)
Back to the top
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: