summaryrefslogtreecommitdiff
path: root/modules/forum.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-06-10 17:33:43 +0000
committerDries Buytaert <dries@buytaert.net>2003-06-10 17:33:43 +0000
commit222e1e55832831cfee9ef2f6abcfef1514afc6e0 (patch)
tree27bc4c4247993455a11aeb537a33168b8966b6b6 /modules/forum.module
parentb0081e5ac9275ffdf9b7042f305e17315fa77682 (diff)
downloadbrdo-222e1e55832831cfee9ef2f6abcfef1514afc6e0.tar.gz
brdo-222e1e55832831cfee9ef2f6abcfef1514afc6e0.tar.bz2
- Documentation improvements: improved and updated the block module documentation. Patch #44 by Al. We should add some real-life path examples!
- Fixed the "blog it" image size. Patch #49 by Al. - Some SQL performance improvements to the forum module. This should also be more PostgreSQL safe. Patch by me. mysql> SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM forum f, node n LEFT JOIN users u ON n.uid = u.uid WHERE f.tid = 2 AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC LIMIT 1, 0; ==> 0.63 sec changed to: mysql> SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM forum f LEFT JOIN node n ON n.nid = f.nid LEFT JOIN users u ON n.uid = u.uid WHERE f.tid = 2 AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC LIMIT 1, 0; ==> 0.00 sec
Diffstat (limited to 'modules/forum.module')
-rw-r--r--modules/forum.module10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/forum.module b/modules/forum.module
index 4d06b42c1..23232b85d 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -369,9 +369,9 @@ function _forum_topics_read($uid) {
}
function _forum_last_post($term) {
- $topic = db_fetch_object(db_query_range("SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM forum f, node n LEFT JOIN users u ON n.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC", $term, 0, 1));
+ $topic = db_fetch_object(db_query_range("SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM forum f LEFT JOIN node n ON n.nid = f.nid LEFT JOIN users u ON n.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC", $term, 0, 1));
- $reply = db_fetch_object(db_query_range("SELECT n.nid, c.timestamp, u.name AS name, u.uid AS uid FROM forum f, node n LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON c.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 AND c.status = 0 ORDER BY c.timestamp DESC", $term, 0, 1));
+ $reply = db_fetch_object(db_query_range("SELECT n.nid, c.timestamp, u.name AS name, u.uid AS uid FROM forum f LEFT JOIN node n ON n.nid = f.nid LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON c.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 AND c.status = 0 ORDER BY c.timestamp DESC", $term, 0, 1));
$value = ($topic->timestamp > $reply->timestamp) ? $topic : $reply;
@@ -451,9 +451,9 @@ function _forum_message_taxonomy() {
function forum_page() {
global $sortby, $forum_per_page, $from, $user;
-
+
$op = $_POST["op"];
-
+
if (user_access("access content")) {
if (module_exist("taxonomy")) {
$tid = arg(1);
@@ -466,7 +466,7 @@ function forum_page() {
drupal_goto(url("node/view/$nid"));
}
}
-
+
if (empty($sortby)) {
$sortby = isset($user->sortby) ? $user->sortby : variable_get("forum_order",1);
}