<![CDATA[ Quip Latest Comments in Manager Widget - MODX Community Forums]]> https://forums.modx.com/thread/?thread=82997 <![CDATA[Quip Latest Comments in Manager Widget]]> https://forums.modx.com/thread/82997/quip-latest-comments-in-manager-widget#dis-post-457986

require_once $modx->getOption('core_path').'components/quip/model/quip/quip.class.php';

if (!isset($scriptProperties['context'])) $scriptProperties['context'] = 'mgr';

$quip = new Quip($modx,$scriptProperties);

return $modx->getCount('quipComment', array('thread' => $scriptProperties['thread']));

Surely retrieving the comments themselves can't be too far beyond this. I'm no wizard when it comes to snippets, so any suggestions would be greatly appreciated.

EDIT: Scratch all the above. It doesn't work at all. It returns a 0 regardless of the amount of comments. I am way over my head here - any thoughts from anyone at all?
designcouch Mar 07, 2013, 04:20 PM https://forums.modx.com/thread/82997/quip-latest-comments-in-manager-widget#dis-post-457986
<![CDATA[Re: Quip Latest Comments in Manager Widget (Best Answer)]]> https://forums.modx.com/thread/82997/quip-latest-comments-in-manager-widget#dis-post-463000
My solution was modifying the "LatestComments" snippet included with Quip for use on the backend (along with the accompanying chunks). I also had to create a new directory in core/components/quip/controllers called "mgr" and include a blank PHP file called "header.php" in order to eliminate an error that was springing up.

I've included a screenshot of the end result for you to view.

designcouch Apr 15, 2013, 11:00 AM https://forums.modx.com/thread/82997/quip-latest-comments-in-manager-widget#dis-post-463000
<![CDATA[Re: Quip Latest Comments in Manager Widget]]> https://forums.modx.com/thread/82997/quip-latest-comments-in-manager-widget#dis-post-458059
$output = '';
$sql = $modx->db->query( 'SELECT * FROM `modx_quip_comments` ORDER BY createdon');
$resultArray = $modx->db->makeArray( $sql ); 
foreach($resultArray as $item)
     $output.=$modx->parseChunk('comment_list_widget', $params, '[[+', ']]');
return $output;
designcouch Mar 08, 2013, 10:16 AM https://forums.modx.com/thread/82997/quip-latest-comments-in-manager-widget#dis-post-458059