summaryrefslogtreecommitdiff
path: root/story.php
blob: 1f3df7d9468f8ee2327be74aa86d07a780a4df11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?

include "includes/common.inc";

function story_render($id, $cid) {
  global $theme, $user;

  $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");

  if ($story = db_fetch_object($result)) {
    $theme->article($story);
    comment_render($id, $cid);
  }
  else {
    $theme->box("Warning message", "The story you requested is no longer available or does not exist.");
  }
}

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;
  case "Add comment":
    $theme->header();
    comment_reply($cid, $id);
    $theme->footer();
    break;
  case "reply":
    $theme->header();
    comment_reply($pid, $id);
    $theme->footer();
    break;
  case "Update settings":
    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();
}

?>