diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-01-21 19:41:11 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-01-21 19:41:11 +0000 |
commit | ea9788853352750389307d94999ebe58991929b1 (patch) | |
tree | 50634b44ac6bf11dd346d9b6f034e415bea4b8c2 /includes/section.inc | |
parent | 7cc7b405e323f36037dab894b69d6fd739915d5d (diff) | |
download | brdo-ea9788853352750389307d94999ebe58991929b1.tar.gz brdo-ea9788853352750389307d94999ebe58991929b1.tar.bz2 |
I know, I know, it is getting nasty lately but I have another large commit after nothing but code.
This time I redid the "category"-stuff. Categories - from now on called sections - are now maintained from the admin pages, can have their own post, dump and timout thresholds as discussed earlier (some weeks ago). By tomorrow evening users will be able to enable or disable section as well - i.e. to customize the content of drop.org.
Diffstat (limited to 'includes/section.inc')
-rw-r--r-- | includes/section.inc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/includes/section.inc b/includes/section.inc new file mode 100644 index 000000000..0bebaf026 --- /dev/null +++ b/includes/section.inc @@ -0,0 +1,25 @@ +<? + +function section_get() { + $array = array(); + $result = db_query("SELECT name FROM sections"); + while ($section = db_fetch_object($result)) array_push($array, $section->name); + return $array; +} + +function section_post_threshold($section, $threshold = 5) { + $result = db_query("SELECT post FROM sections WHERE name = '$section'"); + return ($result) ? db_result($result, 0) : $threshold; +} + +function section_dump_threshold($section, $threshold = - 3) { + $result = db_query("SELECT dump FROM sections WHERE name = '$section'"); + return ($result) ? db_result($result, 0) : $threshold; +} + +function section_timout_threshold($section, $threshold = 10) { + $result = db_query("SELECT timout FROM sections WHERE name = '$section'"); + return ($result) ? db_result($result, 0) : $threshold; +} + +?>
\ No newline at end of file |