diff options
Diffstat (limited to 'modules/tracker/tracker.module')
-rw-r--r-- | modules/tracker/tracker.module | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index 5a2683dd9..065893063 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -14,7 +14,7 @@ function tracker_system($field){ function tracker_link($type) { if ($type == "menu.view" && user_access("access comments")) { - $links[] = lm(t("view new comments"), array("mod" => "tracker"), "", array("title" => t("Display an overview of the recent comments."))); + $links[] = l(t("view new comments"), "tracker", array("title" => t("Display an overview of the recent comments."))); } return $links ? $links : array(); @@ -37,7 +37,7 @@ function tracker_comments($id = 0) { } while ($node = db_fetch_object($sresult)) { - $output .= format_plural($node->comments, "comment", "comments") ." ". t("attached to node") ." ". l($node->title, array("id" => $node->nid)) .":\n"; + $output .= format_plural($node->comments, "comment", "comments") ." ". t("attached to node") ." ". l($node->title, "node/view/$node->nid") .":\n"; if ($id) { $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.uid = '%d' AND c.nid = '%d' ORDER BY cid DESC", $id, $node->nid); @@ -48,7 +48,7 @@ function tracker_comments($id = 0) { $output .= "<ul>"; while ($comment = db_fetch_object($cresult)) { - $output .= " <li>". l($comment->subject, array("id" => $node->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid) ." ". t("by") ." ". format_name($comment) ." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? theme_invoke("theme_mark") : "") ."</li>\n"; + $output .= " <li>". l($comment->subject, "node/view/$node->nid#$comment->cid") ." ". t("by") ." ". format_name($comment) ." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? theme_invoke("theme_mark") : "") ."</li>\n"; } $output .= " </ul>\n"; } @@ -59,28 +59,28 @@ function tracker_comments($id = 0) { function tracker_menu() { global $user; - $links[] = lm(t("your recent comments"), array("mod" => "tracker", "id" => $user->uid), "", array("title" => t("Display an overview of your recent comments."))); - $links[] = lm(t("all recent comments"), array("mod" => "tracker"), "", array("title" => t("Display an overview of all the recent comments."))); + $links[] = l(t("your recent comments"), "tracker/$user->uid", array("title" => t("Display an overview of your recent comments."))); + $links[] = l(t("all recent comments"), "tracker", array("title" => t("Display an overview of all the recent comments."))); return "<div align=\"center\">". implode(" · ", $links) ."</div>"; } function tracker_page() { - global $theme, $id, $user; + global $theme, $user; if (user_access("access comments")) { - if ($id == $user->uid) { + if (arg(1) == $user->uid) { $theme->header(t("Your recent comments")); $theme->box(t("Tracker"), tracker_menu()); - $theme->box(t("Your recent comments"), tracker_comments($id)); + $theme->box(t("Your recent comments"), tracker_comments(arg(1))); $theme->footer(); } - else if ($id) { - $account = user_load(array("uid" => $id)); + else if (arg(1)) { + $account = user_load(array("uid" => arg(1))); $theme->header(t("%u's recent comments", array("%u" => $account->name))); $theme->box(t("Tracker"), tracker_menu()); - $theme->box(t("%u's recent comments", array("%u" => $account->name)), tracker_comments($id)); + $theme->box(t("%u's recent comments", array("%u" => $account->name)), tracker_comments(arg(1))); $theme->footer(); } else { @@ -97,7 +97,7 @@ function tracker_user($type, &$edit, &$user) { case "view_public": case "view_private": if (user_access("access comments")) { - return form_item(t("Comments"), lm(t("view recent comments"), array("mod" => "tracker", "id" => $user->uid), "", array("title" => t("View recent comments.")))); + return form_item(t("Comments"), l(t("view recent comments"), "tracker/$user->uid", array("title" => t("View recent comments.")))); } } } |