diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-09-04 21:10:45 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-09-04 21:10:45 +0000 |
commit | 2db2c039fb5caabf511c95f15034ec18b39533d4 (patch) | |
tree | cb0c2885a87d46c204f14df42993c40a17f0c454 /modules/comment | |
parent | 957997516d2b7c0391fe71a84d8e9aa4bb984495 (diff) | |
download | brdo-2db2c039fb5caabf511c95f15034ec18b39533d4.tar.gz brdo-2db2c039fb5caabf511c95f15034ec18b39533d4.tar.bz2 |
- Patch #172950 by webernet: code style fixes.
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/comment.module | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 14fb48e4b..59693b29d 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -324,28 +324,28 @@ function comment_new_page_count($num_comments, $new_replies, $nid) { $mode = _comment_get_display_setting('mode'); $order = _comment_get_display_setting('sort'); $pagenum = NULL; - $flat = in_array($mode, array(COMMENT_MODE_FLAT_COLLAPSED, COMMENT_MODE_FLAT_EXPANDED)); + $flat = in_array($mode, array(COMMENT_MODE_FLAT_COLLAPSED, COMMENT_MODE_FLAT_EXPANDED)); if ($num_comments <= $comments_per_page || ($flat && $order == COMMENT_ORDER_NEWEST_FIRST)) { // Only one page of comments or flat forum and newest first. // First new comment will always be on first page. $pageno = 0; - } + } else { - if ($flat) { + if ($flat) { // Flat comments and oldest first. $count = $num_comments - $new_replies; - } + } else { // Threaded comments. See the documentation for comment_render(). - if ($order == COMMENT_ORDER_NEWEST_FIRST) { + if ($order == COMMENT_ORDER_NEWEST_FIRST) { // Newest first: find the last thread with new comment $result = db_query('(SELECT thread FROM {comments} WHERE nid = %d AND status = 0 ORDER BY timestamp DESC LIMIT %d) ORDER BY thread DESC LIMIT 1', $nid, $new_replies); $thread = db_result($result); $result_count = db_query("SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = 0 AND thread > '" . $thread . "'", $nid); - } - else { + } + else { // Oldest first: find the first thread with new comment - $result = db_query('(SELECT thread FROM {comments} WHERE nid = %d AND status = 0 ORDER BY timestamp DESC LIMIT %d) ORDER BY SUBSTRING(thread, 1, (LENGTH(thread) - 1)) LIMIT 1', $nid, $new_replies); + $result = db_query('(SELECT thread FROM {comments} WHERE nid = %d AND status = 0 ORDER BY timestamp DESC LIMIT %d) ORDER BY SUBSTRING(thread, 1, (LENGTH(thread) - 1)) LIMIT 1', $nid, $new_replies); $thread = substr(db_result($result), 0, -1); $result_count = db_query("SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = 0 AND SUBSTRING(thread, 1, (LENGTH(thread) - 1)) < '" . $thread . "'", $nid); } |