summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/tracker.module8
-rw-r--r--modules/tracker/tracker.module8
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);