$NUMBER_OF_COMMENTS = 10;
//mysql query
$comments = db_query("SELECT c.* from {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE n.type = 'blog' ORDER BY timestamp DESC LIMIT $NUMBER_OF_COMMENTS");
$zebra = 'odd';
//format the comments
while($comment = db_fetch_object($comments)) {
$node = node_load($comment->nid);
$output .= ‘
‘;
if ($zebra = ‘odd’) {
$zebra = ‘even’;
}
else {
$zebra = ‘odd’;
}
}
print $output;
?>
No related posts.

















$output .= ‘
if ($comment->homepage) {
$author = l($comment->name, $comment->homepage);
}
else {
$author = $comment->name;
}
$output .= ‘
‘;
$output .= ‘
‘;
$output .= ‘