- using format_name instead of some local hack.

4.0.x
Kjartan Mannes 2002-05-12 20:31:48 +00:00
parent 8c0d452d37
commit 706a2e199a
2 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@ function tracker_link($type) {
} }
function tracker_comments($id = 0) { function tracker_comments($id = 0) {
$period = time() - 259200; // all comments of the past 3 days $period = time() - 259200 *20; // all comments of the past 3 days
if ($id) { 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); $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);
@ -37,7 +37,7 @@ function tracker_comments($id = 0) {
$output .= "<ul>"; $output .= "<ul>";
while ($comment = db_fetch_object($cresult)) { while ($comment = db_fetch_object($cresult)) {
$output .= " <li>". l(check_output($comment->subject), array("id" => $node->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid) ." by ". lm(check_output($comment->name), array("mod" => "user", "op" => "view", "id" => $comment->uid)) ." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n"; $output .= " <li>". l(check_output($comment->subject), array("id" => $node->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid) ." by ". format_name($comment->name) ." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n";
} }
$output .= " </ul>\n"; $output .= " </ul>\n";
} }

View File

@ -16,7 +16,7 @@ function tracker_link($type) {
} }
function tracker_comments($id = 0) { function tracker_comments($id = 0) {
$period = time() - 259200; // all comments of the past 3 days $period = time() - 259200 *20; // all comments of the past 3 days
if ($id) { 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); $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);
@ -37,7 +37,7 @@ function tracker_comments($id = 0) {
$output .= "<ul>"; $output .= "<ul>";
while ($comment = db_fetch_object($cresult)) { while ($comment = db_fetch_object($cresult)) {
$output .= " <li>". l(check_output($comment->subject), array("id" => $node->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid) ." by ". lm(check_output($comment->name), array("mod" => "user", "op" => "view", "id" => $comment->uid)) ." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n"; $output .= " <li>". l(check_output($comment->subject), array("id" => $node->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid) ." by ". format_name($comment->name) ." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n";
} }
$output .= " </ul>\n"; $output .= " </ul>\n";
} }