"story_help", "find" => "story_find", "user" => "story_user", "queue" => "story_queue", "admin" => "story_admin", "block" => "story_block"); include_once "includes/section.inc"; class Story { function Story($userid, $title, $abstract, $body, $section, $timestamp) { $this->userid = $userid; $this->title = $title; $this->abstract = $abstract; $this->body = $body; $this->section = $section; $this->timestamp = $timestamp; } } function story_post_threshold($node, $default) { return $default; } function story_dump_threshold($node, $default) { return $default; } function story_timout_threshold($node, $default) { return $default; } function story_find($keys) { global $status, $user; $find = array(); $result = db_query("SELECT n.*, s.* FROM story s LEFT JOIN node n ON n.nid = s.nid AND n.lid = s.lid WHERE n.status = '$status[posted]' AND (n.title LIKE '%$keys%' OR s.abstract LIKE '%$keys%' OR s.body LIKE '%$keys%') LIMIT 20"); while ($story = db_fetch_object($result)) { array_push($find, array("title" => check_output($story->title), "link" => (user_access($user, "story") ? "admin.php?mod=story&op=edit&id=$story->nid" : "node.php?id=$story->nid"), "user" => $story->userid, "date" => $story->timestamp)); } return $find; } function story_help() { ?>
Queued stories: user-contributed stories are automatically whisked away to a submission queue for moderators (i.e. registered user) to frown at. Moderators vote whether or not a story should be posted to the front page for discussion.
Posted stories: published stories accessible to all visitors.
Dumped stories: rejected stories that are no longer available to visitors.
header(); comment_preview(check_input($pid), check_input($id), $subject, $comment); $theme->footer(); break; case t("Post comment"): comment_post(check_input($pid), check_input($id), check_input($subject), check_input($comment)); $theme->header(); $theme->story($node, "[ nid&pid=0\">". t("reply to this story") ." ]"); comment_render($id, $cid); $theme->footer(); break; case "reply": $theme->header(); comment_reply(check_input($pid), check_input($id)); $theme->footer(); break; case t("Update settings"): comment_settings(check_input($mode), check_input($order), check_input($threshold)); $theme->header(); $theme->story($node, "[ nid&pid=0\">". t("reply to this story") ." ]"); comment_render($id, $cid); $theme->footer(); break; case t("Moderate comments"): comment_moderate($moderate); $theme->header(); $theme->story($node, "[ nid&pid=0\">". t("reply to this story") ." ]"); comment_render($id, $cid); $theme->footer(); break; case "reply": $theme->header(); comment_reply(check_input($pid), check_input($id)); $theme->footer(); break; default: $theme->header(); $theme->story($node, "[ nid&pid=0\">". t("reply to this story") ." ]"); comment_render($id, $cid); $theme->footer(); } } else { $theme->story($node, "[ nid&pid=0\">". t("reply to this story") ." ]"); } } function story_form($edit = array()) { global $allowed_html, $REQUEST_URI, $user; $output .= "\n"; return $output; } function story_save($edit) { node_save(array_diff(array_merge($edit, array(nid => $edit[nid], type => "story")), array(userid => $edit[userid]))); } function story_block() { /* // // disabled for now // global $status; $result = db_query("SELECT s.lid, COUNT(c.cid) AS comments, s.title FROM story s LEFT JOIN comments c ON s.lid = c.lid WHERE s.status = '$status[posted]' AND c.link = 'story' GROUP BY s.lid ORDER BY comments DESC LIMIT 10"); while ($story = db_fetch_object($result)) { $content .= "