- Timestamp:
- 28/11/06 04:15:05 (5 years ago)
- File:
-
- 1 edited
-
comment/comment.module (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
comment/comment.module
r74 r75 104 104 $items[] = array('path' => 'admin/comment', 'title' => t('comments'), 105 105 'callback' => 'comment_admin_overview', 'access' => $access); 106 $items[] = array('path' => 'comment', 'title' => t('comments'), 107 'callback' => 'comment_page', 'access' => $access); 106 108 107 109 // Tabs: … … 167 169 $block['subject'] = t('Recent comments'); 168 170 $block['content'] = theme('comment_block'); 171 $block['content'] .= '<div class="more-link">'. l(t('more'), 'comment', array('title' => t('Read the latest comments.'))) .'</div>'; 169 172 return $block; 170 173 } … … 1770 1773 return base_convert(substr($c, 1), 36, 10); 1771 1774 } 1775 1776 /** 1777 * Show all recent comments 1778 */ 1779 function comment_page(){ 1780 $result = pager_query(db_rewrite_sql('SELECT c.nid, c.* FROM {comments} c WHERE c.status = 0 ORDER BY c.timestamp DESC', 'c'), variable_get('default_morecomments', 10)); 1781 $output = ''; 1782 while ($comment = db_fetch_object($result)) { 1783 $output .= theme('morecomments', $comment, ''); 1784 } 1785 $output .= theme('pager', NULL, variable_get('default_morecomments', 10)); 1786 print theme('page', $output); 1787 } 1788 1789 function theme_morecomments($comment, $links = 0) { 1790 $output = "<div class=\"comment\">\n"; 1791 $output .= '<div class="subject">'. l($comment->subject, "node/$comment->nid", NULL, NULL, "comment-$comment->cid") . ' ' . theme('mark', $comment->new) ."</div>\n"; 1792 $output .= '<div class="moderation">'. $comment->moderation ."</div>\n"; 1793 $output .= '<div class="credit">'. t('by %a on %b', array('%a' => theme('username', $comment), '%b' => format_date($comment->timestamp))) ."</div>\n"; 1794 $output .= "<div class=\"body\">$comment->comment</div>\n"; 1795 $output .= "<div class=\"links\">$links</div>\n"; 1796 $output .= "</div>\n"; 1797 return $output; 1798 } 1799 1800
Note: See TracChangeset
for help on using the changeset viewer.
