Page 2 of 2
Re: Number of comments (CGFeedback)
Posted: Wed Jul 07, 2010 4:49 pm
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.
Re: Number of comments (CGFeedback)
Posted: Sat Jan 21, 2012 3:29 pm
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?
Re: Number of comments (CGFeedback)
Posted: Mon Jan 23, 2012 9:22 pm
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?
Re: Number of comments (CGFeedback)
Posted: Tue Feb 07, 2012 9:15 am
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
Re: Number of comments (CGFeedback)
Posted: Sat Feb 11, 2012 11:11 am
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