Index: weblinks.module
===================================================================
RCS file: /home/repos/drupal/drupal/sites/all/modules/weblinks/weblinks.module,v
retrieving revision 1.3
diff -b -d -u -b -d -u -r1.3 weblinks.module
--- weblinks.module	18 Mar 2007 20:45:49 -0000	1.3
+++ weblinks.module	27 Mar 2007 08:31:04 -0000
@@ -1096,8 +1096,8 @@
 	$result = db_query("
 		SELECT nr.body, n.*, bw.url 
 		FROM {node} n
-		INNER JOIN {node_revisions} nr ON nr.nid = n.nid 
-		INNER JOIN {weblinks} bw ON bw.nid = n.nid 
+		INNER JOIN {node_revisions} nr ON nr.vid = n.vid 
+		INNER JOIN {weblinks} bw ON bw.vid = n.vid 
 		INNER JOIN {term_data} td ON td.tid = bw.tid
 		WHERE td.tid = {$tid} AND n.status = 1
 		ORDER BY bw.weight ASC, n.title ASC {$limit}");
@@ -1150,15 +1150,16 @@
 
 	// Get the max number of posts to display
   $limitnum = variable_get("weblinks_maxdisp_block_".$tid, 10);
-	if ($limitnum) {$limit = "LIMIT {$limitnum}";}
+	if ($limitnum) { $limit = "LIMIT {$limitnum}"; }
 	$result = db_query("
 		SELECT nr.body, n.*, bw.url 
 		FROM {node} n
-		INNER JOIN {node_revisions} nr ON nr.nid = n.nid 
-		INNER JOIN {weblinks} bw ON bw.nid = n.nid 
+		INNER JOIN {node_revisions} nr ON nr.vid = n.vid 
+		INNER JOIN {weblinks} bw ON bw.vid = n.vid 
 		INNER JOIN {term_data} td ON td.tid = bw.tid
-		WHERE td.tid = {$tid} AND n.status = 1
-		ORDER BY bw.weight ASC, n.title ASC {$limit}}");
+		WHERE td.tid = %d AND n.status = 1
+		ORDER BY bw.weight ASC, n.title ASC %s",
+    $tid, $limit);
 	$block_content = "<ul>";
 	while ($row = db_fetch_array($result)) {
 		$title = $row['title'];
@@ -1188,11 +1189,12 @@
 	$result = db_query("
 		SELECT nr.body, n.*, bw.url 
 		FROM {node} n
-		INNER JOIN {node_revisions} nr ON nr.nid = n.nid 
-		INNER JOIN {weblinks} bw ON bw.nid = n.nid 
+		INNER JOIN {node_revisions} nr ON nr.vid = n.vid 
+		INNER JOIN {weblinks} bw ON bw.vid = n.vid 
 		INNER JOIN {term_data} td ON td.tid = bw.tid
 		WHERE n.status = 1
-		ORDER BY n.changed DESC, n.title ASC {$limit}}");
+		ORDER BY n.changed DESC, n.title ASC %s",
+    $limit);
 	$block_content = "<ul>";
 	while ($row = db_fetch_array($result)) {
 		$title = $row['title'];
