diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-02-02 21:05:34 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-02-02 21:05:34 +0000 |
commit | 10cb57a0b7e51423be74546e1c8a474b187b8052 (patch) | |
tree | d310f4113ed3c8bd2e12f30edc5a96323915855f /modules/node.module | |
parent | e4ff41061466343e79efc74cd35c278e79353141 (diff) | |
download | brdo-10cb57a0b7e51423be74546e1c8a474b187b8052.tar.gz brdo-10cb57a0b7e51423be74546e1c8a474b187b8052.tar.bz2 |
- Removed redundant code.
Diffstat (limited to 'modules/node.module')
-rw-r--r-- | modules/node.module | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/node.module b/modules/node.module index 65cc88395..fc9d56c60 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1278,14 +1278,14 @@ function node_page() { if ($or) { // this is an OR of terms - $result = pager_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", ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); + $result = pager_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 status = '1' ORDER BY static DESC, created DESC", ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); } else if ($and) { // this is an AND - $result = pager_query("SELECT n.nid, n.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' GROUP BY n.nid, n.type, n.status, n.static, n.created HAVING COUNT(n.nid) = ".count($terms)." ORDER BY static DESC, created DESC", ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); + $result = pager_query("SELECT n.nid, n.type FROM node n LEFT JOIN term_node r ON n.nid = r.nid WHERE tid IN (".implode(",", $terms).") AND status = '1' GROUP BY n.nid, n.type, n.status, n.static, n.created HAVING COUNT(n.nid) = ".count($terms)." ORDER BY static DESC, created DESC", ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); } else { - $result = pager_query("SELECT nid, type FROM node WHERE ". ($id ? "nid = '$id'" : "promote = '1'") ." AND status = '1' ORDER BY static DESC, created DESC", ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); + $result = pager_query("SELECT nid, type FROM node WHERE promote = '1' AND status = '1' ORDER BY static DESC, created DESC", ($user->nodes ? $user->nodes : variable_get("default_nodes_main", 10))); } while ($node = db_fetch_object($result)) { |