From 8043cb998f3325731bfab8d82251fa49639aec1d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 20 Apr 2002 11:52:50 +0000 Subject: - Applied Marco's big patch, including contributions from Moshe: + Changed the db_query() API. + Wrapped all links in l(), lm(), la(), ..., drupal_url() functions. + XHTML-ified some HTML. + Wrapped a lot of text in the administrative pages in a t() function. + Replaced all $REQUEST_URI/$PATH_INFOs by request_uri(). + Small bugfixes (eg. bug in book_export_html() and clean-ups (eg. RSS code). + Fixed some bugs in the taxonomy module (eg. tree making bug), added new functionality (eg. new APIs for use by other modules), included Moshe's taxonomy extensions, and some documentation udpates. + ... --- modules/tracker.module | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'modules/tracker.module') diff --git a/modules/tracker.module b/modules/tracker.module index 49fceb724..6af261647 100644 --- a/modules/tracker.module +++ b/modules/tracker.module @@ -9,7 +9,7 @@ function tracker_help() { function tracker_link($type) { if ($type == "menu.view") { - $links[] = "". t("view new comments") .""; + $links[] = lm(t("view new comments"), array("mod" => "tracker"), t("Display an overview of the recent comments.")); } return $links ? $links : array(); @@ -21,17 +21,17 @@ function tracker_comments($id = 0) { $period = time() - 259200; // all comments of the past 3 days 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 = '". check_input($id) ."' GROUP BY n.nid, n.title DESC ORDER BY last_comment DESC LIMIT 10"); + $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); } else { $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 GROUP BY n.nid, n.title DESC ORDER BY last_comment DESC LIMIT 10"); } while ($node = db_fetch_object($sresult)) { - $output .= format_plural($node->comments, "comment", "comments") ." ". t("attached to node") ." nid\">". check_output($node->title) .":\n"; + $output .= format_plural($node->comments, "comment", "comments") ." ". t("attached to node") ." ".l(check_output($node->title), array("id" => $node->nid)).":\n"; if ($id) { - $cresult = db_query("SELECT * FROM comments WHERE timestamp > $period AND uid = '". check_input($id) ."' AND nid = '$node->nid' ORDER BY cid DESC"); + $cresult = db_query("SELECT * FROM comments WHERE timestamp > $period AND uid = '%s' AND nid = '$node->nid' ORDER BY cid DESC", $id); } else { $cresult = db_query("SELECT c.*, u.name FROM comments c LEFT JOIN users u ON c.uid = u.uid WHERE c.timestamp > $period AND c.nid = '$node->nid' ORDER BY c.cid DESC"); @@ -39,7 +39,7 @@ function tracker_comments($id = 0) { $output .= "\n"; } @@ -50,8 +50,8 @@ function tracker_comments($id = 0) { function tracker_menu() { global $user; - $links[] = "uid\" title=\"". t("Display an overview of your recent comments.") ."\">your recent comments"; - $links[] = "all recent comments"; + $links[] = lm(t("your recent comments"), array("mod" => "tracker", "id" => $user->uid), t("Display an overview of your recent comments.")); + $links[] = lm(t("all recent comments"), array("mod" => "tracker"), t("Display an overview of all the recent comments.")); return "
". implode(" · ", $links) ."
"; } -- cgit v1.2.3