- bugfix in "Top 10: most recent stories"

3-00
Dries Buytaert 2001-01-03 09:24:00 +00:00
parent ca2d5d6fb2
commit c85a0ee005
2 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,8 @@ function story_block() {
$blocks[0]["content"] = $content;
$blocks[0]["info"] = "Top 10: all stories";
unset($content);
$result = db_query("select s.id, COUNT(s.id) as comments, s.subject from stories s left join comments c on s.id = c.sid WHERE s.status = 2 AND ". time() ." - s.timestamp < 2419200 GROUP BY s.id ORDER BY comments DESC LIMIT 10");
while ($story = db_fetch_object($result)) {
$content .= "<LI><A HREF=\"discussion.php?id=$story->id\">$story->subject</A><BR><SMALL>(". format_plural($story->comments, "comment", "comments") .")</SMALL></LI>\n";

View File

@ -13,6 +13,8 @@ function story_block() {
$blocks[0]["content"] = $content;
$blocks[0]["info"] = "Top 10: all stories";
unset($content);
$result = db_query("select s.id, COUNT(s.id) as comments, s.subject from stories s left join comments c on s.id = c.sid WHERE s.status = 2 AND ". time() ." - s.timestamp < 2419200 GROUP BY s.id ORDER BY comments DESC LIMIT 10");
while ($story = db_fetch_object($result)) {
$content .= "<LI><A HREF=\"discussion.php?id=$story->id\">$story->subject</A><BR><SMALL>(". format_plural($story->comments, "comment", "comments") .")</SMALL></LI>\n";