From 34a927e6e36c08522bd5b1a873d563e9da5bc7ab Mon Sep 17 00:00:00 2001
From: Dries Buytaert
Date: Fri, 26 Jan 2001 13:31:41 +0000
Subject: - fixed 2 small bugs (reported by martin@abol.com)
---
modules/story.module | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
(limited to 'modules/story.module')
diff --git a/modules/story.module b/modules/story.module
index 762626ec4..69b97dfd3 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -10,7 +10,7 @@ include_once "includes/section.inc";
function story_cron() {
$result = db_query("SELECT * FROM stories WHERE status = 3 AND timestamp <= ". time() ."");
while ($story = db_fetch_object($result)) {
- db_query("UPDATE stories SET status = '1', timestamp = '". time() ."' WHERE id = '$story->id'");
+ db_query("UPDATE stories SET status = '1', timestamp = '". time() ."' WHERE id = '$story->id'");
}
}
@@ -24,9 +24,9 @@ function story_help() {
}
function story_block() {
- $result = db_query("SELECT s.id, COUNT(s.id) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.lid WHERE s.status = 2 AND c.link = 'story' GROUP BY s.id ORDER BY comments DESC LIMIT 10");
+ $result = db_query("SELECT s.id, COUNT(c.cid) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.lid WHERE s.status = 2 AND c.link = 'story' GROUP BY s.id ORDER BY comments DESC LIMIT 10");
while ($story = db_fetch_object($result)) {
- $content .= "id\">$story->subject
(". format_plural($story->comments, "comment", "comments") .")\n";
+ $content .= "id\">". check_output($story->subject) ."
(". format_plural($story->comments, "comment", "comments") .")\n";
}
$blocks[0]["subject"] = "Top 10:
all stories";
@@ -35,9 +35,9 @@ function story_block() {
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.lid WHERE s.status = 2 AND c.link = 'story' AND ". time() ." - s.timestamp < 2419200 GROUP BY s.id ORDER BY comments DESC LIMIT 10");
+ $result = db_query("SELECT s.id, COUNT(c.cid) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.lid WHERE s.status = 2 AND c.link = 'story' AND ". time() ." - s.timestamp < 2419200 GROUP BY s.id ORDER BY comments DESC LIMIT 10");
while ($story = db_fetch_object($result)) {
- $content .= "id\">$story->subject
(". format_plural($story->comments, "comment", "comments") .")\n";
+ $content .= "id\">". check_output($story->subject) ."
(". format_plural($story->comments, "comment", "comments") .")\n";
}
$blocks[1]["subject"] = "Top 10:
recent stories";
@@ -51,27 +51,27 @@ function story_add() {
global $allowed_html;
$output .= "
\n";
$output .= "\n";
-
+
print $output;
}
@@ -170,7 +170,7 @@ function story_edit_save($id, $edit) {
watchdog("message", "story: modified `$edit[subject]'");
}
-function story_display() {
+function story_display() {
$output .= "\n";
// Pending stories:
@@ -200,9 +200,9 @@ function story_display() {
while ($story = db_fetch_object($result)) {
$output .= " id\">". check_output($story->subject) ." | ". format_username($story->userid, 1) ." | $story->section | id\">edit |
\n";
}
-
+
$output .= "
\n";
-
+
print $output;
}
--
cgit v1.2.3