diff options
Diffstat (limited to 'modules/story/story.module')
-rw-r--r-- | modules/story/story.module | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/modules/story/story.module b/modules/story/story.module index e6f48b5d3..b9b41f76d 100644 --- a/modules/story/story.module +++ b/modules/story/story.module @@ -79,87 +79,6 @@ function story_save($edit) { } } -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 .= "<LI><A HREF=\"node.php?id=$story->id\">". check_output($story->title) ."</A><BR><SMALL>(". format_plural($story->comments, "comment", "comments") .")</SMALL></LI>\n"; - } - - $blocks[0][subject] = "Top 10:<BR>all stories"; - $blocks[0][content] = $content; - $blocks[0][info] = "Top 10: all stories"; - - unset($content); - - $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' AND ". time() ." - s.timestamp < 2419200 GROUP BY s.lid ORDER BY comments DESC LIMIT 10"); - while ($story = db_fetch_object($result)) { - $content .= "<LI><A HREF=\"node.php?id=$story->id\">". check_output($story->title) ."</A><BR><SMALL>(". format_plural($story->comments, "comment", "comments") .")</SMALL></LI>\n"; - } - - $blocks[1][subject] = "Top 10:<BR>recent stories"; - $blocks[1][content] = $content; - $blocks[1][info] = "Top 10: recent stories"; - - return $blocks; -*/ -} - -function story_query($type = "") { - global $status; - $queries = array(array("recent stories", "WHERE n.type = 'story' ORDER BY n.timestamp DESC"), array("posted stories", "WHERE n.type = 'story' AND n.status = '$status[posted]' ORDER BY n.timestamp DESC"), array("queued stories", "WHERE n.type = 'story' AND n.status = '$status[queued]' ORDER BY n.timestamp DESC"), array("dumped stories", "WHERE n.type = 'story' AND n.status = '$status[dumped]' ORDER BY n.timestamp DESC"), array("stories without category (integrity)", "WHERE n.type = 'story' AND n.cid = '0' ORDER BY n.timestamp DESC"), array("stories without topic (integrity)", "WHERE n.type = 'story' AND n.tid = '0' ORDER BY n.timestamp DESC")); - return ($queries[$type] ? $queries[$type] : $queries); -} - -function story_overview($query = array()) { - return node_overview($query); -} - -function story_admin() { - global $id, $edit, $mod, $keys, $op, $theme, $type, $user; - - print "<SMALL><A HREF=\"admin.php?mod=story&op=add\">add new story</A> | <A HREF=\"admin.php?mod=story&op=listing\">story listing</A> | <A HREF=\"admin.php?mod=story&op=search\">search story</A> | <A HREF=\"admin.php?mod=story\">overview</A> | <A HREF=\"admin.php?mod=story&op=help\">help</A></SMALL><HR>\n"; - - $type = ($type ? $type : 0); - - switch ($op) { - case "add": - print story_form(); - break; - case "delete": - print story_delete($id); - print story_overview(story_query($type)); - break; - case "edit": - print story_form(node_get_array(array("nid" => check_input($id)))); - break; - case "help": - story_help(); - break; - case "listing": - print node_listing(story_query()); - break; - case "search": - print search_form($keys); - print search_data($keys, $mod); - break; - case t("Preview"): - story_view(new Story(node_preview($edit))); - print story_form($edit); - break; - case t("Submit"): - story_save($edit); - // fall through: - default: - print story_overview(story_query($type)); - } -} - - function story_user() { global $edit, $op, $theme, $user; |