summaryrefslogtreecommitdiff
path: root/includes/section.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-04-06 14:14:16 +0000
committerDries Buytaert <dries@buytaert.net>2001-04-06 14:14:16 +0000
commit8213f5b2627a6b63db9f84b572918bd7e3254dff (patch)
treebdaa19d917ce2d0db1ba54ef884e22a69130846a /includes/section.inc
parent048664f2786fce9bd049f39eea39a2a7fe2868f0 (diff)
downloadbrdo-8213f5b2627a6b63db9f84b572918bd7e3254dff.tar.gz
brdo-8213f5b2627a6b63db9f84b572918bd7e3254dff.tar.bz2
A lot of small changes (search-n-replace) make a big commit:
- fixed update bug in book.module - provide a log message when both adding and updating book pages - all configurable variables are now accessed through "variable_get()": - rewrote watchdog and submission throttle and removed watchdog.inc - improved robustness of sections.inc - imporved story.module - updated ./database/database.sql
Diffstat (limited to 'includes/section.inc')
-rw-r--r--includes/section.inc18
1 files changed, 9 insertions, 9 deletions
diff --git a/includes/section.inc b/includes/section.inc
index c816818d4..ad25b179c 100644
--- a/includes/section.inc
+++ b/includes/section.inc
@@ -7,19 +7,19 @@ function section_get() {
return $array;
}
-function section_post_threshold($section, $threshold = 5) {
- $result = db_query("SELECT post FROM sections WHERE name = '". check_input($section) ."'");
- return ($result) ? db_result($result, 0) : $threshold;
+function section_post_threshold($section, $default) {
+ $section = db_fetch_object(db_query("SELECT post AS threshold FROM sections WHERE name = '". check_input($section) ."'"));
+ return $section->threshold ? $section->threshold : $default;
}
-function section_dump_threshold($section, $threshold = - 3) {
- $result = db_query("SELECT dump FROM sections WHERE name = '". check_input($section) ."'");
- return ($result) ? db_result($result, 0) : $threshold;
+function section_dump_threshold($section, $default) {
+ $section = db_fetch_object(db_query("SELECT dump AS threshold FROM sections WHERE name = '". check_input($section) ."'"));
+ return $section->threshold ? $section->threshold : $default;
}
-function section_timout_threshold($section, $threshold = 10) {
- $result = db_query("SELECT timout FROM sections WHERE name = '". check_input($section) ."'");
- return ($result) ? db_result($result, 0) : $threshold;
+function section_timout_threshold($section, $default) {
+ $section = db_fetch_object(db_query("SELECT timout AS threshold FROM sections WHERE name = '". check_input($section) ."'"));
+ return $section->threshold ? $section->threshold : $default;
}
?> \ No newline at end of file