2001-01-20 12:24:08 +00:00
|
|
|
<?
|
|
|
|
|
|
|
|
include "includes/common.inc";
|
|
|
|
|
|
|
|
function story_render($id, $cid) {
|
2001-01-21 09:26:06 +00:00
|
|
|
global $theme, $user;
|
2001-01-20 12:24:08 +00:00
|
|
|
|
|
|
|
// 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> ]");
|
|
|
|
|
|
|
|
// Display comments:
|
|
|
|
comment_render($id, $cid);
|
|
|
|
}
|
|
|
|
|
|
|
|
switch($op) {
|
|
|
|
case "Preview comment":
|
|
|
|
$theme->header();
|
|
|
|
comment_preview($pid, $id, $subject, $comment);
|
|
|
|
$theme->footer();
|
|
|
|
break;
|
|
|
|
case "Post comment":
|
|
|
|
comment_post($pid, $id, $subject, $comment);
|
|
|
|
break;
|
2001-01-21 09:26:06 +00:00
|
|
|
case "Add comment":
|
|
|
|
$theme->header();
|
|
|
|
comment_reply($cid, $id);
|
|
|
|
$theme->footer();
|
|
|
|
break;
|
2001-01-20 12:24:08 +00:00
|
|
|
case "reply":
|
|
|
|
$theme->header();
|
|
|
|
comment_reply($pid, $id);
|
|
|
|
$theme->footer();
|
|
|
|
break;
|
2001-01-21 09:26:06 +00:00
|
|
|
case "Update settings":
|
2001-01-20 12:24:08 +00:00
|
|
|
comment_settings($mode, $order, $threshold);
|
|
|
|
$theme->header();
|
|
|
|
story_render($id, $cid);
|
|
|
|
$theme->footer();
|
|
|
|
break;
|
|
|
|
case "Moderate comments":
|
|
|
|
comment_moderate($moderate);
|
|
|
|
$theme->header();
|
|
|
|
story_render($id, $cid);
|
|
|
|
$theme->footer();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$theme->header();
|
|
|
|
story_render($id, $cid);
|
|
|
|
$theme->footer();
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|