summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-08-22 17:06:44 +0000
committerDries Buytaert <dries@buytaert.net>2003-08-22 17:06:44 +0000
commit4e2ee96d4c04fbee06abcd3d0bf84a7893792c7f (patch)
treefe81455832b44894f1cb9b96a3690279a2c195f9
parent134c9eb8878a814d6955e6471aa10f93302d20f8 (diff)
downloadbrdo-4e2ee96d4c04fbee06abcd3d0bf84a7893792c7f.tar.gz
brdo-4e2ee96d4c04fbee06abcd3d0bf84a7893792c7f.tar.bz2
- Removed left-overs from the rating module. Patch by Gerhard. Updated the
PostgreSQL and MSSQL database scheme as well. - Made sure the update script updates the correct tables when database prefixing is enabled. Patch by Bart Jansens. - Improved the breadcrumb navigation of the book and the forum module as per Keith Instone's suggestions. - Updated page titles (or block titles) and links to match. Suggested by Keith Instone. - Added missing 'thread' field to the comment table of the MySQL database scheme. Fixes bug #2590.
-rw-r--r--database/database.mssql1
-rw-r--r--database/database.mysql2
-rw-r--r--database/database.pgsql1
-rw-r--r--misc/drupal.css2
-rw-r--r--modules/book.module3
-rw-r--r--modules/book/book.module3
-rw-r--r--modules/forum.module20
-rw-r--r--modules/forum/forum.module20
-rw-r--r--modules/node.module2
-rw-r--r--modules/node/node.module2
-rw-r--r--modules/story.module4
-rw-r--r--modules/story/story.module4
-rw-r--r--modules/user.module7
-rw-r--r--modules/user/user.module7
-rw-r--r--themes/xtemplate/xtemplate.css3
-rw-r--r--update.php10
16 files changed, 44 insertions, 47 deletions
diff --git a/database/database.mssql b/database/database.mssql
index 25aee6143..16cb59fdf 100644
--- a/database/database.mssql
+++ b/database/database.mssql
@@ -345,7 +345,6 @@ CREATE TABLE [dbo].[users] (
[timestamp] [float] NOT NULL ,
[status] [smallint] NOT NULL ,
[timezone] [varchar] (8) NULL ,
- [rating] [float] NULL ,
[language] [char] (2) NULL ,
[init] [varchar] (128) NULL ,
[data] [varchar] (8000) NULL ,
diff --git a/database/database.mysql b/database/database.mysql
index 81e0f2c53..e64bf687a 100644
--- a/database/database.mysql
+++ b/database/database.mysql
@@ -125,6 +125,7 @@ CREATE TABLE comments (
link varchar(16) NOT NULL default '',
score mediumint(9) NOT NULL default '0',
status tinyint(3) unsigned NOT NULL default '0',
+ thread varchar(255) NOT NULL,
users mediumtext,
PRIMARY KEY (cid),
KEY lid (nid)
@@ -509,7 +510,6 @@ CREATE TABLE users (
timestamp int(11) NOT NULL default '0',
status tinyint(4) NOT NULL default '0',
timezone varchar(8) default NULL,
- rating decimal(8,2) default NULL,
language char(2) NOT NULL default '',
init varchar(64) default '',
data text,
diff --git a/database/database.pgsql b/database/database.pgsql
index 6e042464f..74b5cde3c 100644
--- a/database/database.pgsql
+++ b/database/database.pgsql
@@ -509,7 +509,6 @@ CREATE TABLE users (
timestamp integer NOT NULL default '0',
status smallint NOT NULL default '0',
timezone varchar(8) default NULL,
- rating decimal(8,2) default NULL,
language char(2) NOT NULL default '',
init varchar(64) default '',
data text default '',
diff --git a/misc/drupal.css b/misc/drupal.css
index 5989f964e..1a0299520 100644
--- a/misc/drupal.css
+++ b/misc/drupal.css
@@ -127,7 +127,7 @@ th {
font-size: 0.9em;
margin: 0.5em;
}
-#forum td.created, #forum td.posts, #forum td.topics, #forum td.last-reply, #forum td.replies, #forum td.statistics, #forum td.settings, #forum td.pager {
+#forum td.created, #forum td.posts, #forum td.topics, #forum td.last-reply, #forum td.replies, #forum td.pager {
text-align: center;
white-space: nowrap;
}
diff --git a/modules/book.module b/modules/book.module
index e8f672cbf..85f70c7f6 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -411,7 +411,8 @@ function book_view($node, $main = 0) {
// build the tree from bottom to top to have the book index in $level for navigation later
$path = book_location($node);
- $trail[] = l(t("Books"), "book");
+ $trail[] = l(t("Home"), "");
+ $trail[] = l(t("books"), "book");
foreach ($path as $level) {
$trail[] = l($level->title, "node/view/$level->nid");
}
diff --git a/modules/book/book.module b/modules/book/book.module
index e8f672cbf..85f70c7f6 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -411,7 +411,8 @@ function book_view($node, $main = 0) {
// build the tree from bottom to top to have the book index in $level for navigation later
$path = book_location($node);
- $trail[] = l(t("Books"), "book");
+ $trail[] = l(t("Home"), "");
+ $trail[] = l(t("books"), "book");
foreach ($path as $level) {
$trail[] = l($level->title, "node/view/$level->nid");
}
diff --git a/modules/forum.module b/modules/forum.module
index 942874299..a8a05d1b8 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -455,32 +455,29 @@ function forum_page() {
function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset) {
// forum list, topics list, topic browser and "add new topic" link
- theme("header");
/*
** Breadcrumb navigation:
*/
- if ($tid) {
- $trail[] = l(t("Forums"), "forum");
- }
- else {
- $trail[] = t("Forums");
- }
+ $trail[] = l(t("Home"), "");
+ $trail[] = l(t("forums"), "forum");
if ($parents) {
$parents = array_reverse($parents);
foreach ($parents as $p) {
- if ($tid != $p->tid) {
- $trail[] = l($p->name, "forum/$p->tid");
+ if ($p->tid == $tid) {
+ $title = $p->name;
}
else {
- $trail[] = $p->name;
+ $trail[] = l(strtolower($p->name), "forum/$p->tid");
}
}
}
$output = "<div id=\"forum\">";
+ $output .= "<div class=\"path\">". implode($trail, " &raquo; ") ."</div>";
+ $output .= "<div class=\"title\">$title</div>";
$output .= theme("forum_theme_list", $forums, $parents, $tid);
if ($tid) {
@@ -489,7 +486,8 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p
$output .= "</div>";
- theme("box", implode($trail, " &raquo; "), $output);
+ theme("header");
+ theme("box", NULL, $output);
theme("footer");
}
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 942874299..a8a05d1b8 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -455,32 +455,29 @@ function forum_page() {
function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset) {
// forum list, topics list, topic browser and "add new topic" link
- theme("header");
/*
** Breadcrumb navigation:
*/
- if ($tid) {
- $trail[] = l(t("Forums"), "forum");
- }
- else {
- $trail[] = t("Forums");
- }
+ $trail[] = l(t("Home"), "");
+ $trail[] = l(t("forums"), "forum");
if ($parents) {
$parents = array_reverse($parents);
foreach ($parents as $p) {
- if ($tid != $p->tid) {
- $trail[] = l($p->name, "forum/$p->tid");
+ if ($p->tid == $tid) {
+ $title = $p->name;
}
else {
- $trail[] = $p->name;
+ $trail[] = l(strtolower($p->name), "forum/$p->tid");
}
}
}
$output = "<div id=\"forum\">";
+ $output .= "<div class=\"path\">". implode($trail, " &raquo; ") ."</div>";
+ $output .= "<div class=\"title\">$title</div>";
$output .= theme("forum_theme_list", $forums, $parents, $tid);
if ($tid) {
@@ -489,7 +486,8 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p
$output .= "</div>";
- theme("box", implode($trail, " &raquo; "), $output);
+ theme("header");
+ theme("box", NULL, $output);
theme("footer");
}
diff --git a/modules/node.module b/modules/node.module
index f2f53a69b..79ca87943 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -1553,7 +1553,7 @@ function node_page() {
switch ($op) {
case "add":
- theme("box", t("Create new $name"), node_add(arg(2)));
+ theme("box", t("Submit $name"), node_add(arg(2)));
break;
case "edit":
theme("box", t("Edit $name"), node_edit(arg(2)));
diff --git a/modules/node/node.module b/modules/node/node.module
index f2f53a69b..79ca87943 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1553,7 +1553,7 @@ function node_page() {
switch ($op) {
case "add":
- theme("box", t("Create new $name"), node_add(arg(2)));
+ theme("box", t("Submit $name"), node_add(arg(2)));
break;
case "edit":
theme("box", t("Edit $name"), node_edit(arg(2)));
diff --git a/modules/story.module b/modules/story.module
index 5ff152742..1b6a4b1ea 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -9,12 +9,12 @@ function story_help($section = "admin/story/help") {
case "admin/system/modules/story":
$output = "Stories are like newspaper articles. They tend to follow a publishing flow of <b>submit -&gt; moderate -&gt; post to the main page -&gt; comments</b>. Below you may fix a minimum word count for stories and also write some submission or content guidelines for users wanting to post a story.";
break;
- case "admin/story/help":
+ case "admin/story/help":
$output = "<p>The story module lets your users submit articles for consideration by the rest of the community, who can vote on them if moderation is enabled. Stories usually follow a publishing flow of <b>submit -&gt; moderate -&gt; post to the main page -&gt; comments</b>. Administrators are able to shortcut this flow as desired.</p>";
$output .= "In ". l("site configuration &gt;&gt; modules &gt;&gt; story", "admin/system/modules/story") ." you can set up an introductory text for story authors, and a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trivially short stories.";
break;
}
-
+
return t($output);
}
diff --git a/modules/story/story.module b/modules/story/story.module
index 5ff152742..1b6a4b1ea 100644
--- a/modules/story/story.module
+++ b/modules/story/story.module
@@ -9,12 +9,12 @@ function story_help($section = "admin/story/help") {
case "admin/system/modules/story":
$output = "Stories are like newspaper articles. They tend to follow a publishing flow of <b>submit -&gt; moderate -&gt; post to the main page -&gt; comments</b>. Below you may fix a minimum word count for stories and also write some submission or content guidelines for users wanting to post a story.";
break;
- case "admin/story/help":
+ case "admin/story/help":
$output = "<p>The story module lets your users submit articles for consideration by the rest of the community, who can vote on them if moderation is enabled. Stories usually follow a publishing flow of <b>submit -&gt; moderate -&gt; post to the main page -&gt; comments</b>. Administrators are able to shortcut this flow as desired.</p>";
$output .= "In ". l("site configuration &gt;&gt; modules &gt;&gt; story", "admin/system/modules/story") ." you can set up an introductory text for story authors, and a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trivially short stories.";
break;
}
-
+
return t($output);
}
diff --git a/modules/user.module b/modules/user.module
index f8469639b..5b1069b60 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -334,7 +334,7 @@ function user_fields() {
}
// Make sure we return the default fields at least
- return is_array($fields) ? $fields: array("uid", "name", "pass", "mail", "homepage", "mode", "sort", "threshold", "theme", "signature", "timestamp", "status", "timezone", "rating", "language", "init", "data", "rid");
+ return is_array($fields) ? $fields: array("uid", "name", "pass", "mail", "homepage", "mode", "sort", "threshold", "theme", "signature", "timestamp", "status", "timezone", "language", "init", "data", "rid");
}
/*** Module hooks **********************************************************/
@@ -886,7 +886,7 @@ function user_register($edit = array()) {
user_role_init();
// TODO: is this necessary? Won't session_write replicate this?
unset($edit["session"]);
- $account = user_save("", array_merge(array("name" => $edit["name"], "pass" => $pass, "init" => $edit["mail"], "mail" => $edit["mail"], "rid" => _user_authenticated_id(), "rating" => 0, "status" => (variable_get("user_register", 1) == 1 ? 1 : 0)), $data));
+ $account = user_save("", array_merge(array("name" => $edit["name"], "pass" => $pass, "init" => $edit["mail"], "mail" => $edit["mail"], "rid" => _user_authenticated_id(), "status" => (variable_get("user_register", 1) == 1 ? 1 : 0)), $data));
watchdog("user", "new user: '". $edit["name"] ."' &lt;". $edit["mail"] ."&gt;", l(t("edit user"), "admin/user/edit/$account->uid"));
$variables = array("%username" => $edit["name"], "%site" => variable_get("site_name", "drupal"), "%password" => $pass, "%uri" => $base_url, "%uri_brief" => substr($base_url, strlen("http://")), "%mailto" => $edit["mail"], "%date" => format_date(time()));
@@ -1012,13 +1012,12 @@ function user_edit($edit = array()) {
*/
if (!user_access("administer users")) {
- if (array_intersect(array_keys($edit), array("rid", "init", "rating", "session"))) {
+ if (array_intersect(array_keys($edit), array("rid", "init", "session"))) {
watchdog("warning", "detected malicious attempt to alter a protected database field");
}
$edit["rid"] = $user->rid;
$edit["init"] = $user->init;
- $edit["rating"] = $user->rating;
$edit["session"] = $user->session;
}
diff --git a/modules/user/user.module b/modules/user/user.module
index f8469639b..5b1069b60 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -334,7 +334,7 @@ function user_fields() {
}
// Make sure we return the default fields at least
- return is_array($fields) ? $fields: array("uid", "name", "pass", "mail", "homepage", "mode", "sort", "threshold", "theme", "signature", "timestamp", "status", "timezone", "rating", "language", "init", "data", "rid");
+ return is_array($fields) ? $fields: array("uid", "name", "pass", "mail", "homepage", "mode", "sort", "threshold", "theme", "signature", "timestamp", "status", "timezone", "language", "init", "data", "rid");
}
/*** Module hooks **********************************************************/
@@ -886,7 +886,7 @@ function user_register($edit = array()) {
user_role_init();
// TODO: is this necessary? Won't session_write replicate this?
unset($edit["session"]);
- $account = user_save("", array_merge(array("name" => $edit["name"], "pass" => $pass, "init" => $edit["mail"], "mail" => $edit["mail"], "rid" => _user_authenticated_id(), "rating" => 0, "status" => (variable_get("user_register", 1) == 1 ? 1 : 0)), $data));
+ $account = user_save("", array_merge(array("name" => $edit["name"], "pass" => $pass, "init" => $edit["mail"], "mail" => $edit["mail"], "rid" => _user_authenticated_id(), "status" => (variable_get("user_register", 1) == 1 ? 1 : 0)), $data));
watchdog("user", "new user: '". $edit["name"] ."' &lt;". $edit["mail"] ."&gt;", l(t("edit user"), "admin/user/edit/$account->uid"));
$variables = array("%username" => $edit["name"], "%site" => variable_get("site_name", "drupal"), "%password" => $pass, "%uri" => $base_url, "%uri_brief" => substr($base_url, strlen("http://")), "%mailto" => $edit["mail"], "%date" => format_date(time()));
@@ -1012,13 +1012,12 @@ function user_edit($edit = array()) {
*/
if (!user_access("administer users")) {
- if (array_intersect(array_keys($edit), array("rid", "init", "rating", "session"))) {
+ if (array_intersect(array_keys($edit), array("rid", "init", "session"))) {
watchdog("warning", "detected malicious attempt to alter a protected database field");
}
$edit["rid"] = $user->rid;
$edit["init"] = $user->init;
- $edit["rating"] = $user->rating;
$edit["session"] = $user->session;
}
diff --git a/themes/xtemplate/xtemplate.css b/themes/xtemplate/xtemplate.css
index 92df5c336..6774e9ac4 100644
--- a/themes/xtemplate/xtemplate.css
+++ b/themes/xtemplate/xtemplate.css
@@ -171,6 +171,9 @@ table {
.node .links a, .comment .links a {
font-weight: bold;
}
+.path a, .path a:visited {
+ color: #777;
+}
.comment .title {
font-weight: bold;
font-size: 1.1em;
diff --git a/update.php b/update.php
index feff9f2e0..1b7a72325 100644
--- a/update.php
+++ b/update.php
@@ -329,11 +329,11 @@ function _update_thread_structure($comments, $pid, $depth, $structure) {
}
function update_60() {
- update_sql("ALTER TABLE forum DROP icon");
+ update_sql("ALTER TABLE {forum} DROP icon");
}
function update_61() {
- update_sql("CREATE TABLE IF NOT EXISTS sessions (
+ update_sql("CREATE TABLE IF NOT EXISTS {sessions} (
uid int(10) unsigned NOT NULL,
sid varchar(32) NOT NULL default '',
hostname varchar(128) NOT NULL default '',
@@ -344,9 +344,9 @@ function update_61() {
KEY timestamp (timestamp)
)");
- update_sql("ALTER TABLE users DROP session;");
- update_sql("ALTER TABLE users DROP hostname;");
- update_sql("ALTER TABLE users DROP sid;");
+ update_sql("ALTER TABLE {users} DROP session;");
+ update_sql("ALTER TABLE {users} DROP hostname;");
+ update_sql("ALTER TABLE {users} DROP sid;");
}
function _update_next_thread($structure, $parent) {