diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-01-22 20:39:49 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-01-22 20:39:49 +0000 |
commit | a8df467feb6ec21afac4f4f6be24d2afc85b78ca (patch) | |
tree | 3e64dc4e7c5d358b86cde13d352c9d74e4591b37 | |
parent | 5345bd685e3e372cdce0f6131dbb15b2e80030df (diff) | |
download | brdo-a8df467feb6ec21afac4f4f6be24d2afc85b78ca.tar.gz brdo-a8df467feb6ec21afac4f4f6be24d2afc85b78ca.tar.bz2 |
- polished the code by removing some redundant checks
-rw-r--r-- | story.php | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -5,15 +5,10 @@ include "includes/common.inc"; function story_render($id, $cid) { global $theme, $user; - // 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"); - - // Display story: - 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: + if ($story = db_fetch_object($result)) { + $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> ]"); comment_render($id, $cid); } else { |