From a616715ae2fa2ca949fd2e8d277243285af193c0 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 8 Jun 2001 19:43:42 +0000 Subject: - Revised the 'track sitename' feature: it should be more accurate now. --- account.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/account.php b/account.php index 79e436f07..6f6ff89e5 100644 --- a/account.php +++ b/account.php @@ -388,11 +388,11 @@ function account_track_site() { $theme->header(); - $sresult = db_query("SELECT n.title, n.nid, COUNT(c.lid) AS count FROM comments c LEFT JOIN node n ON c.lid = n.nid WHERE n.status = '". node_status("posted") ."' AND ". time() ." - n.timestamp < $period GROUP BY c.lid ORDER BY n.timestamp DESC LIMIT 10"); - while ($node = db_fetch_object($sresult)) { - $output .= "
  • ". format_plural($node->count, "comment", "comments") ." ". t("attached to node") ." 'nid\">". check_output($node->title) ."':
  • "; + $nresult = db_query("SELECT n.nid, n.title, COUNT(c.cid) AS count FROM comments c LEFT JOIN node n ON n.nid = c.lid WHERE c.timestamp > ". (time() - $period) ." GROUP BY c.lid ORDER BY count DESC"); + while ($node = db_fetch_object($nresult)) { + $output .= "
  • ". format_plural($node->count, "comment", "comments") ." ". t("attached to") ." 'nid\">". check_output($node->title) ."':
  • "; - $cresult = db_query("SELECT c.subject, c.cid, c.pid, u.userid FROM comments c LEFT JOIN users u ON u.id = c.author WHERE c.lid = '$node->nid' ORDER BY c.timestamp DESC LIMIT $node->count"); + $cresult = db_query("SELECT c.subject, c.cid, c.pid, u.userid FROM comments c LEFT JOIN users u ON u.id = c.author WHERE c.lid = $node->nid ORDER BY c.timestamp DESC LIMIT $node->count"); $output .= "