--- tracker2.module	2008-06-02 06:20:12.000000000 +0200
+++ tracker2.module	2008-09-16 11:39:00.000000000 +0200
@@ -1,14 +1,26 @@
 <?php
-
 // $Id: tracker2.module,v 1.1.2.1 2008/06/02 04:20:12 straussd Exp $
 
 /**
- * Implementation of hook_menu().
+ * @file
+ * Enables tracking of recent posts for users.
+ */
+
+/**
+ * Implementation of hook_help().
  */
-function tracker2_menu($may_cache) {
-  global $user;
-  $items = array();
+function tracker2_help($path, $arg) {
+  switch ($path) {
+    case 'admin/help#tracker2':
+      $output = '<p>'. t('The Tracker2 module is a much more efficient tracker that maintains seperate database tables of updated items.') .'</p>';
+      return $output;
+  }
+}
 
+/**
+ * Implementation of hook_menu().
+ */
+function tracker2_menu() {	//in progress
   $base = 'tracker2';
   $user_base = 'track2';
   if (!module_exists('tracker')) {
@@ -16,58 +28,64 @@
     $user_base = 'track';
   }
 
-  if ($may_cache) {
-    $items[] = array(
-      'path' => $base,
-      'title' => t('Recent posts'),
-      'callback' => 'tracker2_page',
-      'access' => user_access('access content'),
+    $items[$base] = array(
+      'title' => 'Recent posts',
+      'page callback' => 'tracker2_page',
+      'access arguments' => array('access content'),
       'weight' => 1,
     );
 
-    if ($user->uid) {
-      $items[] = array(
-        'path' => $base . '/all',
-        'title' => t('All recent posts'),
-        'type' => MENU_DEFAULT_LOCAL_TASK,
-      );
-      $items[] = array(
-        'path' => $base . '/'. $user->uid,
-        'title' => t('My recent posts'),
-        'type' => MENU_LOCAL_TASK,
-      );
-    }
+	$items[$base.'/all'] = array(
+	  'title' => 'All recent posts',
+	  'type' => MENU_DEFAULT_LOCAL_TASK,
+	);
+	$items[$base . '/%user_uid_optional'] = array(
+	  'title' => 'My recent posts',
+	  'access callback' => '_tracker2_myrecent_access',
+	  'access arguments' => array(1),
+	  'page arguments' => array(1),
+	  'type' => MENU_LOCAL_TASK,
+	);
     
-    $items[] = array(
-      'path' => 'admin/settings/tracker2',
+    $items['admin/settings/tracker2'] = array(
       'title' => 'Tracker 2',
-      'description' => t('High-performance reimplementation of the Tracker module.'),
-      'callback' => 'drupal_get_form',
-      'access' => user_access('administer tracker'),
-      'callback arguments' => array('tracker2_admin_settings')
+      'description' => 'High-performance reimplementation of the Tracker module.',
+      'page callback' => 'drupal_get_form',
+      'access arguments' => array('administer tracker'),
+      'page arguments' => array('tracker2_admin_settings')
+    );
+
+    $items['user/%user/'.$user_base] = array(
+      'title' => 'Track',
+      'page callback' => 'tracker2_track_user',
+      'access arguments' => array('access content'),
+      'type' => MENU_LOCAL_TASK,
+    );
+    $items['user/%user/'.$user_base.'/posts'] = array(
+      'title' => 'Track posts',
+      'type' => MENU_DEFAULT_LOCAL_TASK,
     );
-  }
-  else {
-    if (arg(0) == 'user' && is_numeric(arg(1))) {
-      $items[] = array(
-        'path' => 'user/'. arg(1) .'/' . $user_base,
-        'title' => t('Track'),
-        'callback' => 'tracker2_track_user',
-        'access' => user_access('access content'),
-        'type' => MENU_IS_LOCAL_TASK
-      );
-      $items[] = array(
-        'path' => 'user/'. arg(1) .'/' . $user_base . '/posts',
-        'title' => t('Track posts'),
-        'type' => MENU_DEFAULT_LOCAL_TASK,
-      );
-    }
-  }
 
   return $items;
 }
 
 /**
+ * Access callback for tracker/%user_uid_optional
+ */
+function _tracker2_myrecent_access($account) {
+  // This path is only allowed for authenticated users looking at their own posts.
+  return $account->uid && ($GLOBALS['user']->uid == $account->uid) && user_access('access content');
+}
+
+/**
+ * Access callback for user/%user/track
+ */
+function _tracker2_user_access($account) {
+  return user_view_access($account) && user_access('access content');
+}
+
+
+/**
  * Implementation of hook_perm().
  */
 function tracker2_perm() {
@@ -84,11 +102,13 @@
   
   if ($max_nid) {
     $form['max_nid'] = array(
+	  '#type' => 'value',
       '#value' => t('Max node ID for indexing on the next cron run: @max', array('@max' => $max_nid)),
     );
   }
   else {
     $form['max_nid'] = array(
+	  '#type' => 'value',
       '#value' => t('Existing nodes have finished tracker indexing.'),
     );
   }
@@ -145,7 +165,7 @@
       // Prepare a starting point for the next run
       variable_set('tracker2_index_nid', $last_nid - 1);
       
-      watchdog('tracker2', t('Indexed %count nodes for tracking.', array('%count' => $count)));
+      watchdog('tracker2', 'Indexed %count nodes for tracking.', array('%count' => $count));
     }
     else {
       // If all nodes have been indexed, set to zero to skip future cron runs
@@ -157,7 +177,7 @@
 /**
  * Implementation of hook_form_alter().
  */
-function tracker2_form_alter($form_id, &$form) {
+function tracker2_form_alter(&$form, $form_state, $form_id) {
   if ($form_id == 'node_admin_nodes') {
     $form['#submit']['tracker2_batch_node_alter'] = array();
   }
@@ -265,7 +285,7 @@
 /**
  * Implementation of hook_nodeapi().
  */
-function tracker2_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
+function tracker2_nodeapi(&$node, $op) {
   if ($op == 'insert' || $op == 'update') {
     _tracker2_add($node->nid, $node->uid, $node->changed);
   }
@@ -384,4 +404,4 @@
   else {
     drupal_not_found();
   }
-}
\ No newline at end of file
+}
--- tracker2.info	2008-06-02 14:14:56.000000000 +0200
+++ tracker2.info	2008-09-06 20:53:10.000000000 +0200
@@ -1,10 +1,8 @@
 ; $Id: tracker2.info,v 1.1.2.1 2008/06/02 04:20:12 straussd Exp $
 name = Tracker 2
 description = Enables tracking of recent posts for users.
-dependencies = comment
-
-; Information added by drupal.org packaging script on 2008-06-02
-version = "5.x-1.x-dev"
-project = "tracker2"
-datestamp = "1212408896"
+dependencies[] = comment
+core = 6.x
 
+version = "6.x-0.1-dev"
+core = "6.x"
--- tracker2.install	2008-06-02 06:20:12.000000000 +0200
+++ tracker2.install	2008-09-06 11:44:02.000000000 +0200
@@ -1,7 +1,13 @@
 <?php
-
 // $Id: tracker2.install,v 1.1.2.1 2008/06/02 04:20:12 straussd Exp $
 
+/**
+ * @file
+ * The (un)install and update code for the tracker2 module.
+ *
+ * @ingroup tracker2
+ */
+
 function tracker2_install() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
