From 8fafe12188a1532843ba798bcecef502c7cea415 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 4 Jun 2001 16:03:10 +0000 Subject: CHANGES: - Improvement to node listings. - Patched story.module to work with new node.module! NOTE: - UnConeD: poll.module needs updating. Let me know if you want me to do it as I assume you will update it unless otherwise mentioned. --- modules/node.module | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'modules/node.module') diff --git a/modules/node.module b/modules/node.module index 8aeb5715c..587c428f6 100644 --- a/modules/node.module +++ b/modules/node.module @@ -45,10 +45,11 @@ function node_cron() { db_query("UPDATE node SET status = '". node_status("dumped") ."', timestamp_posted = '' WHERE timestamp_hidden > 0 AND timestamp_hidden < ". time()); } -function node_overview($query = array()) { +function node_overview($query) { global $user; - $colors = array("#ffdc9b", "#dedec4"); + $color = array("#ffdc9b", "#dedec4"); + $query = node_query($query ? $query : 0); $result = db_query("SELECT n.*, u.userid, c.name AS category FROM node n LEFT JOIN users u ON n.author = u.id LEFT JOIN category c ON n.cid = c.cid $query[1] LIMIT 50"); @@ -65,10 +66,10 @@ function node_overview($query = array()) { $link[] = user_access($user, "node") ? "nid\">edit attributes" : "edit attributes"; $link[] = user_access($user, "node") ? "nid\">delete node" : "delete node"; - $color = $colors[$i++ % sizeof($colors)]; + $bg = $color[$i++ % sizeof($color)]; - $output .= " nid\">". check_output($node->title) ."$node->type". node_status($node->status) ."". check_output($node->attribute) ."". format_username($node->userid) ."". format_date($node->timestamp, "small") ."\n"; - $output .= " ". implode(", ", $link) ."\n"; + $output .= " nid\">". check_output($node->title) ."$node->type". node_status($node->status) ."". check_output($node->attribute) ."". format_username($node->userid) ."". format_date($node->timestamp, "small") ."\n"; + $output .= " ". implode(", ", $link) ."\n"; } $output .= "\n"; @@ -150,7 +151,7 @@ function node_query($type = "") { function node_listing($queries) { global $mod; foreach ($queries as $key=>$array) { - $output .= "
  • $array[0]
  • \n"; + $output .= "
  • $array[0]
  • \n"; } return "
      $output
    \n"; } @@ -259,7 +260,7 @@ function node_admin() { break; case "delete": print status(node_delete($id)); - print node_overview(); + print node_overview($query); break; case "listing": print node_listing(node_query()); @@ -274,7 +275,7 @@ function node_admin() { break; case "Save node": print node_admin_save($edit); - print node_overview(); + print node_overview($query); break; case "edit": print node_module_edit(node_get_array(array("nid" => $id)), $type); @@ -286,7 +287,7 @@ function node_admin() { print status(node_module_save($edit, $type)); // fall through: default: - print node_overview(node_query($query ? $query : 0)); + print node_overview($query); } } -- cgit v1.2.3