- Timestamp:
- 07/04/08 08:27:13 (4 years ago)
- File:
-
- 1 edited
-
comment/recentcomments.module (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
comment/recentcomments.module
r113 r124 73 73 // From among the comments on the nodes selected in the first query, 74 74 // find the $number most recent comments. 75 $result = db_query_range('SELECT c.nid, c.subject, c.cid, c.timestamp, n.title FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE c.nid IN ('. implode(',', $nids) .') AND n.status = 1 AND c.status = %d ORDER BY c.timestamp DESC', COMMENT_PUBLISHED, 0, $number);75 $result = db_query_range('SELECT c.nid, c.subject, c.cid, c.timestamp, n.title, u.name FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid IN ('. implode(',', $nids) .') AND n.status = 1 AND c.status = %d ORDER BY c.timestamp DESC', COMMENT_PUBLISHED, 0, $number); 76 76 while ($comment = db_fetch_object($result)) { 77 77 $comments[] = $comment; … … 92 92 $return = ""; 93 93 foreach (recentcomments_get_recent() as $comment) { 94 $return .= '<div style=\'padding-top:0.5em;border-bottom:1px solid #D7D7D7;\'>'.l($comment->subject, 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid) .' in '.l($comment->title,"node/$comment->nid")." ".t('<em style=\'display:block;\'>@time ago</em>', array('@time' => format_interval(time() - $comment->timestamp))).'</div>';94 $return .= '<div class="recentcomments" style=\'padding-top:0.5em;border-bottom:1px solid #D7D7D7;\'>'.$comment->name.': '.l($comment->subject, 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid) .' in '.l($comment->title,"node/$comment->nid")." ".t('<em style=\'display:block;\'>@time ago</em>', array('@time' => format_interval(time() - $comment->timestamp))).'</div>'; 95 95 } 96 96 return $return.'<div class="more-link">'. l(t('more'), 'recentcomments', array('title' => t('Read the latest comments.'))) .'</div>';
Note: See TracChangeset
for help on using the changeset viewer.
