diff options
-rw-r--r-- | includes/node.inc | 5 | ||||
-rw-r--r-- | 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 @@ <?php $status = array(dumped => 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")); } @@ -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 .= "<dt><b>". format_date($node->timestamp) ." by ". format_name($node) .":</b></dt><dd>". check_output($node->log, 1) ."<p /></dd>"; } 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)) { |