summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-01-22 20:38:36 +0000
committerDries Buytaert <dries@buytaert.net>2001-01-22 20:38:36 +0000
commit5345bd685e3e372cdce0f6131dbb15b2e80030df (patch)
treee69e15ae8a6ddf89f09520b1f2c33647ac66b2ef
parent2c32276ddb3feb955051327f9fb51c7e59021d42 (diff)
downloadbrdo-5345bd685e3e372cdce0f6131dbb15b2e80030df.tar.gz
brdo-5345bd685e3e372cdce0f6131dbb15b2e80030df.tar.bz2
- dumped stories are no longer accessible
-rw-r--r--story.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/story.php b/story.php
index 257e4c8b9..3685cd26d 100644
--- a/story.php
+++ b/story.php
@@ -7,14 +7,18 @@ function story_render($id, $cid) {
// Compose story query:
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON s.author = u.id WHERE s.status != 0 AND s.id = $id");
- $story = db_fetch_object($result);
-
+
// Display story:
- if ($story->status == 1) $theme->article($story, "[ <A HREF=\"submission.php\"><FONT COLOR=\"$theme->hlcolor2\">submission queue</FONT></A> | <A HREF=\"story.php?op=reply&id=$story->id&pid=0\"><FONT COLOR=\"$theme->hlcolor2\">add a comment</FONT></A> ]");
- else $theme->article($story, "[ <A HREF=\"\"><FONT COLOR=\"$theme->hlcolor2\">home</FONT></A> | <A HREF=\"story.php?op=reply&id=$story->id&pid=0\"><FONT COLOR=\"$theme->hlcolor2\">add a comment</FONT></A> ]");
+ if ($story = db_fetch_object($result)) {
+ if ($story->status == 1) $theme->article($story, "[ <A HREF=\"submission.php\"><FONT COLOR=\"$theme->hlcolor2\">submission queue</FONT></A> | <A HREF=\"story.php?op=reply&id=$story->id&pid=0\"><FONT COLOR=\"$theme->hlcolor2\">add a comment</FONT></A> ]");
+ else $theme->article($story, "[ <A HREF=\"\"><FONT COLOR=\"$theme->hlcolor2\">home</FONT></A> | <A HREF=\"story.php?op=reply&id=$story->id&pid=0\"><FONT COLOR=\"$theme->hlcolor2\">add a comment</FONT></A> ]");
- // Display comments:
- comment_render($id, $cid);
+ // Display comments:
+ comment_render($id, $cid);
+ }
+ else {
+ $theme->box("Warning message", "The story you requested is no longer available or does not exist.");
+ }
}
switch($op) {