? weight.patch
Index: weight.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/weight/weight.module,v
retrieving revision 1.23.2.6
diff -u -p -r1.23.2.6 weight.module
--- weight.module	25 Feb 2009 19:05:39 -0000	1.23.2.6
+++ weight.module	24 Mar 2009 19:02:39 -0000
@@ -58,26 +58,30 @@ function weight_menu() {
 }
 
 function weight_nodeapi(&$node, $op) {
-  switch ($op) {
-    case 'presave':
-      // Non-weighted nodes have a weight of zero.
-      if (is_null($node->node_weight)) {
-        $node->node_weight = 0;
-      }
-
-      // If the admin wants to use the menu weight, see if there is one.
-      if (variable_get('weight_use_menu', FALSE)) {
-        $node->node_weight = (isset($node->menu['link_title']) && !empty($node->menu['link_title'])) ? $node->menu['weight'] : $node->node_weight;
-      }
 
-      // Encode weight into the sticky value for the database.
-      _weight_encode($node);
-      break;
-
-    case 'load':
-      _weight_decode($node);
-      break;
-  }
+	$weight_node_types = variable_get('weight_node_types', array_flip(node_get_types('names')));
+	if (in_array($node->type, $weight_node_types)) {
+		switch ($op) {
+		  case 'presave':
+		    // Non-weighted nodes have a weight of zero.
+		    if (is_null($node->node_weight)) {
+		      $node->node_weight = 0;
+		    }
+
+		    // If the admin wants to use the menu weight, see if there is one.
+		    if (variable_get('weight_use_menu', FALSE)) {
+		      $node->node_weight = (isset($node->menu['link_title']) && !empty($node->menu['link_title'])) ? $node->menu['weight'] : $node->node_weight;
+		    }
+
+		    // Encode weight into the sticky value for the database.
+		    _weight_encode($node);
+		    break;
+
+		  case 'load':
+		    _weight_decode($node);
+		    break;
+		}
+	}
 }
 
 /**
