diff options
author | Dries Buytaert <dries@buytaert.net> | 2002-11-09 13:59:36 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2002-11-09 13:59:36 +0000 |
commit | 562df8fe43f8794317c974dae463f5470cfdc497 (patch) | |
tree | 73d897d51f8b1873eff41193733d309495d01aea /modules/forum/forum.module | |
parent | 29adfb4086c8ef6102d9f22f5351382485444be5 (diff) | |
download | brdo-562df8fe43f8794317c974dae463f5470cfdc497.tar.gz brdo-562df8fe43f8794317c974dae463f5470cfdc497.tar.bz2 |
* Added Jeremy's pager:
"This is a simple, generic pager for Drupal-CVS. It is designed to be
easily themeable and expandable. The code is highly-commented to
enhance readability."
"Pagers are constructed by combining the provided pieces (all of which
can be easily modified to display the text or image you prefer) into
your custom pager."
* Statistics module fixes by Jeremy:
- removed superfluous check for existence of watchdog()
- saving changes in admin page displays status and returns same page
- no longer return 1971/01/01 in "view statistics" table
- switched from "!=" to "<>" in SQL queries for ANSI-SQL compliance
- switched from "MAX(timestamp) as timestamp" to "MAX(timestamp) as
max_timestamp" moving towards ANSI-SQL compliance.
* Added a "theme_item_list" function to format itemized lists. Also
changed a couple of modules to take advantage of it. Makes for a
more consistent UI.
Diffstat (limited to 'modules/forum/forum.module')
-rw-r--r-- | modules/forum/forum.module | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/forum/forum.module b/modules/forum/forum.module index f7a78c7d2..81308d5dd 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -96,18 +96,21 @@ function forum_block($op = "list", $delta = 0) { } if (!$content) { - $content = "<b>". t("Active forum topics:") ."</b><br />"; + unset($items); $result = db_query("SELECT n.nid, n.title, n.body, GREATEST(n.created, MAX(c.timestamp)) AS sort FROM node n, forum f LEFT JOIN comments c ON c.nid = n.nid WHERE n.type = 'forum' AND n.nid = f.nid AND f.shadow = 0 AND n.status = 1 GROUP BY n.nid ORDER BY sort DESC LIMIT ". variable_get("forum_block_num", "5")); while ($node = db_fetch_object($result)) { - $content .= "- ". l(check_output($node->title), array("id" => $node->nid), "node", "", array("title" => substr(strip_tags($node->body), 0, 100)."...")) ."<br />"; + $items[] = l(check_output($node->title), array("id" => $node->nid), "node", "", array("title" => substr(strip_tags($node->body), 0, 100)."...")); } + $content .= theme_invoke("theme_item_list", $items, t("Active forum topics:")); $content .= "<br />"; - $content .= "<b>". t("New forum topics:") ."</b><br />"; + + unset ($items); $result = db_query("SELECT n.nid, n.title, n.body FROM node n LEFT JOIN forum f ON n.nid = f.nid WHERE n.type = 'forum' ORDER BY n.nid DESC LIMIT ". variable_get("forum_block_num", "5")); while ($node = db_fetch_object($result)) { - $content .= "- ". l(check_output($node->title), array("id" => $node->nid), "node", "", array("title" => substr(strip_tags($node->body), 0, 100)."...")) ."<br />"; + $items[] = l(check_output($node->title), array("id" => $node->nid), "node", "", array("title" => substr(strip_tags($node->body), 0, 100)."...")); } + $content .= theme_invoke("theme_item_list", $items, t("New forum topics:")); if ($content) { $content .= "<div align=\"right\">". lm(t("more"), array("mod" => "forum")) ."</div>"; @@ -182,7 +185,7 @@ function forum_view($node, $main = 0) { $voc = taxonomy_get_vocabulary($term_data->vid); /* TODO: find out what this code was ment to do and either use it or not. - + $output .= "<p>"._forum_get_icon($node)." ".lm(check_output($voc->name), array("mod" => "forum"))." : ".lm(check_output($term_data->name), array("mod" => "forum", "tid" => $term_data->tid)); $output .= " / <b>". check_output($node->title) ."</b><br>".t("%a by %b", array("%a" => format_date($node->created), "%b" => format_name($node)))."</p><p>". check_output($node->body, 1) ."</p>"; |