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 +++++++++++++++--------------- modules/story/story.module | 30 +++++++++++++++--------------- 2 files changed, 30 insertions(+), 30 deletions(-) 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"; $output .= " Subject:
    \n"; $output .= "
    \n"; $output .= "

    \n"; $output .= "

    Section:
    \n"; - $output .= " \n"; foreach ($sections = section_get() as $value) { - $output .= " \n"; + $output .= " \n"; } $output .= " \n"; $output .= "

    \n"; - $output .= "

    \n"; + $output .= "

    \n"; $output .= " Abstract:
    \n"; $output .= "
    \n"; $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; $output .= "

    \n"; - $output .= "

    \n"; + $output .= "

    \n"; $output .= " Extended story:
    \n"; $output .= "
    \n"; $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; @@ -85,7 +85,7 @@ function story_add() { $output .= " dumped story
    \n"; $output .= " The textfield for scheduled stories expects a string containing an English date format of when you want to have your story automatically published.
    Example input: '". date("j F Y G:i") ."', '". date("m/d/y H:i") ."', '". date("F j, Y H:i") ."', ...
    \n"; $output .= "

    \n"; - + $output .= "

    \n"; $output .= " \n"; $output .= "

    \n"; @@ -160,7 +160,7 @@ function story_edit($id) { $output .= " \n"; $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 .= " \n"; } - + $output .= "
    id\">". check_output($story->subject) ."". format_username($story->userid, 1) ."$story->sectionid\">edit
    \n"; - + print $output; } diff --git a/modules/story/story.module b/modules/story/story.module index 762626ec4..69b97dfd3 100644 --- a/modules/story/story.module +++ b/modules/story/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"; $output .= " Subject:
    \n"; $output .= "
    \n"; $output .= "

    \n"; $output .= "

    Section:
    \n"; - $output .= " \n"; foreach ($sections = section_get() as $value) { - $output .= " \n"; + $output .= " \n"; } $output .= " \n"; $output .= "

    \n"; - $output .= "

    \n"; + $output .= "

    \n"; $output .= " Abstract:
    \n"; $output .= "
    \n"; $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; $output .= "

    \n"; - $output .= "

    \n"; + $output .= "

    \n"; $output .= " Extended story:
    \n"; $output .= "
    \n"; $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; @@ -85,7 +85,7 @@ function story_add() { $output .= " dumped story
    \n"; $output .= " The textfield for scheduled stories expects a string containing an English date format of when you want to have your story automatically published.
    Example input: '". date("j F Y G:i") ."', '". date("m/d/y H:i") ."', '". date("F j, Y H:i") ."', ...
    \n"; $output .= "

    \n"; - + $output .= "

    \n"; $output .= " \n"; $output .= "

    \n"; @@ -160,7 +160,7 @@ function story_edit($id) { $output .= " \n"; $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 .= " \n"; } - + $output .= "
    id\">". check_output($story->subject) ."". format_username($story->userid, 1) ."$story->sectionid\">edit
    \n"; - + print $output; } -- cgit v1.2.3