summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-08-12 16:12:00 +0000
committerDries Buytaert <dries@buytaert.net>2007-08-12 16:12:00 +0000
commitc17499b6fe5e9b388d09151d2c3525976fde065c (patch)
tree0203a1d7f6cbeba58fc2056ae4f6c6caa30119d0 /modules/comment/comment.module
parentb134b023e11902ceae12f3ab861da1f0a2fdbdbd (diff)
downloadbrdo-c17499b6fe5e9b388d09151d2c3525976fde065c.tar.gz
brdo-c17499b6fe5e9b388d09151d2c3525976fde065c.tar.bz2
- Patch #163191 by hswong3i: removed db_num_rows() for compatibility with Oracle and DB2. Also a performance improvement. (Correct version this time.)
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 7a534a044..82db5cae0 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -1019,6 +1019,7 @@ function comment_render($node, $cid = 0) {
$divs = 0;
$last_depth = 0;
+ $num_rows = FALSE;
$comments = '';
drupal_add_css(drupal_get_path('module', 'comment') .'/comment.css');
while ($comment = db_fetch_object($result)) {
@@ -1053,9 +1054,11 @@ function comment_render($node, $cid = 0) {
else if ($mode == COMMENT_MODE_THREADED_EXPANDED) {
$comments .= theme('comment_thread_expanded', $comment, $node);
}
+
+ $num_rows = TRUE;
}
- if ($comment && (variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_ABOVE || variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_ABOVE_BELOW)) {
+ if ($num_rows && (variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_ABOVE || variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_ABOVE_BELOW)) {
$output .= drupal_get_form('comment_controls', $mode, $order, $comments_per_page);
}
$output .= $comments;
@@ -1065,7 +1068,7 @@ function comment_render($node, $cid = 0) {
}
$output .= theme('pager', NULL, $comments_per_page, 0);
- if ($comment && (variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_BELOW || variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_ABOVE_BELOW)) {
+ if ($num_rows && (variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_BELOW || variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_ABOVE_BELOW)) {
$output .= drupal_get_form('comment_controls', $mode, $order, $comments_per_page);
}
}