2001-01-20 12:24:08 +00:00
|
|
|
<?
|
|
|
|
|
2001-02-04 22:09:38 +00:00
|
|
|
include_once "includes/common.inc";
|
|
|
|
include_once "includes/story.inc";
|
2001-01-20 12:24:08 +00:00
|
|
|
|
|
|
|
function story_render($id, $cid) {
|
2001-01-21 09:26:06 +00:00
|
|
|
global $theme, $user;
|
2001-01-20 12:24:08 +00:00
|
|
|
|
2001-02-04 22:09:38 +00:00
|
|
|
$story = db_fetch_object(db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON s.author = u.id WHERE s.id = $id"));
|
2001-01-20 12:24:08 +00:00
|
|
|
|
2001-02-04 22:09:38 +00:00
|
|
|
if (story_visible($story)) {
|
2001-01-26 14:48:52 +00:00
|
|
|
$theme->article($story, "[ <A HREF=\"story.php?op=reply&id=$id&pid=0\">reply to this story</A> ]");
|
2001-01-22 20:38:36 +00:00
|
|
|
comment_render($id, $cid);
|
|
|
|
}
|
|
|
|
else {
|
2001-02-04 22:09:38 +00:00
|
|
|
$theme->box("Warning message", "The story you requested is not available or does not exist.");
|
2001-01-22 20:38:36 +00:00
|
|
|
}
|
2001-01-20 12:24:08 +00:00
|
|
|
}
|
|
|
|
|
2001-01-26 13:38:46 +00:00
|
|
|
switch($op) {
|
2001-01-20 12:24:08 +00:00
|
|
|
case "Preview comment":
|
|
|
|
$theme->header();
|
|
|
|
comment_preview($pid, $id, $subject, $comment);
|
|
|
|
$theme->footer();
|
|
|
|
break;
|
|
|
|
case "Post comment":
|
|
|
|
comment_post($pid, $id, $subject, $comment);
|
2001-02-04 22:09:38 +00:00
|
|
|
$theme->header();
|
|
|
|
story_render($id, $cid);
|
|
|
|
$theme->footer();
|
2001-01-20 12:24:08 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|