From a6c8b10d8e07075f2bbab81d3d972f3175ebe3ee Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 11 Nov 2002 20:59:28 +0000 Subject: Applied Moshe's patches: - Adds more title info to each line in the block: now showing author and number of comments in a unified way accross all modules. - Added pager support to blog module. - Blog module now uses standard node view, not its own hack which is more theme friendly (http://www.drupal.org/node.php?id=133). - Blog module now uses node_feed() function for making RSS feeds. since all feeds are now consolidated, a couple tweaks to node_feed() and format_rss_* would lead us to support new RSS formats easily. - Fixed bugs where unpublished entries were displayed. --- modules/statistics.module | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'modules/statistics.module') diff --git a/modules/statistics.module b/modules/statistics.module index 5392d7a37..b085f2b3d 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -697,17 +697,17 @@ function statistics_display_topnodes_block() { $daytop = variable_get("statistics_block_top_day_num", ""); if ($daytop) { - $content[] = theme_invoke("theme_item_list", statistics_title_list("daycount", $daytop), variable_get("statistics_block_top_day_head", "")); + $content[] = node_title_list(statistics_title_list("daycount", $daytop), variable_get("statistics_block_top_day_head", "")); } $alltimetop = variable_get("statistics_block_top_all_num", ""); if ($alltimetop) { - $content[] = theme_invoke("theme_item_list", statistics_title_list("totalcount", $alltimetop), variable_get("statistics_block_top_all_head", "")); + $content[] = node_title_list(statistics_title_list("totalcount", $alltimetop), variable_get("statistics_block_top_all_head", "")); } $lasttop = variable_get("statistics_block_top_last_num", ""); if ($lasttop) { - $content[] = theme_invoke("theme_item_list", statistics_title_list("timestamp", $lasttop), variable_get("statistics_block_top_last_head", "")); + $content[] = node_title_list(statistics_title_list("timestamp", $lasttop), variable_get("statistics_block_top_last_head", "")); } $output = implode($content, "
"); @@ -796,13 +796,7 @@ function statistics_display_online_block() { /* Display linked title based on field name */ function statistics_title_list($dbfield, $dbrows) { /* valid dbfields: totalcount, daycount, timestamp */ - - $result = db_query("SELECT statistics.nid, node.title FROM statistics LEFT JOIN node ON statistics.nid = node.nid WHERE %s <> '0' ORDER BY %s DESC LIMIT %s", $dbfield, $dbfield, $dbrows); - while ($nid = db_fetch_array($result)) { - $items[] = l($nid["title"], array("id" => $nid["nid"]), "node", "", array("title" => t("View this posting."))); - } - - return $items; + return db_query("SELECT statistics.nid, node.title, u.name FROM statistics LEFT JOIN node ON statistics.nid = node.nid LEFT JOIN users u ON node.uid = u.uid WHERE %s <> '0' ORDER BY %s DESC LIMIT %s", "statistics.". $dbfield, "statistics.". $dbfield, $dbrows); } -- cgit v1.2.3