Changeset 124


Ignore:
Timestamp:
07/04/08 08:27:13 (4 years ago)
Author:
nigel.sim
Message:
  • Added username to the list
File:
1 edited

Legend:

Unmodified
Added
Removed
  • comment/recentcomments.module

    r113 r124  
    7373    // From among the comments on the nodes selected in the first query, 
    7474    // 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); 
    7676    while ($comment = db_fetch_object($result)) { 
    7777      $comments[] = $comment; 
     
    9292  $return = ""; 
    9393  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>'; 
    9595  } 
    9696  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.