From af075abb3d42c422cb4fcb119ccdf4949a6c0fb4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 30 May 2002 20:26:08 +0000 Subject: - Fixed but #197: "Shouldn't going to index.php?or=xxx show all content for the term rather than only promoted content?". Reported by Barry, fixed by Revar's patch. --- modules/node.module | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/node.module') diff --git a/modules/node.module b/modules/node.module index cc9f63e98..68b64c59c 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1008,7 +1008,7 @@ function node_preview($node, $error = NULL) { function node_submit($node) { global $user, $theme; - + if (user_access("post content")) { /* @@ -1258,11 +1258,11 @@ function node_page() { if ($or) { // this is an OR of terms - $result = db_query("SELECT DISTINCT(n.nid), type FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' ORDER BY static DESC, created DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); + $result = db_query("SELECT DISTINCT(n.nid), type FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND ". ($id ? "nid = '$id' AND " : "") ."status = '1' ORDER BY static DESC, created DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); } else if ($and) { // this is an AND - $result = db_query("SELECT n.nid, type, count(*) AS c FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' GROUP BY n.nid HAVING c = ".count($terms)." ORDER BY static DESC, created DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); + $result = db_query("SELECT n.nid, type, count(*) AS c FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND ". ($id ? "nid = '$id' AND " : "") ."status = '1' GROUP BY n.nid HAVING c = ".count($terms)." ORDER BY static DESC, created DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); } else { $result = db_query("SELECT nid, type FROM node WHERE ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' ORDER BY static DESC, created DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); -- cgit v1.2.3