From b9952f537d5f1a102e145b0529c78bc31a1509af Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 16 Apr 2001 11:38:12 +0000 Subject: Large commit, read it carefully, and make the required changes to your theme: - corrected some missing translations in story.module. Oops! - grealty simplified the "moderation threshold mechanism"(tm) so that module writers don't have to worry about this. As a result story.module and book.module became a bit smaller and easier to grasp. - greatly simplified new "category" and "topic" code which is soon going to replace the "section" code. Needs more work though so hang on thight. - includes/section.inc and modules/section.module are replaced by includes/structure.module and modules/structure.module. - beautified example.theme a bit without adding HTML complexity: it is a good example but still useful as a theme - made theme example use "categories" and "topics" --> TAKE A LOOK AT IT AND UPDATE YOUR THEME - made theme marvin use "categories" and "topics" --> TAKE A LOOK AT IT AND UPDATE YOUR THEME - added 2 new "story listings" to administrator interface of story.module to verify story integrity. - optimized comment table a bit (work in progress) --- modules/section.module | 137 ------------------------------------------------- 1 file changed, 137 deletions(-) delete mode 100644 modules/section.module (limited to 'modules/section.module') diff --git a/modules/section.module b/modules/section.module deleted file mode 100644 index 9b42e46d1..000000000 --- a/modules/section.module +++ /dev/null @@ -1,137 +0,0 @@ - "section_help", - "block" => "section_block", - "admin" => "section_admin"); - -// global variables: -$_section = array("status" => array(2 => "enabled: always", 1 => "enabled: custom", 0 => "disabled"), - "timout" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100), - "post" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100), - "dump" => array(-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -20, -25, -30)); - -function section_help() { - ?> -

When submitting new stories, every story is assigned a section or category. Sections can be maintained from the administration pages.

-

For moderation purpose, you can specify a post, dump and expiration thresholds for each available section according to type and urgency level of a section. This is useful considering the fact that some sections do not really "expire" and stay interesting and active as time passes by, whereas news-related stories are only considered "hot" over a short period of time.

- name) ."\">$_section->name (". check_output($_section->stories, 0) .")\n"; - } - - $block[0][subject] = "Sections"; - $block[0][content] = $content; - $block[0][info] = "Section list"; - - return $block; -} - -function section_add() { - global $_section; - - $output .= "
\n"; - $output .= "

\n"; - $output .= " Section name:
\n"; - $output .= " \n"; - $output .= "

\n"; - $output .= "

\n"; - $output .= " Post threshold:
\n"; - $output .= " \n"; - $output .= "

\n"; - $output .= "

\n"; - $output .= " Dump threshold:
\n"; - $output .= " \n"; - $output .= "

\n"; - $output .= "

\n"; - $output .= " Timout threshold:
\n"; - $output .= " \n"; - $output .= "

\n"; - $output .= " \n"; - $output .= "
\n"; - - print $output; -} - -function section_add_save($edit) { - db_query("INSERT INTO sections (name, post, dump, timout) VALUES ('". check_input($edit[name]) ."', '". check_input($edit[post]) ."', '". check_input($edit[dump]) ."', '". check_input($edit[timout]) ."')"); -} - -function section_delete($name) { - db_query("DELETE FROM sections WHERE name = '$name'"); -} - -function section_display() { - global $_section; - - $status = $_section[status]; - $timout = $_section[timout]; - $post = $_section[post]; - $dump = $_section[dump]; - - // Perform query: - $result = db_query("SELECT * FROM sections ORDER BY name"); - - // Generate output: - $output .= "
\n"; - $output .= "\n"; - $output .= " \n"; - while ($_section = db_fetch_object($result)) { - foreach ($status as $key=>$value) $options0 .= "\n"; - foreach ($post as $value) $options1 .= "\n"; - foreach ($dump as $value) $options2 .= "\n"; - foreach ($timout as $value) $options3 .= "\n"; - $output .= " \n"; - unset($options0); unset($options1); unset($options2); unset($options3); - } - $output .= "
section namestatuspost thresholddump thresholdexpiration thresholdoperations
". check_output($_section->name) ."name) ."\">delete
\n"; - $output .= "\n"; - $output .= "
\n"; - - print $output; -} - -function section_display_save($edit) { - foreach ($edit as $key=>$value) { - db_query("UPDATE sections SET status = '". check_input($value[status]) ."', post = '". check_input($value[post]) ."', dump = '". check_input($value[dump]) ."', timout = '". check_input($value[timout]) ."' WHERE name = '". check_input($key) ."'"); - } -} - -function section_admin() { - global $op, $edit, $name; - - print "add new section | overview | help
\n"; - - switch($op) { - case "add": - section_add(); - break; - case "help": - section_help(); - break; - case "delete": - section_delete(check_input($name)); - section_display(); - break; - case "Add section": - section_add_save($edit); - section_display(); - break; - case "Save sections": - section_display_save($edit); - // fall through - default: - section_display(); - } -} - -?> -- cgit v1.2.3