Index: modules/tracker.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/tracker.module,v
retrieving revision 1.125
diff -u -p -r1.125 tracker.module
--- modules/tracker.module	12 Jan 2006 16:22:46 -0000	1.125
+++ modules/tracker.module	20 Jan 2006 21:54:32 -0000
@@ -12,15 +12,16 @@
 function tracker_help($section) {
   switch ($section) {
     case 'admin/help#tracker':
-      $output = '<p>'. t('The tracker module displays the most recently added or updated content to the website allowing users to see the most recent contributions.  The tracker module provides user level tracking for those who like to follow the contributions of particular authors.') .'</p>';
-      $output .= '<p>'. t('The  &quot;recent posts&quot; page is available via a link in the navigation menu block and contains a reverse chronological list of new and recently-updated content. The table displays  the content type, the title, the author\'s name, how many comments that item has received, and when it was last updated. Updates include any changes to the text, either by the original author or someone else, as well as any new comments added to an item.  To use the tracker module to <em>watch</em> for a user\'s updated content, click on that user\'s profile, then the <em>track</em> tab.') .'</p>';
-      $output .= t('<p>You can</p>
+      $output = '<p>'. t('The tracker module displays the most recently added or updated content to the website, allowing users to see the most recent contributions. The tracker module provides user level tracking for those who like to follow the contributions of particular authors.') .'</p>';
+      $output .= '<p>'. t('The &quot;recent posts&quot; page is available via a link in the navigation menu block and contains a reverse chronological list of new and recently updated content. The table displays the content type, the title, the author\'s name, how many comments each item has received, and when it was last updated. Updates include any changes to the text, either by the original author or someone else, as well as any new comments added to an item. Keeping track of a particular user\'s content can be done via a <em>track</em> tab in that user\'s profile.') .'</p>';
+      $output .= '<p>'. t('The results in the &quot;recent posts&quot; table can also be refined by clicking on the links in the type column. This will result in a table of posts of only that type. Multiple types can be selected by delimiting each type of post with a + symbol (or a space) in the URL. For e.g. <a href="%example-url">story+page</a> will result in all posts of type <em>story</em> or <em>page</em>.', array('%example-url' => url('tracker/story page'))) .'</p>';
+      $output .= '<p>'. t('This module has no configurable settings.') .'</p>';
+      $output .= t('<p>Tracker module links and examples:</p>
 <ul>
-<li>view the <a href="%tracker">most recent posts</a>.</li>
-<li>view <a href="%profile">user profiles</a> and select the track tab.</li>
-<li>not administer this module.</li>
+<li>View the <a href="%tracker">most recent posts</a>.</li>
+<li>View only user 1\'s (administrator) <a href="%admin-posts1">blog and story posts</a> from the profile page.</li>
 </ul>
-', array('%tracker' => url('tracker'), '%profile' => url('profile')));
+', array('%tracker' => url('tracker'), '%admin-posts1' => url('user/1/track/story blog')));
       $output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%tracker">Tracker page</a>.', array('%tracker' => 'http://www.drupal.org/handbook/modules/tracker/')) .'</p>';
       return $output;
     case 'admin/modules#description':
@@ -68,30 +69,62 @@ function tracker_track_user() {
     drupal_set_title($account->name);
     return tracker_page($account->uid);
   }
+  else {
+    drupal_not_found();
+  }
 }
 
 /**
  * Menu callback. Prints a listing of active nodes on the site.
  */
 function tracker_page($uid = 0) {
-  global $user;
+  if (!is_numeric($uid)) {
+    //This switches the arguments around to accomodate the tracker/id/type and tracker/type options.
+    $type_arg = $uid;
+    $uid = 0;
+  }
+  else {
+    //This caters to the user/id/tracker/type and tracker/id/type formats.
+    $type_arg = (arg(0) == 'user') ? arg(3) : arg(2);
+  }
+  $type_query = '';
+  if (isset($type_arg)) {
+    $type_arg = explode(' ', $type_arg);
 
-  $output .= '';
+    //Filter out erroneous node types and repeats.
+    $type_arg = array_intersect(array_keys(node_get_types()), $type_arg);
+
+    if (!empty($type_arg)) {
+      $type_query = sprintf("AND n.type IN ('%s') ", implode("', '", $type_arg));
+    }
+  }
 
   if ($uid) {
-    $sql = 'SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, l.last_comment_timestamp AS last_post, 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 LEFT JOIN {comments} c ON n.nid = c.nid AND (c.status = %d OR c.status IS NULL) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d) ORDER BY last_post DESC';
+    $sql = 'SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, l.last_comment_timestamp AS last_post, 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 LEFT JOIN {comments} c ON n.nid = c.nid AND (c.status IN (%d, NULL)) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d) '. $type_query .'ORDER BY last_post DESC';
     $sql = db_rewrite_sql($sql);
-    $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid AND (c.status = %d OR c.status IS NULL) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d)';
+    $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid AND (c.status IN (%d, NULL)) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d)'. $type_query;
     $sql_count = db_rewrite_sql($sql_count);
     $result = pager_query($sql, 25, 0, $sql_count, COMMENT_PUBLISHED, $uid, $uid);
   }
   else {
-    $sql = 'SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, l.last_comment_timestamp AS last_post, l.comment_count FROM {node} n INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 ORDER BY last_post DESC';
+    $sql = sprintf('SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, l.last_comment_timestamp AS last_post, l.comment_count FROM {node} n INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {node_comment_statistics} l ON n.nid = l.nid %s WHERE n.status = 1 ORDER BY last_post DESC', $type_query);
     $sql = db_rewrite_sql($sql);
-    $sql_count = 'SELECT COUNT(n.nid) FROM {node} n WHERE n.status = 1';
+    $sql_count = sprintf('SELECT COUNT(n.nid) FROM {node} n WHERE n.status = 1 %s', $type_query);
     $sql_count = db_rewrite_sql($sql_count);
     $result = pager_query($sql, 25, 0, $sql_count);
   }
+  //Keep URL format uniform depending on whether user/uid/track or tracker/uid is being used.
+  if (arg(0) == 'user') {
+    $url_prefix = "user/$uid/track/";
+  }
+  else {
+    if ($uid) {
+      $url_prefix = "tracker/$uid/";
+    }
+    else {
+      $url_prefix = 'tracker/';
+    }
+  }
 
   while ($node = db_fetch_object($result)) {
     // Determine the number of comments:
@@ -100,28 +133,25 @@ function tracker_page($uid = 0) {
       $comments = $node->comment_count;
 
       if ($new = comment_num_new($node->nid)) {
-        $comments .= '<br />';
-        $comments .= l(format_plural($new, '1 new', '%count new'), "node/$node->nid", NULL, NULL, 'new');
+        $comments .= sprintf('<div>%s</div>', l(format_plural($new, '1 new', '%count new'), "node/$node->nid", NULL, NULL, 'new'));
       }
     }
 
-    $rows[] = array(
-      node_get_name($node->type),
+    $node_name = node_get_name($node->type);
+    $rows[] = array(l($node_name, $url_prefix . $node->type, array('title' => t('Track only posts of type: %node-name', array('%node-name' => $node_name)))),
       l($node->title, "node/$node->nid") .' '. theme('mark', node_mark($node->nid, $node->changed)),
       theme('username', $node),
       array('class' => 'replies', 'data' => $comments),
-      t('%time ago', array('%time' => format_interval(time() - $node->last_post)))
+      t('%time ago', array('%time' => format_interval(time() - $node->last_post))),
     );
   }
 
   $header = array(t('Type'), t('Post'), t('Author'), t('Replies'), t('Last post'));
 
-  $output .= '<div id="tracker">';
+  $output = '<div id="tracker">';
   $output .= theme('table', $header, $rows);
   $output .= theme('pager', NULL, 25, 0);
   $output .= '</div>';
 
   return $output;
 }
-
-
Index: modules/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum.module,v
retrieving revision 1.305
diff -u -p -r1.305 forum.module
--- modules/forum.module	20 Jan 2006 09:04:34 -0000	1.305
+++ modules/forum.module	20 Jan 2006 21:54:42 -0000
@@ -852,10 +852,10 @@ function theme_forum_display($forums, $t
 
     if (module_exist('tracker')) {
       if ($user->uid) {
-        $output .= ' <li>'. l(t('My forum discussions.'), "tracker/$user->uid") .'</li>';
+        $output .= ' <li>'. l(t('My forum discussions.'), "tracker/$user->uid/forum") .'</li>';
       }
 
-      $output .= ' <li>'. l(t('Active forum discussions.'), 'tracker') .'</li>';
+      $output .= ' <li>'. l(t('Active forum discussions.'), 'tracker/forum') .'</li>';
     }
 
     if (user_access('create forum topics')) {
@@ -1047,5 +1047,3 @@ function _forum_get_topic_order_sql($sor
   $order = _forum_get_topic_order($sortby);
   return $order['field'] .' '. $order['sort'];
 }
-
-
