summaryrefslogtreecommitdiff
path: root/modules/node.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2002-05-30 20:26:08 +0000
committerDries Buytaert <dries@buytaert.net>2002-05-30 20:26:08 +0000
commitaf075abb3d42c422cb4fcb119ccdf4949a6c0fb4 (patch)
treee59ab3e58648272bba47eb134f5cfdbfb773c77b /modules/node.module
parent8bba059a8e388cb1a3cd3bb6de2cb8b2d50f5bba (diff)
downloadbrdo-af075abb3d42c422cb4fcb119ccdf4949a6c0fb4.tar.gz
brdo-af075abb3d42c422cb4fcb119ccdf4949a6c0fb4.tar.bz2
- 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.
Diffstat (limited to 'modules/node.module')
-rw-r--r--modules/node.module6
1 files changed, 3 insertions, 3 deletions
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)));