From f7e9bab197205e6fa0d2e220902f5eb6573ac1cb Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 2 Oct 2001 21:33:10 +0000 Subject: - tidied up some "$status"-es and removed "$rstatus". --- includes/node.inc | 5 +++-- node.php | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/node.inc b/includes/node.inc index b820511a9..67c8a51f0 100644 --- a/includes/node.inc +++ b/includes/node.inc @@ -1,7 +1,6 @@ 0, expired => 1, queued => 2, posted => 3); -$rstatus = array(0 => dumped, 1 => expired, 2 => queued, 3 => posted); function _node_get($conditions) { foreach ($conditions as $key=>$value) { @@ -164,7 +163,9 @@ function node_form($node) { } function node_status($value) { - $status = array(dumped, expired, queued, posted); + + $status = array("dumped", "expired", "queued", "posted"); + if (module_exist($value)) { return array_intersect($status, node_invoke($value, "status")); } diff --git a/node.php b/node.php index 6b3d1ffc2..ac56fafe5 100644 --- a/node.php +++ b/node.php @@ -76,8 +76,7 @@ function node_failure() { } function node_history($node) { - global $status; - if ($node->status == $status[expired] || $node->status == $status[posted]) { + if ($node->status == node_status("expired") || $node->status == node_status("posted")) { $output .= "
". format_date($node->timestamp) ." by ". format_name($node) .":
". check_output($node->log, 1) ."

"; } if ($node->pid) { @@ -86,10 +85,10 @@ function node_history($node) { return $output; } -$number = ($title ? db_num_rows(db_query("SELECT nid FROM node WHERE title = '$title' AND status = $status[posted]")) : 1); +$number = ($title ? db_num_rows(db_query("SELECT nid FROM node WHERE title = '$title' AND status = '". node_status("posted") ."'")) : 1); if ($number > 1) { - $result = db_query("SELECT n.*, u.name, u.uid FROM node n LEFT JOIN user u ON n.author = u.uid WHERE n.title = '$title' AND n.status = $status[posted] ORDER BY timestamp DESC"); + $result = db_query("SELECT n.*, u.name, u.uid FROM node n LEFT JOIN user u ON n.author = u.uid WHERE n.title = '$title' AND n.status = '". node_status("posted") ."' ORDER BY timestamp DESC"); while ($node = db_fetch_object($result)) { if (node_access($node)) { -- cgit v1.2.3