--- nodeorder.module	2008-03-21 15:05:02.000000000 +1100
+++ nodeorder.module.termcontext	2008-04-01 14:52:18.000000000 +1100
@@ -85,37 +85,37 @@ function nodeorder_taxonomy_form_vocabul
 
 /**
  * Implementation of hook_link().
+ *
+ * If the node is being displayed in a term in a vocabulary that is orderable,
+ * add links to the node that allow the user to move it up and down in the term,
+ * if the user has the correct permissions.
  */
 function nodeorder_link($type, $node = 0, $main = 0) {
   $links = array();
 
-  if (user_access('order nodes within categories') && variable_get('nodeorder_show_links_on_node', 1)) {
-    // If this node belongs to any vocabularies that are orderable,
-    // stick a couple links on per term to allow the user to move
-    // the node up or down within the term...
+  if (user_access('order nodes within categories') && 
+        variable_get('nodeorder_show_links_on_node', 1) &&
+        //check url to see if node is being viewed in a taxonomy term
+        ((arg(0) == 'taxonomy' || arg(0) == 'nodeorder') && arg(1) == 'term')) {
     if ($type == 'node') {
-      if (array_key_exists('taxonomy', $node)) {
-        foreach ($node->taxonomy as $term) {
+      $term = taxonomy_get_term(arg(2)); //get term id from request path
           $vocabulary = taxonomy_get_vocabulary($term->vid);
           if ($vocabulary->module == 'nodeorder') {
             $links['nodeorder_move_up_'. $term->tid] = array(
               'href' => "nodeorder/moveup/". $node->nid ."/". $term->tid, 
-              'title' => t("move up in ". $term->name), 
+            'title' => t("Move up"),
               'query' => "destination=". $_GET['q'],
-              'attributes' => array('title' => t("Move this ". $node->type ." up in its category.")),
+            'attributes' => array('title' => t("Move")." ".$node->title." ".t("up in this category.")),
             );
-    
             $links['nodeorder_move_down_'. $term->tid] = array(
               'href' => "nodeorder/movedown/". $node->nid ."/". $term->tid, 
-              'title' => t("move down in ". $term->name),
+            'title' => t("Move down"),
               'query' => "destination=". $_GET['q'],
-              'attributes' => array('title' => t("Move this ". $node->type ." down in its category.")),
+            'attributes' => array('title' => t("Move")." ".$node->title." ".t("down in this category.")),
             );
           }
         }
       }
-    }
-  }
 
   return $links;
 }
