summaryrefslogtreecommitdiff
path: root/includes/variable.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-04-16 11:38:12 +0000
committerDries Buytaert <dries@buytaert.net>2001-04-16 11:38:12 +0000
commitb9952f537d5f1a102e145b0529c78bc31a1509af (patch)
tree51f6a0ab5c46bd4643c5b2ac0579a4a411e45977 /includes/variable.inc
parent49a7dccb64a239097d44e235b525708c6a39d29e (diff)
downloadbrdo-b9952f537d5f1a102e145b0529c78bc31a1509af.tar.gz
brdo-b9952f537d5f1a102e145b0529c78bc31a1509af.tar.bz2
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)
Diffstat (limited to 'includes/variable.inc')
-rw-r--r--includes/variable.inc30
1 files changed, 6 insertions, 24 deletions
diff --git a/includes/variable.inc b/includes/variable.inc
index 20beb5efd..083f7d492 100644
--- a/includes/variable.inc
+++ b/includes/variable.inc
@@ -7,33 +7,15 @@ function variable_init($conf = array()) {
}
function handler_post_threshold($node, $default) {
- if ($node->type) {
- $function = $node->type ."_post_threshold";
- return $function($node, $default);
- }
- else {
- return $default;
- }
+ return ($threshold = category_post_threshold($node->cid) ? $threshold : $default);
}
function handler_dump_threshold($node, $default) {
- if ($node->type) {
- $function = $node->type ."_dump_threshold";
- return $function($node, $default);
- }
- else {
- return $default;
- }
+ return ($threshold = category_dump_threshold($node->cid) ? $threshold : $default);
}
-function handler_timout_threshold($node, $default) {
- if ($node->type) {
- $function = $node->type ."_timout_threshold";
- return $function($node, $default);
- }
- else {
- return $default;
- }
+function handler_expire_threshold($node, $default) {
+ return ($threshold = category_expire_threshold($node->cid) ? $threshold : $default);
}
function variable_get($name, $default, $object = 0) {
@@ -44,8 +26,8 @@ function variable_get($name, $default, $object = 0) {
return handler_post_threshold($object, $default);
case "dump_threshold":
return handler_dump_threshold($object, $default);
- case "timout_threshold":
- return handler_timout_threshold($object, $default);
+ case "expire_threshold":
+ return handler_expire_threshold($object, $default);
default:
return ($conf[$name] ? $conf[$name] : $default);
}