Index: tracker.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/tracker/tracker.module,v
retrieving revision 1.157
diff -u -r1.157 tracker.module
--- modules/tracker.module	6 May 2008 12:18:51 -0000	1.157
+++ modules/tracker.module	10 Dec 2008 14:30:15 -0000
@@ -71,3 +71,18 @@
   return user_view_access($account) && user_access('access content');
 }
 
+/**
+ * Implementation of hook_theme().
+ */
+function tracker_theme(){
+  return array(
+    'tracker_item' => array(
+      'arguments' => array('node' => NULL),
+      'file' => 'tracker.pages.inc',
+    ),
+    'tracker' => array(
+      'arguments' => array('rows' => NULL),
+      'file' => 'tracker.pages.inc',
+    ),
+  );
+}
Index: tracker.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/tracker/tracker.pages.inc,v
retrieving revision 1.13
diff -u -r1.13 tracker.pages.inc
--- modules/tracker.pages.inc	3 Dec 2008 16:32:22 -0000	1.13
+++ modules/tracker.pages.inc	10 Dec 2008 14:32:57 -0000
@@ -38,26 +38,23 @@
 
   $rows = array();
   while ($node = db_fetch_object($result)) {
-    // Determine the number of comments:
-    $comments = 0;
-    if ($node->comment_count) {
-      $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", array('query' => comment_new_page_count($node->comment_count, $new, $node), 'fragment' => 'new'));
-      }
-    }
-
-    $rows[] = array(
-      check_plain(node_get_types('name', $node->type)),
-      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(REQUEST_TIME - $node->last_updated)))
-    );
+    $rows[] = theme('tracker_item', $node);  
   }
 
+  $output = theme('tracker', $rows);
+
+  return $output;
+}
+
+/**
+ * Theme overall tracker output.
+ * @param $rows
+ * array of themed tracker items (rows)
+ * 
+ * @return $output
+ * html string - themed tracker output
+ */
+function theme_tracker($rows){
   if (!$rows) {
     $rows[] = array(array('data' => t('No posts available.'), 'colspan' => '5'));
   }
@@ -68,6 +65,39 @@
   $output .= theme('table', $header, $rows);
   $output .= theme('pager', NULL, 25, 0);
   $output .= '</div>';
-
+  
   return $output;
 }
+
+
+/**
+ * theme an individual tracker item.
+ * 
+ * @param $node
+ * node object.
+ * 
+ * @return $row
+ * themed tracker item (row)
+ */
+function theme_tracker_item($node){
+  // Determine the number of comments:
+  $comments = 0;
+  if ($node->comment_count) {
+    $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", array('query' => comment_new_page_count($node->comment_count, $new, $node), 'fragment' => 'new'));
+    }
+  }
+
+  $row = array(
+    check_plain(node_get_types('name', $node->type)),
+    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(REQUEST_TIME - $node->last_updated)))
+  );
+  
+  return $row;
+}
\ No newline at end of file

