Quip: Get the comment count for a thread
Posted by garryn on Feb 3, 2010 | Filed under: MODx Revolution
Note: Since writing this post, Quip has been updated and the latest versions ship with a QuipComment snippet.
Quip is the third-party component available for MODx Revolution to allow commenting on resources. For example, this blog uses Quip to allow commenting on blog posts.
But, say you want to get the comment count for a particular thread elsewhere within your site - how would you do it? For the solution, read on.
Here is a snippet that will grab the comment count for a particular Quip thread, it can be called anywhere on the site as long as you know the thread ID that you want to get the comment count for. The snippet accepts one parameter:
- thread: The thread ID that you want to receive the comment count for.
And, here is the snippet:
require_once $modx->getOption('core_path').'components/quip/model/quip/quip.class.php';
if (!isset($scriptProperties['context'])) $scriptProperties['context'] = 'web';
$quip = new Quip($modx,$scriptProperties);
return $modx->getCount('quipComment', array('thread' => $scriptProperties['thread']));
And, an example call:
[[!getCommentCount? &thread=`blog_[[*id]]`]]
Reconix:
Feb 15, 2011 at 10:43 PM
Correct me if I'm wrong but, this is built into Quip now isn't it.
Paul:
Apr 18, 2011 at 11:02 AM
Hi!
For some reasons I can't get Quip to send notification emails.
I followed the tutorial but it doesn't work http://rtfm.modx.com/display/revolution20/Creating+a+Blog+in+MODx+Revolution
I get the error [2011-04-15 07:48:43] (ERROR @ /index.php) [Quip] Moderator Notifications could not be sent for comment: Array ()
I'm running Modx 2.0.8 with Quip 2.0.1. How did you manage to set up quip on your blog?
I'd really apprecaite your help!
a:
May 25, 2011 at 04:56 AM
a