diff options
author | Dries Buytaert <dries@buytaert.net> | 2002-05-20 07:32:01 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2002-05-20 07:32:01 +0000 |
commit | d895ef8c40a91380f8f484b41b9df11889e1380b (patch) | |
tree | 9b1870b2084af2fa40c95a8d4fc0e345b6f9a10c | |
parent | b9f72e1a1b724cfbd17d19c568f126a363f7ea24 (diff) | |
download | brdo-d895ef8c40a91380f8f484b41b9df11889e1380b.tar.gz brdo-d895ef8c40a91380f8f484b41b9df11889e1380b.tar.bz2 |
- Bugfix: the tracker module was using an incorrect time interval to show
recent/new comments. Patch by Gerhard.
-rw-r--r-- | modules/tracker.module | 8 | ||||
-rw-r--r-- | modules/tracker/tracker.module | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/modules/tracker.module b/modules/tracker.module index 5404e9274..a9d718d42 100644 --- a/modules/tracker.module +++ b/modules/tracker.module @@ -15,8 +15,14 @@ function tracker_link($type) { return $links ? $links : array(); } +function tracker_conf_options() { + $period = array(3600 => format_interval(3600), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200), 1000000000 => "All"); + $output .= form_select("Show comments more recent than", "tracker_period", variable_get("tracker_period", 259200), $period, "Comments younger than this get displayed."); + return $output; +} + function tracker_comments($id = 0) { - $period = time() - 259200 *20; // all comments of the past 3 days + $period = time() - variable_get("tracker_period", 259200); // all comments of the past 3 days if not configured to a different value if ($id) { $sresult = db_query("SELECT n.nid, n.title, COUNT(n.nid) AS comments, MAX(c.timestamp) AS last_comment FROM comments c LEFT JOIN node n ON c.nid = n.nid WHERE c.timestamp > $period AND c.uid = '%s' GROUP BY n.nid, n.title DESC ORDER BY last_comment DESC LIMIT 10", $id); diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index 5404e9274..a9d718d42 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -15,8 +15,14 @@ function tracker_link($type) { return $links ? $links : array(); } +function tracker_conf_options() { + $period = array(3600 => format_interval(3600), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200), 1000000000 => "All"); + $output .= form_select("Show comments more recent than", "tracker_period", variable_get("tracker_period", 259200), $period, "Comments younger than this get displayed."); + return $output; +} + function tracker_comments($id = 0) { - $period = time() - 259200 *20; // all comments of the past 3 days + $period = time() - variable_get("tracker_period", 259200); // all comments of the past 3 days if not configured to a different value if ($id) { $sresult = db_query("SELECT n.nid, n.title, COUNT(n.nid) AS comments, MAX(c.timestamp) AS last_comment FROM comments c LEFT JOIN node n ON c.nid = n.nid WHERE c.timestamp > $period AND c.uid = '%s' GROUP BY n.nid, n.title DESC ORDER BY last_comment DESC LIMIT 10", $id); |