summaryrefslogtreecommitdiff
path: root/modules/statistics/statistics.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2002-11-11 20:59:28 +0000
committerDries Buytaert <dries@buytaert.net>2002-11-11 20:59:28 +0000
commita6c8b10d8e07075f2bbab81d3d972f3175ebe3ee (patch)
tree020bd15048ce51878af38a55697edbee4be2ccf7 /modules/statistics/statistics.module
parentb372053cf8be2d8e535a0886bb324766f823813e (diff)
downloadbrdo-a6c8b10d8e07075f2bbab81d3d972f3175ebe3ee.tar.gz
brdo-a6c8b10d8e07075f2bbab81d3d972f3175ebe3ee.tar.bz2
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.
Diffstat (limited to 'modules/statistics/statistics.module')
-rw-r--r--modules/statistics/statistics.module14
1 files changed, 4 insertions, 10 deletions
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index 5392d7a37..b085f2b3d 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/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, "<br />");
@@ -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);
}