? modules/tracker/.DS_Store Index: modules/tracker/tracker.info =================================================================== RCS file: /cvs/drupal/drupal/modules/tracker/tracker.info,v retrieving revision 1.9 diff -u -p -r1.9 tracker.info --- modules/tracker/tracker.info 8 Jun 2009 09:23:54 -0000 1.9 +++ modules/tracker/tracker.info 12 Nov 2009 19:19:41 -0000 @@ -1,7 +1,6 @@ ; $Id: tracker.info,v 1.9 2009/06/08 09:23:54 dries Exp $ name = Tracker description = Enables tracking of recent posts for users. -dependencies[] = comment package = Core version = VERSION core = 7.x Index: modules/tracker/tracker.module =================================================================== RCS file: /cvs/drupal/drupal/modules/tracker/tracker.module,v retrieving revision 1.167 diff -u -p -r1.167 tracker.module --- modules/tracker/tracker.module 8 Nov 2009 10:02:41 -0000 1.167 +++ modules/tracker/tracker.module 12 Nov 2009 19:19:41 -0000 @@ -104,22 +104,24 @@ function tracker_cron() { )) ->execute(); - $query = db_select('comment', 'c', array('target' => 'slave')); - // Force PostgreSQL to do an implicit cast by adding 0. - $query->addExpression('0 + :changed', 'changed', array(':changed' => $changed)); - $query->addField('c', 'status', 'published'); - $query - ->distinct() - ->fields('c', array('uid', 'nid')) - ->condition('c.nid', $row->nid) - ->condition('c.uid', $row->uid, '<>') - ->condition('c.status', COMMENT_PUBLISHED); - - // Insert the user-level data for the commenters (except if a commenter - // is the node's author). - db_insert('tracker_user') - ->from($query) - ->execute(); + if (module_exists('comment')) { + $query = db_select('comment', 'c', array('target' => 'slave')); + // Force PostgreSQL to do an implicit cast by adding 0. + $query->addExpression('0 + :changed', 'changed', array(':changed' => $changed)); + $query->addField('c', 'status', 'published'); + $query + ->distinct() + ->fields('c', array('uid', 'nid')) + ->condition('c.nid', $row->nid) + ->condition('c.uid', $row->uid, '<>') + ->condition('c.status', COMMENT_PUBLISHED); + + // Insert the user-level data for the commenters (except if a commenter + // is the node's author). + db_insert('tracker_user') + ->from($query) + ->execute(); + } // Note that we have indexed at least one node. $last_nid = $row->nid; Index: modules/tracker/tracker.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/tracker/tracker.pages.inc,v retrieving revision 1.28 diff -u -p -r1.28 tracker.pages.inc --- modules/tracker/tracker.pages.inc 1 Nov 2009 21:26:44 -0000 1.28 +++ modules/tracker/tracker.pages.inc 12 Nov 2009 19:19:41 -0000 @@ -39,7 +39,18 @@ function tracker_page($account = NULL, $ if (!empty($nodes)) { // Now, get the data and put into the placeholder array - $result = db_query('SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {users} u ON n.uid = u.uid WHERE n.nid IN (:nids)', array(':nids' => array_keys($nodes)), array('target' => 'slave')); + $query = db_select('node', 'n', array('target' => 'slave')); + $query->join('users', 'u', 'n.uid = u.uid'); + if (module_exists('comment')) { + $query->join('node_comment_statistics', 'l', 'n.nid = l.nid'); + $query->fields('l', array('comment_count')); + } + $result = $query + ->fields('n', array('nid', 'title', 'type', 'changed', 'uid')) + ->fields('u', array('uid')) + ->condition('n.nid', array_keys($nodes)) + ->execute(); + foreach ($result as $node) { $node->last_activity = $nodes[$node->nid]->changed; $nodes[$node->nid] = $node; @@ -50,7 +61,7 @@ function tracker_page($account = NULL, $ foreach ($nodes as $node) { // Determine the number of comments: $comments = 0; - if ($node->comment_count) { + if (module_exists('comment') && $node->comment_count) { $comments = $node->comment_count; if ($new = comment_num_new($node->nid)) { @@ -59,13 +70,15 @@ function tracker_page($account = NULL, $ } } - $rows[] = array( - check_plain(node_type_get_name($node->type)), - l($node->title, 'node/' . $node->nid) . ' ' . theme('mark', array('type' => node_mark($node->nid, $node->changed))), - theme('username', array('account' => $node)), - array('class' => array('replies'), 'data' => $comments), - t('!time ago', array('!time' => format_interval(REQUEST_TIME - $node->last_activity))) - ); + $row = array(); + $row[] = check_plain(node_type_get_name($node->type)); + $row[] = l($node->title, 'node/' . $node->nid) . ' ' . theme('mark', array('type' => node_mark($node->nid, $node->changed))); + $row[] = theme('username', array('account' => $node)); + if (module_exists('comment')) { + $row[] = array('class' => array('replies'), 'data' => $comments); + } + $row[] = t('!time ago', array('!time' => format_interval(REQUEST_TIME - $node->last_activity))); + $rows[] = $row; } } else { @@ -74,12 +87,14 @@ function tracker_page($account = NULL, $ $page['tracker'] = array( '#rows' => $rows, - '#header' => array(t('Type'), t('Post'), t('Author'), t('Replies'), t('Last updated')), '#theme' => 'table', '#attached' => array( 'css' => array(drupal_get_path('module', 'tracker') . '/tracker.css' => array('preprocess' => FALSE)), ), ); + $page['tracker']['#header'] = module_exists('comment') ? + array(t('Type'), t('Post'), t('Author'), t('Replies'), t('Last updated')) : + array(t('Type'), t('Post'), t('Author'), t('Last updated')); $page['pager'] = array( '#theme' => 'pager', '#quantity' => 25,