HI There OPen Geek, thanks for the reply.
I’m using Evolution 1.02 and I’m using this snippet to display the latest comments in the sidebar (from the forums here:
http://modxcms.com/forums/index.php/topic,36202.msg267590.html#msg267590):
<?php
/* scheme for LatestComments snippet */
$count = 3; // how many latest comments
// use this for fetching comments and poster name
$query = "SELECT ssb_jot_content.*, ssb_jot_fields.content AS name " .
"FROM ssb_jot_content " .
"INNER JOIN ssb_jot_fields " .
"ON ssb_jot_content.id = ssb_jot_fields.id " .
"WHERE ssb_jot_content.published = '1' AND ssb_jot_fields.label = 'name' " .
"ORDER BY ssb_jot_content.createdon DESC " .
"LIMIT 0, " . $count;
$results = mysql_query($query);
// instead of this
// $results = $modx->db->select('uparent,title,content,createdon', 'ssb_jot_content', 'published=1', 'createdon DESC', $count);
// render output
$output = '';
while ($row = mysql_fetch_array($results, MYSQL_ASSOC)) {
// now use $row['uparent'], $row['title'], $row['content'], $row['createdon']
// for building your list of latest comments
// $row['uparent'] -> id of the doc that the comment is attached to
// $row['title'] -> comment's title
// ...
// now you can use also $row['name'] for inserting poster
// for example, comment's title as a link to its article
$output .= '<div class="jot-user">' . $row['name'] . ' Says:</div><div class="jot-message"><a href="[~' . $row['uparent'] . '~]">"' . $row['content'] . '"</a></div>';
}
return $output;
?>
Thanks for the reply - sorry I just did a cut and paste of the snippet code as I don’t really understand PHP.