Index: watcher.module
===================================================================
--- watcher.module	(revision 72)
+++ watcher.module	(revision 161)
@@ -16,6 +16,10 @@
  *   NodeOne - www.nodeone.se
  */
 
+define('WATCHER_LINK_AT_TOP', 0);
+define('WATCHER_LINK_AT_BOTTOM', 1);
+define('WATCHER_LINK_BY_TEMPLATE', 2);
+
 /***************************************************************************************
  * THEME FUNCTIONS
  ***************************************************************************************/
@@ -2198,11 +2202,31 @@
   // Add CSS
   drupal_add_css(drupal_get_path('module', 'watcher') .'/css/watcher.css');
 
+  // addition by socketbind
+  $position = variable_get('watcher_link_position_'.$node->type, WATCHER_LINK_AT_BOTTOM );
+  
+  $weight = NULL;
+  
+  switch ( $position )
+  {
+    case WATCHER_LINK_AT_BOTTOM:
+      $weight = 30;
+      break;
+    case WATCHER_LINK_AT_TOP:
+      $weight = -30;
+      break;
+  }
+
   //Add element to node
-  $node->content['watcher'] = array(
-    '#value' => theme('watcher_node_toggle_watching_link', $user->uid, $node->nid, $dest, $watching, $tstrings),
-    '#weight' => 30,
-  );
+  if ( $weight != NULL )
+  {
+    $node->content['watcher'] = array(
+      '#value' => theme('watcher_node_toggle_watching_link', $user->uid, $node->nid, $dest, $watching, $tstrings),
+      '#weight' => $weight,
+    );
+  } else {
+    $node->watcher_link = theme('watcher_node_toggle_watching_link', $user->uid, $node->nid, $dest, $watching, $tstrings);
+  }
 }
 
 /**
@@ -2535,10 +2559,13 @@
   $comments = 0;
   if ($node->comment_count) {
     $comments = $node->comment_count;
-
+    
+    // link to the correct page
+    $all = comment_num_all($node->nid);
     if ($new = comment_num_new($node->nid)) {
+      $page = comment_new_page_count($all, $new, $node);
       $comments .= '<br />';
-      $comments .= l(format_plural($new, '1 new', '@count new'), "node/$node->nid", array('fragment' => 'new'));
+      $comments .= l(format_plural($new, '1 new', '@count new'), "node/$node->nid", array( 'query' => $page, 'fragment' => 'new'));
     }
   }
   return $comments;
@@ -3193,4 +3220,29 @@
   }
 }
 
+function watcher_form_alter(&$form, $form_state, $form_id) {
+  if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
+    
+    $form['watcher'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Watcher settings'),
+      '#weight' => 5,
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+    );
+    
+    $form['watcher']['watcher_link_position'] = array(
+      '#type' => 'radios',
+      '#title' => t('Watcher link position'),
+      '#default_value' => variable_get('watcher_link_position_'.$form['#node_type']->type, WATCHER_LINK_AT_BOTTOM ),
+      '#options' => array(
+        WATCHER_LINK_AT_BOTTOM => t('Bottom'),        
+        WATCHER_LINK_AT_TOP => t('Top'),
+        WATCHER_LINK_BY_TEMPLATE => t('Using $node->watcher_link variable.')        
+      ),
+    );
+  }
+}
+
 // EOF
