diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-07-16 20:14:26 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-07-16 20:14:26 +0000 |
commit | 8759ca7368fbe6014286b320cf25185fc1e1a602 (patch) | |
tree | 866d91c2a873e06d7ef8bc2af5afeb9d60c5235f /modules/forum | |
parent | 1252d51264e9cc45062fe60c2a6b5d6ccf18b8cc (diff) | |
download | brdo-8759ca7368fbe6014286b320cf25185fc1e1a602.tar.gz brdo-8759ca7368fbe6014286b320cf25185fc1e1a602.tar.bz2 |
- Commited the URL aliasing patch. Thanks Matt.
This update requires you to run update.php!
Diffstat (limited to 'modules/forum')
-rw-r--r-- | modules/forum/forum.module | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/forum/forum.module b/modules/forum/forum.module index e4a637ce9..6dd7af988 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -121,13 +121,14 @@ function forum_link($type, $node = 0, $main = 0) { if (!$main && $type == "node" && $node->type == "forum") { // get previous and next topic - $result = db_query("SELECT n.nid, n.title, n.body, GREATEST(n.created, MAX(c.timestamp)) AS date_sort, COUNT(c.nid) AS num_comments FROM {node} n INNER JOIN {forum} f ON n.nid = f.nid INNER JOIN {comments} c ON n.nid = c.nid WHERE n.nid = f.nid AND f.tid = %d AND n.status = 1 GROUP BY n.nid, n.title, n.body, n.created ORDER BY ". _forum_get_topic_order(isset($user->sortby) ? $user->sortby : variable_get("forum_order",1)), $node->tid); + $result = db_query("SELECT n.nid, n.title, n.body, n.path, GREATEST(n.created, MAX(c.timestamp)) AS date_sort, COUNT(c.nid) AS num_comments FROM {node} n INNER JOIN {forum} f ON n.nid = f.nid INNER JOIN {comments} c ON n.nid = c.nid WHERE n.nid = f.nid AND f.tid = %d AND n.status = 1 GROUP BY n.nid, n.title, n.body, n.created ORDER BY ". _forum_get_topic_order(isset($user->sortby) ? $user->sortby : variable_get("forum_order",1)), $node->tid); while ($topic = db_fetch_object($result)) { if ($stop == 1) { $next->nid = $topic->nid; $next->title = $topic->title; $next->body = $topic->body; + $next->path = $topic->path; break; } if ($topic->nid == $node->nid) { @@ -137,15 +138,16 @@ function forum_link($type, $node = 0, $main = 0) { $prev->nid = $topic->nid; $prev->title = $topic->title; $prev->body = $topic->body; + $prev->path = $topic->path; } } if ($prev) { - $links[] = l(t("previous forum topic"), "node/view/$prev->nid", array("title" => $prev->title .": ". substr(strip_tags($prev->body), 0, 100)."...")); + $links[] = l(t("previous forum topic"), node_url($prev), array("title" => $prev->title .": ". substr(strip_tags($prev->body), 0, 100)."...")); } if ($next) { - $links[] = l(t("next forum topic"), "node/view/$next->nid", array("title" => $next->title .": ". substr(strip_tags($next->body), 0, 100)."...")); + $links[] = l(t("next forum topic"), node_url($next), array("title" => $next->title .": ". substr(strip_tags($next->body), 0, 100)."...")); } } |