Number of comments (CGFeedback)

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
AlasdairGF
Forum Members
Forum Members
Posts: 25
Joined: Tue Jan 20, 2009 3:36 pm

Re: Number of comments (CGFeedback)

Post by AlasdairGF »

Just wanted to summarise for beginners as it took me a little while to get the above straight in my head, although all the information is already there...  example was I wanted a blog 'front page' to list how many comments were associated with a given post.

First set up a "ratings template" in CGFeedback that will just return "1 comment", "0 comments", whatever... I called mine "CommentNum".

Code: Select all

{* Generates just the number of comments with word "comment"/"comments as appropriate *}
{$stats.count} comment{if $stats.count!=1}s{/if}
Then in the appropriate blog template (for me, a summary template) add in:

Code: Select all

{CGFeedback key1="CGBlog" key2=$entry->id action='ratings' ratingstemplate="CommentNum"}
Make sure that key1 is the name of the blog or newsfeed or whatever and that you use the corrent ratingstemplate name.
Last edited by AlasdairGF on Wed Jul 07, 2010 11:46 pm, edited 1 time in total.
Ksya
New Member
New Member
Posts: 4
Joined: Sat Oct 22, 2011 11:00 pm

Re: Number of comments (CGFeedback)

Post by Ksya »

It's strange. I'm sure I have set it up all right. It's just that $stats.count always shows 0.
I have the key names right. I'm 100% sure! Is this a CGFeedback bug?
dopefish
New Member
New Member
Posts: 3
Joined: Mon Jan 23, 2012 9:19 pm

Re: Number of comments (CGFeedback)

Post by dopefish »

I'm having the same issue. I've used the various methods listed here, and all the time I get 0 comments, even after creating comments manually.

At the moment I have

Code: Select all

{CGFeedback key1="CGBlog" key2=$entry->id action='ratings' ratingstemplate="CommentNum"}
But have also edited the default ratings template and still get the same. I've not altered any major settings so assume key1 CGBlog is still correct (using CGBlog and CGFeedback).

I know it sounds silly, but is there anywhere specific in the blog summary template it should go? I assume it goes between the {foreach} so it counts the comments just for that one entry then repeats on the next?
Any help would be greatly appreciated.

**As an update I noticed that even without editing anything and just using the {cgfeedback action=ratings} with default templates i still get 0 comments. i've checked in cgfeedback and it shows the comments, with key1 as CGBlog and key2 as a number. The one thing I did notice however was that it would have an ID of, say, 5 yet key2 for it would be 6. Should these be the same or has something gone a bit wrong somewhere?
urheat
Forum Members
Forum Members
Posts: 243
Joined: Sat Oct 17, 2009 6:50 am
Location: Finland

Re: Number of comments (CGFeedback)

Post by urheat »

I got it working... for a while. Then suddenly the number of comments went crazy.

Most of the time, even if I leave a comment, number stays the same. If I delete one comment, the number changes correctly.


CGExtensions: 1.27.7
CGSimpleSmarty: 1.4.10
CGFeedback: 1.5.4
CGBlog: 1.8.2
CMSMS: 1.10.3
urheat
Forum Members
Forum Members
Posts: 243
Joined: Sat Oct 17, 2009 6:50 am
Location: Finland

Re: Number of comments (CGFeedback)

Post by urheat »

I'm pretty sure this is a bug. If admin deletes or saves the comments, the number of comments are ok.

But... there's a workaround. Thanks to weird0: http://forum.cmsmadesimple.org/viewtopi ... =7&t=55054
Post Reply

Return to “Modules/Add-Ons”