summaryrefslogtreecommitdiff
path: root/modules/tracker
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-07-08 06:15:49 +0000
committerDries Buytaert <dries@buytaert.net>2004-07-08 06:15:49 +0000
commit039c77121a7ef9af981f6619368018d2bc14fd16 (patch)
tree3b5f4d394e16edbedacd038fdbb4fabe50a1a3f0 /modules/tracker
parent9a56e93c3d8cd5f99fff1757e48a05e85cd20e33 (diff)
downloadbrdo-039c77121a7ef9af981f6619368018d2bc14fd16.tar.gz
brdo-039c77121a7ef9af981f6619368018d2bc14fd16.tar.bz2
- Patch #9031 by Morbus: this last tracker patch was broken - for installations where the comment.module is turned on, $comments is never set to 0, and posts that have no comments instead get the value of the last successful comment_num_all. The attached patch corrects this ($comments is set to 0 before we do anything) and also merges the if statements.
Diffstat (limited to 'modules/tracker')
-rw-r--r--modules/tracker/tracker.module18
1 files changed, 7 insertions, 11 deletions
diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module
index 9b68752ae..a8cc7439d 100644
--- a/modules/tracker/tracker.module
+++ b/modules/tracker/tracker.module
@@ -52,19 +52,15 @@ function tracker_page($uid = 0) {
while ($node = db_fetch_object($result)) {
// Determine the number of comments:
- if (module_exist('comment')) {
- if ($all = comment_num_all($node->nid)) {
- $comments = $all;
-
- if ($new = comment_num_new($node->nid)) {
- $comments .= '<br />';
- $comments .= l(t('%num new', array('%num' => $new)), "node/$node->nid", NULL, NULL, 'new');
- }
+ $comments = 0;
+ if (module_exist('comment') && $all = comment_num_all($node->nid)) {
+ $comments = $all;
+
+ if ($new = comment_num_new($node->nid)) {
+ $comments .= '<br />';
+ $comments .= l(t('%num new', array('%num' => $new)), "node/$node->nid", NULL, NULL, 'new');
}
}
- else {
- $comments = 0;
- }
$rows[] = array(
ucfirst(node_invoke($node->type, 'node_name')),