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