diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-09-19 15:11:05 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-09-19 15:11:05 +0000 |
commit | 06af3e60e5e7897bf033a4d58556199f0fad396a (patch) | |
tree | 9a661faefe024640913115e7c79cd85364e9bd3e /modules/comment/comment.module | |
parent | da316273bdf3e033336c2b02ffb19c96fc647886 (diff) | |
download | brdo-06af3e60e5e7897bf033a4d58556199f0fad396a.tar.gz brdo-06af3e60e5e7897bf033a4d58556199f0fad396a.tar.bz2 |
- Patch #29866 by Florian, Uwe: made the recent comments block only show comments on public nodes.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r-- | modules/comment/comment.module | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index d441bd6d9..061bbae55 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -167,7 +167,7 @@ function comment_block($op = 'list', $delta = 0) { return $blocks; } else if ($op == 'view' && user_access('access comments')) { - $result = db_query_range(db_rewrite_sql('SELECT c.nid, c.* FROM {comments} c WHERE c.status = %d ORDER BY c.timestamp DESC', 'c'), COMMENT_PUBLISHED, 0, 10); + $result = db_query_range(db_rewrite_sql('SELECT c.nid, c.* FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE n.status = 1 AND c.status = %d ORDER BY c.timestamp DESC', 'c'), COMMENT_PUBLISHED, 0, 10); $items = array(); while ($comment = db_fetch_object($result)) { $items[] = l($comment->subject, 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid) .'<br />'. t('%time ago', array('%time' => format_interval(time() - $comment->timestamp))); |