diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-10-16 17:29:26 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-10-16 17:29:26 +0000 |
commit | 880842885bd3e970bb752248ba72fb7b9957bc77 (patch) | |
tree | 90deba74233ee69c3b08c41d3802138527ddf06e | |
parent | 7624580f76937fbb004f81da8e6069dbb16921dc (diff) | |
download | brdo-880842885bd3e970bb752248ba72fb7b9957bc77.tar.gz brdo-880842885bd3e970bb752248ba72fb7b9957bc77.tar.bz2 |
- Fixed bug #3637: made comment module settings translatable. Patch #13 by Moshe.
- Fixed bug #3642: removed duplicate settings from user page. Patch #14 by Moshe.
- Fixed bug #3503: added 'forum topic' link to the 'create content' menu. Patch
by Gobar. I think this might be more intuitive and consistent code-wise; I don't
want to introduce small hacks.
- Cache improvement: small cache improvement to prevent SQL errors. Patch by
Jeremy.
-rw-r--r-- | includes/common.inc | 6 | ||||
-rw-r--r-- | modules/comment.module | 2 | ||||
-rw-r--r-- | modules/comment/comment.module | 2 | ||||
-rw-r--r-- | modules/forum.module | 4 | ||||
-rw-r--r-- | modules/forum/forum.module | 4 | ||||
-rw-r--r-- | modules/user.module | 8 | ||||
-rw-r--r-- | modules/user/user.module | 8 |
7 files changed, 12 insertions, 22 deletions
diff --git a/includes/common.inc b/includes/common.inc index 8587741b7..8aa9e853e 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -755,10 +755,8 @@ function cache_get($key) { } function cache_set($cid, $data, $expire = 0) { - if (db_fetch_object(db_query("SELECT cid FROM {cache} WHERE cid = '%s'", $cid))) { - db_query("UPDATE {cache} SET data = '%s', created = %d, expire = %d WHERE cid = '%s'", $data, time(), $expire, $cid); - } - else { + db_query("UPDATE {cache} SET data = '%s', created = %d, expire = %d WHERE cid = '%s'", $data, time(), $expire, $cid); + if (!db_affected_rows()) { db_query("INSERT INTO {cache} (cid, data, created, expire) VALUES('%s', '%s', %d, %d)", $cid, $data, time(), $expire); } } diff --git a/modules/comment.module b/modules/comment.module index 4b700fd05..10ba96760 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -1619,7 +1619,7 @@ function comment_update_index() { function comment_nodeapi(&$node, $op, $arg = 0) { switch ($op) { case "settings": - $output[t("comment")] = form_select("", "comment_$node->type", variable_get("comment_$node->type", 2), array("Disabled", "Read only", "Read/Write")); + $output[t("comment")] = form_select("", "comment_$node->type", variable_get("comment_$node->type", 2), array(t("Disabled"), t("Read only"), t("Read/Write"))); return $output; case "fields": return array("comment"); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 4b700fd05..10ba96760 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1619,7 +1619,7 @@ function comment_update_index() { function comment_nodeapi(&$node, $op, $arg = 0) { switch ($op) { case "settings": - $output[t("comment")] = form_select("", "comment_$node->type", variable_get("comment_$node->type", 2), array("Disabled", "Read only", "Read/Write")); + $output[t("comment")] = form_select("", "comment_$node->type", variable_get("comment_$node->type", 2), array(t("Disabled"), t("Read only"), t("Read/Write"))); return $output; case "fields": return array("comment"); diff --git a/modules/forum.module b/modules/forum.module index 88d7e2a3d..79a5d27d3 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -98,6 +98,10 @@ function forum_link($type, $node = 0, $main = 0) { $links[] = l(t("forums"), "forum"); } + if ($type == "system" && user_access("create forum topics")) { + menu("node/add/forum",t("forum topic"), "forum_page"); + } + if (!$main && $type == "node" && $node->type == "forum") { // get previous and next topic diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 88d7e2a3d..79a5d27d3 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -98,6 +98,10 @@ function forum_link($type, $node = 0, $main = 0) { $links[] = l(t("forums"), "forum"); } + if ($type == "system" && user_access("create forum topics")) { + menu("node/add/forum",t("forum topic"), "forum_page"); + } + if (!$main && $type == "node" && $node->type == "forum") { // get previous and next topic diff --git a/modules/user.module b/modules/user.module index 6142d4c57..f9a297bc7 100644 --- a/modules/user.module +++ b/modules/user.module @@ -1551,14 +1551,6 @@ function user_admin_edit($edit = array()) { $output .= implode("\n", module_invoke_all("user", "edit_form", $edit, $account)); - $options = "<option value=\"\"". (("" == $key) ? " selected=\"selected\"" : "") .">". t("Default theme") ."</option>\n"; - foreach (theme_list() as $key => $value) { - $options .= "<option value=\"$key\"". (($edit["theme"] == $key) ? " selected=\"selected\"" : "") .">$key - $value->description</option>\n"; - } - $output .= form_item(t("Theme"), "<select name=\"edit[theme]\">$options</select>", t("Selecting a different theme will change the look and feel of the site.")); - for ($zone = -43200; $zone <= 46800; $zone += 3600) $zones[$zone] = date("l, F dS, Y - h:i A", time() - date("Z") + $zone) ." (GMT ". $zone / 3600 .")"; - $output .= form_select(t("Time zone"), "timezone", $account->timezone, $zones, t("Select what time you currently have and your time zone settings will be set appropriate.")); - $output .= form_select(t("Language"), "language", $account->language, $languages, t("Selecting a different language will change the language of the site.")); $output .= form_item(t("Password"), "<input type=\"password\" name=\"edit[pass1]\" size=\"12\" maxlength=\"24\" /> <input type=\"password\" name=\"edit[pass2]\" size=\"12\" maxlength=\"24\" />", t("Enter a new password twice if you want to change the current password for this user or leave it blank if you are happy with the current password.")); $output .= form_select(t("Status"), "status", $account->status, array(t("Blocked"), t("Active"))); $output .= form_select(t("Role"), "rid", $account->rid, user_roles(1)); diff --git a/modules/user/user.module b/modules/user/user.module index 6142d4c57..f9a297bc7 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1551,14 +1551,6 @@ function user_admin_edit($edit = array()) { $output .= implode("\n", module_invoke_all("user", "edit_form", $edit, $account)); - $options = "<option value=\"\"". (("" == $key) ? " selected=\"selected\"" : "") .">". t("Default theme") ."</option>\n"; - foreach (theme_list() as $key => $value) { - $options .= "<option value=\"$key\"". (($edit["theme"] == $key) ? " selected=\"selected\"" : "") .">$key - $value->description</option>\n"; - } - $output .= form_item(t("Theme"), "<select name=\"edit[theme]\">$options</select>", t("Selecting a different theme will change the look and feel of the site.")); - for ($zone = -43200; $zone <= 46800; $zone += 3600) $zones[$zone] = date("l, F dS, Y - h:i A", time() - date("Z") + $zone) ." (GMT ". $zone / 3600 .")"; - $output .= form_select(t("Time zone"), "timezone", $account->timezone, $zones, t("Select what time you currently have and your time zone settings will be set appropriate.")); - $output .= form_select(t("Language"), "language", $account->language, $languages, t("Selecting a different language will change the language of the site.")); $output .= form_item(t("Password"), "<input type=\"password\" name=\"edit[pass1]\" size=\"12\" maxlength=\"24\" /> <input type=\"password\" name=\"edit[pass2]\" size=\"12\" maxlength=\"24\" />", t("Enter a new password twice if you want to change the current password for this user or leave it blank if you are happy with the current password.")); $output .= form_select(t("Status"), "status", $account->status, array(t("Blocked"), t("Active"))); $output .= form_select(t("Role"), "rid", $account->rid, user_roles(1)); |