diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/aggregator.module | 4 | ||||
-rw-r--r-- | modules/aggregator/aggregator.module | 4 | ||||
-rw-r--r-- | modules/block.module | 1 | ||||
-rw-r--r-- | modules/block/block.module | 1 | ||||
-rw-r--r-- | modules/blog.module | 20 | ||||
-rw-r--r-- | modules/blog/blog.module | 20 | ||||
-rw-r--r-- | modules/book.module | 22 | ||||
-rw-r--r-- | modules/book/book.module | 22 | ||||
-rw-r--r-- | modules/comment.module | 6 | ||||
-rw-r--r-- | modules/comment/comment.module | 6 | ||||
-rw-r--r-- | modules/forum.module | 2 | ||||
-rw-r--r-- | modules/forum/forum.module | 2 | ||||
-rw-r--r-- | modules/import.module | 4 | ||||
-rw-r--r-- | modules/node.module | 2 | ||||
-rw-r--r-- | modules/node/node.module | 2 | ||||
-rw-r--r-- | modules/page.module | 2 | ||||
-rw-r--r-- | modules/page/page.module | 2 | ||||
-rw-r--r-- | modules/queue.module | 6 | ||||
-rw-r--r-- | modules/rating.module | 8 | ||||
-rw-r--r-- | modules/story.module | 4 | ||||
-rw-r--r-- | modules/story/story.module | 4 | ||||
-rw-r--r-- | modules/tracker.module | 4 | ||||
-rw-r--r-- | modules/tracker/tracker.module | 4 | ||||
-rw-r--r-- | modules/user.module | 2 | ||||
-rw-r--r-- | modules/user/user.module | 2 |
25 files changed, 81 insertions, 75 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module index 7798d1f5f..2ac1b690c 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -95,7 +95,7 @@ function import_get_bundles($attributes = 0) { $i = 0; while ($bundle = db_fetch_object($result)) { $block[$i][subject] = $bundle->title; - $block[$i][content] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\"><a href=\"module.php?mod=import&op=bundle&id=$bundle->bid\">". t("details") ."</a></div></p>"; + $block[$i][content] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\"><a href=\"module.php?mod=import&op=bundle&id=$bundle->bid\">". t("more") ."</a></div></p>"; $block[$i][info] = "$bundle->title bundle"; $i++; @@ -110,7 +110,7 @@ function import_get_feeds($attributes = 0) { $i = 0; while ($feed = db_fetch_object($result)) { $block[$i][subject] = $feed->title; - $block[$i][content] = import_feed_block($feed) ."<p><div align=\"right\"><a href=\"module.php?mod=import&op=feed&id=$feed->fid\">". t("details") ."</a></div></p>"; + $block[$i][content] = import_feed_block($feed) ."<p><div align=\"right\"><a href=\"module.php?mod=import&op=feed&id=$feed->fid\">". t("more") ."</a></div></p>"; $block[$i][info] = "$feed->title feed"; $i++; diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 7798d1f5f..2ac1b690c 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -95,7 +95,7 @@ function import_get_bundles($attributes = 0) { $i = 0; while ($bundle = db_fetch_object($result)) { $block[$i][subject] = $bundle->title; - $block[$i][content] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\"><a href=\"module.php?mod=import&op=bundle&id=$bundle->bid\">". t("details") ."</a></div></p>"; + $block[$i][content] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\"><a href=\"module.php?mod=import&op=bundle&id=$bundle->bid\">". t("more") ."</a></div></p>"; $block[$i][info] = "$bundle->title bundle"; $i++; @@ -110,7 +110,7 @@ function import_get_feeds($attributes = 0) { $i = 0; while ($feed = db_fetch_object($result)) { $block[$i][subject] = $feed->title; - $block[$i][content] = import_feed_block($feed) ."<p><div align=\"right\"><a href=\"module.php?mod=import&op=feed&id=$feed->fid\">". t("details") ."</a></div></p>"; + $block[$i][content] = import_feed_block($feed) ."<p><div align=\"right\"><a href=\"module.php?mod=import&op=feed&id=$feed->fid\">". t("more") ."</a></div></p>"; $block[$i][info] = "$feed->title feed"; $i++; diff --git a/modules/block.module b/modules/block.module index ef576b95f..529dc4c8f 100644 --- a/modules/block.module +++ b/modules/block.module @@ -111,6 +111,7 @@ function block_admin_preview() { } function block_init() { + $result = db_query("SELECT * FROM modules"); while ($module = db_fetch_object($result)) { module_rehash($module->name); diff --git a/modules/block/block.module b/modules/block/block.module index ef576b95f..529dc4c8f 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -111,6 +111,7 @@ function block_admin_preview() { } function block_init() { + $result = db_query("SELECT * FROM modules"); while ($module = db_fetch_object($result)) { module_rehash($module->name); diff --git a/modules/blog.module b/modules/blog.module index 732da9fa7..1365d4d90 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -40,7 +40,7 @@ function blog_feed_user($uid = 0, $date = 0) { $date = time(); } - $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body, u.name, u.uid FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.uid WHERE u.uid = '$uid' AND n.timestamp > '". ($date - 2592000) ."' ORDER BY b.lid DESC LIMIT 15"); + $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body, u.name, u.uid FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.uid = u.uid WHERE u.uid = '$uid' AND n.timestamp > '". ($date - 2592000) ."' ORDER BY b.nid DESC LIMIT 15"); while ($blog = db_fetch_object($result)) { $items .= format_rss_item($blog->title, path_uri() ."node.php?id=$blog->nid", $blog->body); } @@ -59,7 +59,7 @@ function blog_feed_user($uid = 0, $date = 0) { } function blog_feed_last() { - $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body, u.name, u.uid FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.uid ORDER BY b.lid DESC LIMIT 15"); + $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body, u.name, u.uid FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.uid = u.uid ORDER BY b.nid DESC LIMIT 15"); while ($blog = db_fetch_object($result)) { $items .= format_rss_item($blog->title, path_uri() ."module.php?mod=blog&op=view&id=$blog->uid", $blog->body); } @@ -89,7 +89,7 @@ function blog_page_user($uid = 0, $date = 0) { $date = time(); } - $result = db_query("SELECT n.nid, n.title, n.comment, COUNT(c.cid) AS comments, n.timestamp, b.body, u.uid, u.name FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.uid LEFT JOIN comments c ON n.nid = c.lid WHERE u.uid = '$account->uid' AND n.timestamp <= '$date' AND n.timestamp >= '". ($date - 2592000) ."' GROUP BY n.nid, n.title, n.comment, n.timestamp, b.body, u.uid, u.name ORDER BY n.nid DESC LIMIT 20"); + $result = db_query("SELECT n.nid, n.title, n.comment, COUNT(c.cid) AS comments, n.timestamp, b.body, u.uid, u.name FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.uid = u.uid LEFT JOIN comments c ON n.nid = c.lid WHERE u.uid = '$account->uid' AND n.timestamp <= '$date' AND n.timestamp >= '". ($date - 2592000) ."' GROUP BY n.nid, n.title, n.comment, n.timestamp, b.body, u.uid, u.name ORDER BY n.nid DESC LIMIT 20"); $output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">"; @@ -128,7 +128,7 @@ function blog_page_user($uid = 0, $date = 0) { function blog_page_last() { global $theme, $user; - $result = db_query("SELECT n.nid, n.title, n.comment, COUNT(c.cid) AS comments, n.timestamp, b.body, u.uid, u.name FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.uid LEFT JOIN comments c ON n.nid = c.lid GROUP BY n.nid, n.title, n.comment, n.timestamp, b.body, u.uid, u.name ORDER BY n.nid DESC LIMIT 20"); + $result = db_query("SELECT n.nid, n.title, n.comment, COUNT(c.cid) AS comments, n.timestamp, b.body, u.uid, u.name FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.uid = u.uid LEFT JOIN comments c ON n.nid = c.lid GROUP BY n.nid, n.title, n.comment, n.timestamp, b.body, u.uid, u.name ORDER BY n.nid DESC LIMIT 20"); $output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">"; @@ -239,7 +239,7 @@ function blog_save($edit) { node_save($edit, array(title, body, type => "blog")); } else { - node_save($edit, array(attributes => node_attributes_save("blog", $edit), author => $user->uid, body, comment => variable_get("blog_comment", 0), moderate => variable_get("blog_moderate", ""), promote => variable_get("blog_promote", 0), score => 0, status => variable_get("blog_status", $status[posted]), timestamp => time(), title, type => "blog", votes => 0)); + node_save($edit, array(attributes => node_attributes_save("blog", $edit), uid => $user->uid, body, comment => variable_get("blog_comment", 0), moderate => variable_get("blog_moderate", ""), promote => variable_get("blog_promote", 0), score => 0, status => variable_get("blog_status", $status[posted]), timestamp => time(), title, type => "blog", votes => 0)); } } } @@ -247,7 +247,7 @@ function blog_save($edit) { function blog_edit_history($nid) { global $user; - $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body FROM blog b LEFT JOIN node n ON b.nid = n.nid WHERE n.author = '$user->uid' AND n.nid <= '". check_input($nid) ."' ORDER BY b.lid DESC LIMIT 15"); + $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body FROM blog b LEFT JOIN node n ON b.nid = n.nid WHERE n.uid = '$user->uid' AND n.nid <= '". check_input($nid) ."' ORDER BY b.nid DESC LIMIT 15"); $output .= "<table cellpadding=\"3\" cellspacing=\"3\" border=\"0\" width=\"100%\">"; while ($blog = db_fetch_object($result)) { @@ -340,13 +340,15 @@ function blog_link($type, $node = 0) { function blog_block() { global $user; - $result = db_query("SELECT u.uid, u.name, n.timestamp, n.title, n.nid FROM node n LEFT JOIN users u ON n.author = u.uid WHERE n.type = 'blog' ORDER BY n.nid DESC LIMIT 10"); + $result = db_query("SELECT u.uid, u.name, n.timestamp, n.title, n.nid FROM node n LEFT JOIN users u ON n.uid = u.uid WHERE n.type = 'blog' ORDER BY n.nid DESC LIMIT 10"); while ($node = db_fetch_object($result)) { $output .= "<a href=\"node.php?id=$node->nid\">". check_output($node->title) ."</a><br />\n"; } - $block[0]["subject"] = "<a href=\"module.php?mod=blog\">". t("User blogs") ."</a>"; + $output .= "<br /><div align=\"right\"><a href=\"module.php?mod=blog\">". t("more") ."</a></div>"; + + $block[0]["subject"] = t("User blogs"); $block[0]["content"] = $output; $block[0]["info"] = t("User blogs"); $block[0]["link"] = "module.php?mod=blog"; @@ -358,7 +360,7 @@ function blog_block() { function blog_search($keys) { global $PHP_SELF, $status; - $result = db_query("SELECT n.*, b.* FROM blog b LEFT JOIN node n ON n.nid = b.nid AND n.lid = b.lid WHERE (n.title LIKE '%$keys%' OR b.body LIKE '%$keys%') ORDER BY n.timestamp DESC LIMIT 20"); + $result = db_query("SELECT n.*, b.* FROM blog b LEFT JOIN node n ON n.nid = b.nid WHERE (n.title LIKE '%$keys%' OR b.body LIKE '%$keys%') ORDER BY n.timestamp DESC LIMIT 20"); while ($blog = db_fetch_object($result)) { $find[$i++] = array("title" => check_output($blog->title), "link" => (strstr($PHP_SELF, "admin.php") ? "admin.php?mod=node&type=blog&op=edit&id=$blog->nid" : "node.php?id=$blog->nid"), "user" => $blog->name, "date" => $blog->timestamp); } diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 732da9fa7..1365d4d90 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -40,7 +40,7 @@ function blog_feed_user($uid = 0, $date = 0) { $date = time(); } - $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body, u.name, u.uid FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.uid WHERE u.uid = '$uid' AND n.timestamp > '". ($date - 2592000) ."' ORDER BY b.lid DESC LIMIT 15"); + $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body, u.name, u.uid FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.uid = u.uid WHERE u.uid = '$uid' AND n.timestamp > '". ($date - 2592000) ."' ORDER BY b.nid DESC LIMIT 15"); while ($blog = db_fetch_object($result)) { $items .= format_rss_item($blog->title, path_uri() ."node.php?id=$blog->nid", $blog->body); } @@ -59,7 +59,7 @@ function blog_feed_user($uid = 0, $date = 0) { } function blog_feed_last() { - $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body, u.name, u.uid FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.uid ORDER BY b.lid DESC LIMIT 15"); + $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body, u.name, u.uid FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.uid = u.uid ORDER BY b.nid DESC LIMIT 15"); while ($blog = db_fetch_object($result)) { $items .= format_rss_item($blog->title, path_uri() ."module.php?mod=blog&op=view&id=$blog->uid", $blog->body); } @@ -89,7 +89,7 @@ function blog_page_user($uid = 0, $date = 0) { $date = time(); } - $result = db_query("SELECT n.nid, n.title, n.comment, COUNT(c.cid) AS comments, n.timestamp, b.body, u.uid, u.name FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.uid LEFT JOIN comments c ON n.nid = c.lid WHERE u.uid = '$account->uid' AND n.timestamp <= '$date' AND n.timestamp >= '". ($date - 2592000) ."' GROUP BY n.nid, n.title, n.comment, n.timestamp, b.body, u.uid, u.name ORDER BY n.nid DESC LIMIT 20"); + $result = db_query("SELECT n.nid, n.title, n.comment, COUNT(c.cid) AS comments, n.timestamp, b.body, u.uid, u.name FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.uid = u.uid LEFT JOIN comments c ON n.nid = c.lid WHERE u.uid = '$account->uid' AND n.timestamp <= '$date' AND n.timestamp >= '". ($date - 2592000) ."' GROUP BY n.nid, n.title, n.comment, n.timestamp, b.body, u.uid, u.name ORDER BY n.nid DESC LIMIT 20"); $output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">"; @@ -128,7 +128,7 @@ function blog_page_user($uid = 0, $date = 0) { function blog_page_last() { global $theme, $user; - $result = db_query("SELECT n.nid, n.title, n.comment, COUNT(c.cid) AS comments, n.timestamp, b.body, u.uid, u.name FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.author = u.uid LEFT JOIN comments c ON n.nid = c.lid GROUP BY n.nid, n.title, n.comment, n.timestamp, b.body, u.uid, u.name ORDER BY n.nid DESC LIMIT 20"); + $result = db_query("SELECT n.nid, n.title, n.comment, COUNT(c.cid) AS comments, n.timestamp, b.body, u.uid, u.name FROM blog b LEFT JOIN node n ON b.nid = n.nid LEFT JOIN users u ON n.uid = u.uid LEFT JOIN comments c ON n.nid = c.lid GROUP BY n.nid, n.title, n.comment, n.timestamp, b.body, u.uid, u.name ORDER BY n.nid DESC LIMIT 20"); $output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"4\">"; @@ -239,7 +239,7 @@ function blog_save($edit) { node_save($edit, array(title, body, type => "blog")); } else { - node_save($edit, array(attributes => node_attributes_save("blog", $edit), author => $user->uid, body, comment => variable_get("blog_comment", 0), moderate => variable_get("blog_moderate", ""), promote => variable_get("blog_promote", 0), score => 0, status => variable_get("blog_status", $status[posted]), timestamp => time(), title, type => "blog", votes => 0)); + node_save($edit, array(attributes => node_attributes_save("blog", $edit), uid => $user->uid, body, comment => variable_get("blog_comment", 0), moderate => variable_get("blog_moderate", ""), promote => variable_get("blog_promote", 0), score => 0, status => variable_get("blog_status", $status[posted]), timestamp => time(), title, type => "blog", votes => 0)); } } } @@ -247,7 +247,7 @@ function blog_save($edit) { function blog_edit_history($nid) { global $user; - $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body FROM blog b LEFT JOIN node n ON b.nid = n.nid WHERE n.author = '$user->uid' AND n.nid <= '". check_input($nid) ."' ORDER BY b.lid DESC LIMIT 15"); + $result = db_query("SELECT n.nid, n.title, n.timestamp, b.body FROM blog b LEFT JOIN node n ON b.nid = n.nid WHERE n.uid = '$user->uid' AND n.nid <= '". check_input($nid) ."' ORDER BY b.nid DESC LIMIT 15"); $output .= "<table cellpadding=\"3\" cellspacing=\"3\" border=\"0\" width=\"100%\">"; while ($blog = db_fetch_object($result)) { @@ -340,13 +340,15 @@ function blog_link($type, $node = 0) { function blog_block() { global $user; - $result = db_query("SELECT u.uid, u.name, n.timestamp, n.title, n.nid FROM node n LEFT JOIN users u ON n.author = u.uid WHERE n.type = 'blog' ORDER BY n.nid DESC LIMIT 10"); + $result = db_query("SELECT u.uid, u.name, n.timestamp, n.title, n.nid FROM node n LEFT JOIN users u ON n.uid = u.uid WHERE n.type = 'blog' ORDER BY n.nid DESC LIMIT 10"); while ($node = db_fetch_object($result)) { $output .= "<a href=\"node.php?id=$node->nid\">". check_output($node->title) ."</a><br />\n"; } - $block[0]["subject"] = "<a href=\"module.php?mod=blog\">". t("User blogs") ."</a>"; + $output .= "<br /><div align=\"right\"><a href=\"module.php?mod=blog\">". t("more") ."</a></div>"; + + $block[0]["subject"] = t("User blogs"); $block[0]["content"] = $output; $block[0]["info"] = t("User blogs"); $block[0]["link"] = "module.php?mod=blog"; @@ -358,7 +360,7 @@ function blog_block() { function blog_search($keys) { global $PHP_SELF, $status; - $result = db_query("SELECT n.*, b.* FROM blog b LEFT JOIN node n ON n.nid = b.nid AND n.lid = b.lid WHERE (n.title LIKE '%$keys%' OR b.body LIKE '%$keys%') ORDER BY n.timestamp DESC LIMIT 20"); + $result = db_query("SELECT n.*, b.* FROM blog b LEFT JOIN node n ON n.nid = b.nid WHERE (n.title LIKE '%$keys%' OR b.body LIKE '%$keys%') ORDER BY n.timestamp DESC LIMIT 20"); while ($blog = db_fetch_object($result)) { $find[$i++] = array("title" => check_output($blog->title), "link" => (strstr($PHP_SELF, "admin.php") ? "admin.php?mod=node&type=blog&op=edit&id=$blog->nid" : "node.php?id=$blog->nid"), "user" => $blog->name, "date" => $blog->timestamp); } diff --git a/modules/book.module b/modules/book.module index 6d7d9f536..cd2beb0ac 100644 --- a/modules/book.module +++ b/modules/book.module @@ -30,7 +30,7 @@ function book_status() { } function book_location($node, $nodes = array()) { - $parent = db_fetch_object(db_query("SELECT n.nid, n.title, b.parent FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.nid = '$node->parent'")); + $parent = db_fetch_object(db_query("SELECT n.nid, n.title, b.parent FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.nid = '$node->parent'")); if ($parent->title) { $nodes = book_location($parent, $nodes); array_push($nodes, $parent); @@ -47,8 +47,8 @@ function book_view($node, $main = 0) { else { if ($node->nid && $node->parent) { $list = book_parent_query($node->parent); - $next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND (b.weight > '$node->weight' OR (b.weight = '$node->weight' AND n.title > '". check_query($node->title) ."')) ORDER BY b.weight ASC,n.title ASC")); - $prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND (b.weight < '$node->weight' OR (b.weight = '$node->weight' AND n.title < '". check_query($node->title) ."')) ORDER BY b.weight DESC,n.title DESC")); + $next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.status = '$status[posted]' AND $list AND (b.weight > '$node->weight' OR (b.weight = '$node->weight' AND n.title > '". check_query($node->title) ."')) ORDER BY b.weight ASC,n.title ASC")); + $prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.status = '$status[posted]' AND $list AND (b.weight < '$node->weight' OR (b.weight = '$node->weight' AND n.title < '". check_query($node->title) ."')) ORDER BY b.weight DESC,n.title DESC")); } $output .= "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"100%\">\n"; @@ -83,7 +83,7 @@ function book_view($node, $main = 0) { function book_search($keys) { global $PHP_SELF, $status; - $result = db_query("SELECT n.*, u.name FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid LEFT JOIN users u ON n.author = u.uid WHERE n.type = 'book' AND n.status = '$status[posted]' AND (n.title LIKE '%". check_input($keys) ."%' OR b.body LIKE '%". check_input($keys) ."%') ORDER BY n.timestamp DESC LIMIT 20"); + $result = db_query("SELECT n.*, u.name FROM node n LEFT JOIN book b ON n.nid = b.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.type = 'book' AND n.status = '$status[posted]' AND (n.title LIKE '%". check_input($keys) ."%' OR b.body LIKE '%". check_input($keys) ."%') ORDER BY n.timestamp DESC LIMIT 20"); while ($node = db_fetch_object($result)) { $find[$i++] = array("title" => check_output($node->title), "link" => (strstr($PHP_SELF, "admin.php") ? "admin.php?mod=node&type=book&op=edit&id=$node->nid" : "node.php?id=$node->nid"), "user" => $node->name, "date" => $node->timestamp); } @@ -105,7 +105,7 @@ function book_toc($parent = "", $indent = "", $toc = array()) { global $status; // select all child nodes: - $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.type = 'book' AND n.status = '$status[posted]' AND ". book_parent_query($parent) ." ORDER BY b.weight"); + $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.type = 'book' AND n.status = '$status[posted]' AND ". book_parent_query($parent) ." ORDER BY b.weight"); // add root node: if (user_access("administer nodes")) { @@ -168,7 +168,7 @@ function book_save($edit) { global $status, $user; if (!$edit[nid]) { - node_save($edit, array(author => $user->uid, body, comment => variable_get("book_comment", 0), log, moderate => variable_get("book_moderate", ""), parent, pid, promote => variable_get("book_promote", 0), score => 0, status => variable_get("book_status", $status[queued]), timestamp => time(), title, type => "book", votes => 0, weight)); + node_save($edit, array(uid => $user->uid, body, comment => variable_get("book_comment", 0), log, moderate => variable_get("book_moderate", ""), parent, pid, promote => variable_get("book_promote", 0), score => 0, status => variable_get("book_status", $status[queued]), timestamp => time(), title, type => "book", votes => 0, weight)); } else if (user_access("administer nodes")) { node_save($edit, array(body, log, parent, title, type => "book", weight)); @@ -209,7 +209,7 @@ function book_tree($parent = "", $depth = 0) { if ($depth < 3 || strstr($PHP_SELF,"admin.php")) { // select all child nodes: - $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.type = 'book' AND n.status = '$status[posted]' AND ". book_parent_query($parent) ." ORDER BY b.weight, n.title"); + $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.type = 'book' AND n.status = '$status[posted]' AND ". book_parent_query($parent) ." ORDER BY b.weight, n.title"); // render output: while ($node = db_fetch_object($result)) { @@ -233,7 +233,7 @@ function book_admin() { function book_render() { global $status, $theme; - $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.parent = 0 AND n.status = $status[posted] ORDER BY b.weight"); + $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE b.parent = 0 AND n.status = $status[posted] ORDER BY b.weight"); while ($node = db_fetch_object($result)) { $output .= "<DT><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></DT><DD>". check_output($node->body, 1) ."<BR><BR></DD>"; @@ -271,7 +271,7 @@ function book_edit($id) { if ($node->status != $status[posted]) { return t("You can only update accepted pages: pages that are still queued or already expired can not be updated."); } - else if (db_result(db_query("SELECT COUNT(n.nid) FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.pid = '$node->nid' AND n.status = '$status[queued]'"))) { + else if (db_result(db_query("SELECT COUNT(n.nid) FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE b.pid = '$node->nid' AND n.status = '$status[queued]'"))) { return t("There is already an update for this node in the queue: we can only process one update at once."); } else { @@ -304,7 +304,7 @@ function book_user() { function book_export_html($id = "", $depth = 1) { global $status; - $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.type = 'book' AND n.status = '$status[posted]' AND n.nid = '". check_input($id) ."'"); + $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.type = 'book' AND n.status = '$status[posted]' AND n.nid = '". check_input($id) ."'"); while ($node = db_fetch_object($result)) { $output .= "<H$depth>". check_output($node->title) ."</H$depth>"; @@ -318,7 +318,7 @@ function book_export_html($id = "", $depth = 1) { function book_export_html_recursive($parent = "", $depth = 1) { global $status; - $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.type = 'book' AND n.status = '$status[posted]' AND b.parent = '$parent' ORDER BY b.weight"); + $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.type = 'book' AND n.status = '$status[posted]' AND b.parent = '$parent' ORDER BY b.weight"); while ($node = db_fetch_object($result)) { $output .= "<H$depth>". check_output($node->title) ."</H$depth>"; diff --git a/modules/book/book.module b/modules/book/book.module index 6d7d9f536..cd2beb0ac 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -30,7 +30,7 @@ function book_status() { } function book_location($node, $nodes = array()) { - $parent = db_fetch_object(db_query("SELECT n.nid, n.title, b.parent FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.nid = '$node->parent'")); + $parent = db_fetch_object(db_query("SELECT n.nid, n.title, b.parent FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.nid = '$node->parent'")); if ($parent->title) { $nodes = book_location($parent, $nodes); array_push($nodes, $parent); @@ -47,8 +47,8 @@ function book_view($node, $main = 0) { else { if ($node->nid && $node->parent) { $list = book_parent_query($node->parent); - $next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND (b.weight > '$node->weight' OR (b.weight = '$node->weight' AND n.title > '". check_query($node->title) ."')) ORDER BY b.weight ASC,n.title ASC")); - $prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.status = '$status[posted]' AND $list AND (b.weight < '$node->weight' OR (b.weight = '$node->weight' AND n.title < '". check_query($node->title) ."')) ORDER BY b.weight DESC,n.title DESC")); + $next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.status = '$status[posted]' AND $list AND (b.weight > '$node->weight' OR (b.weight = '$node->weight' AND n.title > '". check_query($node->title) ."')) ORDER BY b.weight ASC,n.title ASC")); + $prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.status = '$status[posted]' AND $list AND (b.weight < '$node->weight' OR (b.weight = '$node->weight' AND n.title < '". check_query($node->title) ."')) ORDER BY b.weight DESC,n.title DESC")); } $output .= "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"100%\">\n"; @@ -83,7 +83,7 @@ function book_view($node, $main = 0) { function book_search($keys) { global $PHP_SELF, $status; - $result = db_query("SELECT n.*, u.name FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid LEFT JOIN users u ON n.author = u.uid WHERE n.type = 'book' AND n.status = '$status[posted]' AND (n.title LIKE '%". check_input($keys) ."%' OR b.body LIKE '%". check_input($keys) ."%') ORDER BY n.timestamp DESC LIMIT 20"); + $result = db_query("SELECT n.*, u.name FROM node n LEFT JOIN book b ON n.nid = b.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.type = 'book' AND n.status = '$status[posted]' AND (n.title LIKE '%". check_input($keys) ."%' OR b.body LIKE '%". check_input($keys) ."%') ORDER BY n.timestamp DESC LIMIT 20"); while ($node = db_fetch_object($result)) { $find[$i++] = array("title" => check_output($node->title), "link" => (strstr($PHP_SELF, "admin.php") ? "admin.php?mod=node&type=book&op=edit&id=$node->nid" : "node.php?id=$node->nid"), "user" => $node->name, "date" => $node->timestamp); } @@ -105,7 +105,7 @@ function book_toc($parent = "", $indent = "", $toc = array()) { global $status; // select all child nodes: - $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.type = 'book' AND n.status = '$status[posted]' AND ". book_parent_query($parent) ." ORDER BY b.weight"); + $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.type = 'book' AND n.status = '$status[posted]' AND ". book_parent_query($parent) ." ORDER BY b.weight"); // add root node: if (user_access("administer nodes")) { @@ -168,7 +168,7 @@ function book_save($edit) { global $status, $user; if (!$edit[nid]) { - node_save($edit, array(author => $user->uid, body, comment => variable_get("book_comment", 0), log, moderate => variable_get("book_moderate", ""), parent, pid, promote => variable_get("book_promote", 0), score => 0, status => variable_get("book_status", $status[queued]), timestamp => time(), title, type => "book", votes => 0, weight)); + node_save($edit, array(uid => $user->uid, body, comment => variable_get("book_comment", 0), log, moderate => variable_get("book_moderate", ""), parent, pid, promote => variable_get("book_promote", 0), score => 0, status => variable_get("book_status", $status[queued]), timestamp => time(), title, type => "book", votes => 0, weight)); } else if (user_access("administer nodes")) { node_save($edit, array(body, log, parent, title, type => "book", weight)); @@ -209,7 +209,7 @@ function book_tree($parent = "", $depth = 0) { if ($depth < 3 || strstr($PHP_SELF,"admin.php")) { // select all child nodes: - $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.type = 'book' AND n.status = '$status[posted]' AND ". book_parent_query($parent) ." ORDER BY b.weight, n.title"); + $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.type = 'book' AND n.status = '$status[posted]' AND ". book_parent_query($parent) ." ORDER BY b.weight, n.title"); // render output: while ($node = db_fetch_object($result)) { @@ -233,7 +233,7 @@ function book_admin() { function book_render() { global $status, $theme; - $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.parent = 0 AND n.status = $status[posted] ORDER BY b.weight"); + $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE b.parent = 0 AND n.status = $status[posted] ORDER BY b.weight"); while ($node = db_fetch_object($result)) { $output .= "<DT><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></DT><DD>". check_output($node->body, 1) ."<BR><BR></DD>"; @@ -271,7 +271,7 @@ function book_edit($id) { if ($node->status != $status[posted]) { return t("You can only update accepted pages: pages that are still queued or already expired can not be updated."); } - else if (db_result(db_query("SELECT COUNT(n.nid) FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.pid = '$node->nid' AND n.status = '$status[queued]'"))) { + else if (db_result(db_query("SELECT COUNT(n.nid) FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE b.pid = '$node->nid' AND n.status = '$status[queued]'"))) { return t("There is already an update for this node in the queue: we can only process one update at once."); } else { @@ -304,7 +304,7 @@ function book_user() { function book_export_html($id = "", $depth = 1) { global $status; - $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.type = 'book' AND n.status = '$status[posted]' AND n.nid = '". check_input($id) ."'"); + $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.type = 'book' AND n.status = '$status[posted]' AND n.nid = '". check_input($id) ."'"); while ($node = db_fetch_object($result)) { $output .= "<H$depth>". check_output($node->title) ."</H$depth>"; @@ -318,7 +318,7 @@ function book_export_html($id = "", $depth = 1) { function book_export_html_recursive($parent = "", $depth = 1) { global $status; - $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.type = 'book' AND n.status = '$status[posted]' AND b.parent = '$parent' ORDER BY b.weight"); + $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid WHERE n.type = 'book' AND n.status = '$status[posted]' AND b.parent = '$parent' ORDER BY b.weight"); while ($node = db_fetch_object($result)) { $output .= "<H$depth>". check_output($node->title) ."</H$depth>"; diff --git a/modules/comment.module b/modules/comment.module index d87b89724..c1a3e617c 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -2,7 +2,7 @@ function comment_search($keys) { global $PHP_SELF; - $result = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN users u ON c.author = u.uid WHERE c.subject LIKE '%$keys%' OR c.comment LIKE '%$keys%' ORDER BY c.timestamp DESC LIMIT 20"); + $result = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.subject LIKE '%$keys%' OR c.comment LIKE '%$keys%' ORDER BY c.timestamp DESC LIMIT 20"); while ($comment = db_fetch_object($result)) { $find[$i++] = array("title" => check_output($comment->subject), "link" => (strstr($PHP_SELF, "admin.php") ? "admin.php?mod=comment&op=edit&id=$comment->cid" : "node.php?id=$comment->lid&cid=$comment->cid"), "user" => $comment->name, "date" => $comment->timestamp); } @@ -23,7 +23,7 @@ function comment_link($type) { function comment_edit($id) { - $result = db_query("SELECT c.*, u.name, u.uid FROM comments c LEFT JOIN users u ON c.author = u.uid WHERE c.cid = '$id'"); + $result = db_query("SELECT c.*, u.name, u.uid FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.cid = '$id'"); $comment = db_fetch_object($result); $form .= form_item(t("Author"), format_name($comment)); @@ -40,7 +40,7 @@ function comment_save($id, $edit) { } function comment_overview() { - $result = db_query("SELECT c.*, u.name, u.uid FROM comments c LEFT JOIN users u ON u.uid = c.author ORDER BY timestamp DESC LIMIT 50"); + $result = db_query("SELECT c.*, u.name, u.uid FROM comments c LEFT JOIN users u ON u.uid = c.uid ORDER BY timestamp DESC LIMIT 50"); $output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n"; $output .= " <TR><TH>subject</TH><TH>author</TH><TH>date</TH><TH COLSPAN=\"2\">operations</TH></TR>\n"; diff --git a/modules/comment/comment.module b/modules/comment/comment.module index d87b89724..c1a3e617c 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -2,7 +2,7 @@ function comment_search($keys) { global $PHP_SELF; - $result = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN users u ON c.author = u.uid WHERE c.subject LIKE '%$keys%' OR c.comment LIKE '%$keys%' ORDER BY c.timestamp DESC LIMIT 20"); + $result = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.subject LIKE '%$keys%' OR c.comment LIKE '%$keys%' ORDER BY c.timestamp DESC LIMIT 20"); while ($comment = db_fetch_object($result)) { $find[$i++] = array("title" => check_output($comment->subject), "link" => (strstr($PHP_SELF, "admin.php") ? "admin.php?mod=comment&op=edit&id=$comment->cid" : "node.php?id=$comment->lid&cid=$comment->cid"), "user" => $comment->name, "date" => $comment->timestamp); } @@ -23,7 +23,7 @@ function comment_link($type) { function comment_edit($id) { - $result = db_query("SELECT c.*, u.name, u.uid FROM comments c LEFT JOIN users u ON c.author = u.uid WHERE c.cid = '$id'"); + $result = db_query("SELECT c.*, u.name, u.uid FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.cid = '$id'"); $comment = db_fetch_object($result); $form .= form_item(t("Author"), format_name($comment)); @@ -40,7 +40,7 @@ function comment_save($id, $edit) { } function comment_overview() { - $result = db_query("SELECT c.*, u.name, u.uid FROM comments c LEFT JOIN users u ON u.uid = c.author ORDER BY timestamp DESC LIMIT 50"); + $result = db_query("SELECT c.*, u.name, u.uid FROM comments c LEFT JOIN users u ON u.uid = c.uid ORDER BY timestamp DESC LIMIT 50"); $output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n"; $output .= " <TR><TH>subject</TH><TH>author</TH><TH>date</TH><TH COLSPAN=\"2\">operations</TH></TR>\n"; diff --git a/modules/forum.module b/modules/forum.module index 984832c9f..4d4d9811b 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -31,7 +31,7 @@ function forum_form($edit = array()) { function forum_save($edit) { global $user, $status; - node_save($edit, array(author => $user->uid, body, comment => 1, moderate => 0, promote => 0, score => 0, status => $status[posted], timestamp => time(), title, type => "forum", votes => 0)); + node_save($edit, array(uid => $user->uid, body, comment => 1, moderate => 0, promote => 0, score => 0, status => $status[posted], timestamp => time(), title, type => "forum", votes => 0)); } function forum_num_comments($nid) { diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 984832c9f..4d4d9811b 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -31,7 +31,7 @@ function forum_form($edit = array()) { function forum_save($edit) { global $user, $status; - node_save($edit, array(author => $user->uid, body, comment => 1, moderate => 0, promote => 0, score => 0, status => $status[posted], timestamp => time(), title, type => "forum", votes => 0)); + node_save($edit, array(uid => $user->uid, body, comment => 1, moderate => 0, promote => 0, score => 0, status => $status[posted], timestamp => time(), title, type => "forum", votes => 0)); } function forum_num_comments($nid) { diff --git a/modules/import.module b/modules/import.module index 7798d1f5f..2ac1b690c 100644 --- a/modules/import.module +++ b/modules/import.module @@ -95,7 +95,7 @@ function import_get_bundles($attributes = 0) { $i = 0; while ($bundle = db_fetch_object($result)) { $block[$i][subject] = $bundle->title; - $block[$i][content] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\"><a href=\"module.php?mod=import&op=bundle&id=$bundle->bid\">". t("details") ."</a></div></p>"; + $block[$i][content] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\"><a href=\"module.php?mod=import&op=bundle&id=$bundle->bid\">". t("more") ."</a></div></p>"; $block[$i][info] = "$bundle->title bundle"; $i++; @@ -110,7 +110,7 @@ function import_get_feeds($attributes = 0) { $i = 0; while ($feed = db_fetch_object($result)) { $block[$i][subject] = $feed->title; - $block[$i][content] = import_feed_block($feed) ."<p><div align=\"right\"><a href=\"module.php?mod=import&op=feed&id=$feed->fid\">". t("details") ."</a></div></p>"; + $block[$i][content] = import_feed_block($feed) ."<p><div align=\"right\"><a href=\"module.php?mod=import&op=feed&id=$feed->fid\">". t("more") ."</a></div></p>"; $block[$i][info] = "$feed->title feed"; $i++; diff --git a/modules/node.module b/modules/node.module index bc40e6ba5..4c0767db0 100644 --- a/modules/node.module +++ b/modules/node.module @@ -114,7 +114,7 @@ function node_overview($query) { $color = array("#ffffff", "#e5e5e5"); $query = node_query($query ? $query : 0); - $result = db_query("SELECT n.*, u.name, u.uid FROM node n LEFT JOIN users u ON n.author = u.uid $query[1] LIMIT 50"); + $result = db_query("SELECT n.*, u.name, u.uid FROM node n LEFT JOIN users u ON n.uid = u.uid $query[1] LIMIT 50"); $output .= status($query[0]); $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; diff --git a/modules/node/node.module b/modules/node/node.module index bc40e6ba5..4c0767db0 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -114,7 +114,7 @@ function node_overview($query) { $color = array("#ffffff", "#e5e5e5"); $query = node_query($query ? $query : 0); - $result = db_query("SELECT n.*, u.name, u.uid FROM node n LEFT JOIN users u ON n.author = u.uid $query[1] LIMIT 50"); + $result = db_query("SELECT n.*, u.name, u.uid FROM node n LEFT JOIN users u ON n.uid = u.uid $query[1] LIMIT 50"); $output .= status($query[0]); $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; diff --git a/modules/page.module b/modules/page.module index 01deece17..4b46a99c2 100644 --- a/modules/page.module +++ b/modules/page.module @@ -72,7 +72,7 @@ function page_form($edit = array()) { function page_save($edit) { global $status, $user; - node_save($edit, array(author => $user->uid, link, body, comment => variable_get("page_comment", 0), format, moderate => variable_get("page_moderate", ""), promote => variable_get("page_promote", 0), score => 0, status => $status["posted"], timestamp => time(), title, type => "page", votes => 0)); + node_save($edit, array(uid => $user->uid, link, body, comment => variable_get("page_comment", 0), format, moderate => variable_get("page_moderate", ""), promote => variable_get("page_promote", 0), score => 0, status => $status["posted"], timestamp => time(), title, type => "page", votes => 0)); } ?>
\ No newline at end of file diff --git a/modules/page/page.module b/modules/page/page.module index 01deece17..4b46a99c2 100644 --- a/modules/page/page.module +++ b/modules/page/page.module @@ -72,7 +72,7 @@ function page_form($edit = array()) { function page_save($edit) { global $status, $user; - node_save($edit, array(author => $user->uid, link, body, comment => variable_get("page_comment", 0), format, moderate => variable_get("page_moderate", ""), promote => variable_get("page_promote", 0), score => 0, status => $status["posted"], timestamp => time(), title, type => "page", votes => 0)); + node_save($edit, array(uid => $user->uid, link, body, comment => variable_get("page_comment", 0), format, moderate => variable_get("page_moderate", ""), promote => variable_get("page_promote", 0), score => 0, status => $status["posted"], timestamp => time(), title, type => "page", votes => 0)); } ?>
\ No newline at end of file diff --git a/modules/queue.module b/modules/queue.module index 2ea116f8c..b1b08b115 100644 --- a/modules/queue.module +++ b/modules/queue.module @@ -64,12 +64,12 @@ function queue_vote($id, $vote) { function queue_overview() { global $status, $theme, $user; - $result = db_query("SELECT n.*, u.name, u.uid FROM node n LEFT JOIN users u ON n.author = u.uid WHERE n.status = '$status[queued]'"); + $result = db_query("SELECT n.*, u.name, u.uid FROM node n LEFT JOIN users u ON n.uid = u.uid WHERE n.status = '$status[queued]'"); $content .= "<TABLE BORDER=\"0\" CELLSPACING=\"4\" CELLPADDING=\"4\">\n"; $content .= " <TR><TH>". t("Subject") ."</TH><TH>". t("Author") ."</TH><TH>". t("Type") ."</TH><TH>". t("Score") ."</TH></TR>\n"; while ($node = db_fetch_object($result)) { - if ($user->uid == $node->author || field_get($node->users, $user->uid)) $content .= " <TR><TD><A HREF=\"module.php?mod=queue&op=view&id=$node->nid\">". check_output($node->title) ."</A></TD><TD ALIGN=\"center\">". format_name($node) ."</TD><TD ALIGN=\"center\">". check_output($node->type) ."</TD><TD ALIGN=\"center\">". queue_score($node->nid) ."</TD></TR>\n"; + if ($user->uid == $node->uid || field_get($node->users, $user->uid)) $content .= " <TR><TD><A HREF=\"module.php?mod=queue&op=view&id=$node->nid\">". check_output($node->title) ."</A></TD><TD ALIGN=\"center\">". format_name($node) ."</TD><TD ALIGN=\"center\">". check_output($node->type) ."</TD><TD ALIGN=\"center\">". queue_score($node->nid) ."</TD></TR>\n"; else $content .= " <TR><TD><A HREF=\"module.php?mod=queue&op=view&id=$node->nid\">". check_output($node->title) ."</A></TD><TD ALIGN=\"center\">". format_name($node) ."</TD><TD ALIGN=\"center\">". check_output($node->type) ."</TD><TD ALIGN=\"center\"><A HREF=\"module.php?mod=queue&op=view&id=$node->nid\">". t("vote") ."</A></TD></TR>\n"; } $content .= "</TABLE>\n"; @@ -85,7 +85,7 @@ function queue_node($id) { $node = node_get_object(array(nid => $id)); - if ($user->uid == $node->author || field_get($node->users, $user->uid)) { + if ($user->uid == $node->uid || field_get($node->users, $user->uid)) { drupal_goto("node.php?id=$node->nid"); } else { diff --git a/modules/rating.module b/modules/rating.module index dd00aafb9..7c17a34e7 100644 --- a/modules/rating.module +++ b/modules/rating.module @@ -50,24 +50,24 @@ function rating_help() { <? } -function rating_gravity($id) { +function rating_gravity($uid) { global $status; $period = 5184000; // maximum 60 days $number = 30; // maximum 30 comments - $r1 = db_query("SELECT nid, type FROM node WHERE author = '$id' AND (". time() ." - timestamp < $period) AND status = '$status[posted]'"); + $r1 = db_query("SELECT nid, type FROM node WHERE uid = '$uid' AND (". time() ." - timestamp < $period) AND status = '$status[posted]'"); while ($node = db_fetch_object($r1)) { $bonus += variable_get("rating_weight_$node->type", 0); } - $r2 = db_query("SELECT nid, type FROM node WHERE author = '$id' AND (". time() ." - timestamp < $period) AND status = '$status[dumped]'"); + $r2 = db_query("SELECT nid, type FROM node WHERE uid = '$uid' AND (". time() ." - timestamp < $period) AND status = '$status[dumped]'"); while ($node = db_fetch_object($r1)) { $bonus -= variable_get("rating_weight_$node->type", 0); } /* - $r3 = db_query("SELECT score, votes FROM comments WHERE author = '$id' AND votes > 0 AND (". time() ." - timestamp < $period) ORDER BY timestamp LIMIT $number"); + $r3 = db_query("SELECT score, votes FROM comments WHERE uid = '$uid' AND votes > 0 AND (". time() ." - timestamp < $period) ORDER BY timestamp LIMIT $number"); while ($comment = db_fetch_object($r3)) { $weight++; $score += $weight * $comment->score; diff --git a/modules/story.module b/modules/story.module index c068f05ce..e7190b4fd 100644 --- a/modules/story.module +++ b/modules/story.module @@ -14,7 +14,7 @@ function story_status() { function story_search($keys) { global $PHP_SELF, $status; - $result = db_query("SELECT n.*, s.* FROM story s LEFT JOIN node n ON n.nid = s.nid AND n.lid = s.lid WHERE n.status = '$status[posted]' AND (n.title LIKE '%$keys%' OR s.abstract LIKE '%$keys%' OR s.body LIKE '%$keys%') ORDER BY n.timestamp DESC LIMIT 20"); + $result = db_query("SELECT n.*, s.* FROM story s LEFT JOIN node n ON n.nid = s.nid WHERE n.status = '$status[posted]' AND (n.title LIKE '%$keys%' OR s.abstract LIKE '%$keys%' OR s.body LIKE '%$keys%') ORDER BY n.timestamp DESC LIMIT 20"); while ($story = db_fetch_object($result)) { $find[$i++] = array("title" => check_output($story->title), "link" => (strstr($PHP_SELF, "admin.php") ? "admin.php?mod=node&type=story&op=edit&id=$story->nid" : "node.php?id=$story->nid"), "user" => $story->name, "date" => $story->timestamp); } @@ -80,7 +80,7 @@ function story_save($edit) { global $status, $user; if (!$edit[nid]) { - node_save($edit, array(abstract, attributes => node_attributes_save("story", $edit), author => $user->uid, body, comment => variable_get("story_comment", 0), moderate => variable_get("story_moderate", ""), promote => variable_get("story_promote", 0), score => 0, status => variable_get("story_status", $status[queued]), timestamp => time(), title, type => "story", votes => 0)); + node_save($edit, array(abstract, attributes => node_attributes_save("story", $edit), uid => $user->uid, body, comment => variable_get("story_comment", 0), moderate => variable_get("story_moderate", ""), promote => variable_get("story_promote", 0), score => 0, status => variable_get("story_status", $status[queued]), timestamp => time(), title, type => "story", votes => 0)); } else if (user_access("administer nodes")) { node_save($edit, array(abstract, attributes => node_attributes_save("story", $edit), body, title, type => "story")); diff --git a/modules/story/story.module b/modules/story/story.module index c068f05ce..e7190b4fd 100644 --- a/modules/story/story.module +++ b/modules/story/story.module @@ -14,7 +14,7 @@ function story_status() { function story_search($keys) { global $PHP_SELF, $status; - $result = db_query("SELECT n.*, s.* FROM story s LEFT JOIN node n ON n.nid = s.nid AND n.lid = s.lid WHERE n.status = '$status[posted]' AND (n.title LIKE '%$keys%' OR s.abstract LIKE '%$keys%' OR s.body LIKE '%$keys%') ORDER BY n.timestamp DESC LIMIT 20"); + $result = db_query("SELECT n.*, s.* FROM story s LEFT JOIN node n ON n.nid = s.nid WHERE n.status = '$status[posted]' AND (n.title LIKE '%$keys%' OR s.abstract LIKE '%$keys%' OR s.body LIKE '%$keys%') ORDER BY n.timestamp DESC LIMIT 20"); while ($story = db_fetch_object($result)) { $find[$i++] = array("title" => check_output($story->title), "link" => (strstr($PHP_SELF, "admin.php") ? "admin.php?mod=node&type=story&op=edit&id=$story->nid" : "node.php?id=$story->nid"), "user" => $story->name, "date" => $story->timestamp); } @@ -80,7 +80,7 @@ function story_save($edit) { global $status, $user; if (!$edit[nid]) { - node_save($edit, array(abstract, attributes => node_attributes_save("story", $edit), author => $user->uid, body, comment => variable_get("story_comment", 0), moderate => variable_get("story_moderate", ""), promote => variable_get("story_promote", 0), score => 0, status => variable_get("story_status", $status[queued]), timestamp => time(), title, type => "story", votes => 0)); + node_save($edit, array(abstract, attributes => node_attributes_save("story", $edit), uid => $user->uid, body, comment => variable_get("story_comment", 0), moderate => variable_get("story_moderate", ""), promote => variable_get("story_promote", 0), score => 0, status => variable_get("story_status", $status[queued]), timestamp => time(), title, type => "story", votes => 0)); } else if (user_access("administer nodes")) { node_save($edit, array(abstract, attributes => node_attributes_save("story", $edit), body, title, type => "story")); diff --git a/modules/tracker.module b/modules/tracker.module index 462a649b4..d3f113e19 100644 --- a/modules/tracker.module +++ b/modules/tracker.module @@ -13,7 +13,7 @@ function tracker_comments($id = 0) { global $theme, $user; if ($id) { - $sresult = db_query("SELECT n.nid, n.title, COUNT(n.nid) AS comments, MAX(c.timestamp) AS last_comment FROM comments c LEFT JOIN node n ON c.lid = n.nid WHERE c.author = '". check_input($id) ."' GROUP BY n.nid, n.title DESC ORDER BY last_comment DESC LIMIT 10"); + $sresult = db_query("SELECT n.nid, n.title, COUNT(n.nid) AS comments, MAX(c.timestamp) AS last_comment FROM comments c LEFT JOIN node n ON c.lid = n.nid WHERE c.uid = '". check_input($id) ."' GROUP BY n.nid, n.title DESC ORDER BY last_comment DESC LIMIT 10"); } else { $sresult = db_query("SELECT n.nid, n.title, COUNT(n.nid) AS comments, MAX(c.timestamp) AS last_comment FROM comments c LEFT JOIN node n ON c.lid = n.nid GROUP BY n.nid, n.title DESC ORDER BY last_comment DESC LIMIT 10"); @@ -23,7 +23,7 @@ function tracker_comments($id = 0) { $output .= format_plural($node->comments, "comment", "comments") ." ". t("attached to node") ." <a href=\"node.php?id=$node->nid\">". check_output($node->title) ."</a>:\n"; if ($id) { - $cresult = db_query("SELECT * FROM comments WHERE author = '". check_input($id) ."' AND lid = '$node->nid' ORDER BY cid DESC"); + $cresult = db_query("SELECT * FROM comments WHERE uid = '". check_input($id) ."' AND lid = '$node->nid' ORDER BY cid DESC"); } else { $cresult = db_query("SELECT * FROM comments WHERE lid = '$node->nid' ORDER BY cid DESC"); diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index 462a649b4..d3f113e19 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -13,7 +13,7 @@ function tracker_comments($id = 0) { global $theme, $user; if ($id) { - $sresult = db_query("SELECT n.nid, n.title, COUNT(n.nid) AS comments, MAX(c.timestamp) AS last_comment FROM comments c LEFT JOIN node n ON c.lid = n.nid WHERE c.author = '". check_input($id) ."' GROUP BY n.nid, n.title DESC ORDER BY last_comment DESC LIMIT 10"); + $sresult = db_query("SELECT n.nid, n.title, COUNT(n.nid) AS comments, MAX(c.timestamp) AS last_comment FROM comments c LEFT JOIN node n ON c.lid = n.nid WHERE c.uid = '". check_input($id) ."' GROUP BY n.nid, n.title DESC ORDER BY last_comment DESC LIMIT 10"); } else { $sresult = db_query("SELECT n.nid, n.title, COUNT(n.nid) AS comments, MAX(c.timestamp) AS last_comment FROM comments c LEFT JOIN node n ON c.lid = n.nid GROUP BY n.nid, n.title DESC ORDER BY last_comment DESC LIMIT 10"); @@ -23,7 +23,7 @@ function tracker_comments($id = 0) { $output .= format_plural($node->comments, "comment", "comments") ." ". t("attached to node") ." <a href=\"node.php?id=$node->nid\">". check_output($node->title) ."</a>:\n"; if ($id) { - $cresult = db_query("SELECT * FROM comments WHERE author = '". check_input($id) ."' AND lid = '$node->nid' ORDER BY cid DESC"); + $cresult = db_query("SELECT * FROM comments WHERE uid = '". check_input($id) ."' AND lid = '$node->nid' ORDER BY cid DESC"); } else { $cresult = db_query("SELECT * FROM comments WHERE lid = '$node->nid' ORDER BY cid DESC"); diff --git a/modules/user.module b/modules/user.module index 2f4a13241..d812354d2 100644 --- a/modules/user.module +++ b/modules/user.module @@ -251,7 +251,7 @@ function user_link($type) { } if ($type == "admin") { - $links[] = "<a href=\"admin.php?mod=user\">user system</a>"; + $links[] = "<a href=\"admin.php?mod=user\">user management</a>"; } return $links ? $links : array(); diff --git a/modules/user/user.module b/modules/user/user.module index 2f4a13241..d812354d2 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -251,7 +251,7 @@ function user_link($type) { } if ($type == "admin") { - $links[] = "<a href=\"admin.php?mod=user\">user system</a>"; + $links[] = "<a href=\"admin.php?mod=user\">user management</a>"; } return $links ? $links : array(); |