summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-04-05 20:33:36 +0000
committerDries Buytaert <dries@buytaert.net>2001-04-05 20:33:36 +0000
commit048664f2786fce9bd049f39eea39a2a7fe2868f0 (patch)
treebc017dc66a48bec52fea486a6b7ec52ad5ff8e1f /includes
parent7fac91c2cc4ca3dedf4459f9cdf9955e33be0f42 (diff)
downloadbrdo-048664f2786fce9bd049f39eea39a2a7fe2868f0.tar.gz
brdo-048664f2786fce9bd049f39eea39a2a7fe2868f0.tar.bz2
- a bunch of various updates
Diffstat (limited to 'includes')
-rw-r--r--includes/comment.inc6
-rw-r--r--includes/common.inc2
-rw-r--r--includes/hostname.conf22
-rw-r--r--includes/node.inc12
-rw-r--r--includes/user.inc2
-rw-r--r--includes/watchdog.inc4
6 files changed, 8 insertions, 40 deletions
diff --git a/includes/comment.inc b/includes/comment.inc
index b15cee23b..4e1a74f2c 100644
--- a/includes/comment.inc
+++ b/includes/comment.inc
@@ -281,9 +281,9 @@ function comment_render($lid, $cid) {
// Pre-process variables:
$lid = empty($lid) ? 0 : $lid;
$cid = empty($cid) ? 0 : $cid;
- $mode = ($user->id) ? $user->mode : 4;
- $order = ($user->id) ? $user->sort : 1;
- $threshold = ($user->id) ? $user->threshold : 3;
+ $mode = ($user->id) ? $user->mode : variable_get("default_comment_mode", 4);
+ $order = ($user->id) ? $user->sort : variable_get("default_comment_order", 1);
+ $threshold = ($user->id) ? $user->threshold : variable_get("default_comment_threshold", 3);
if ($user->id) {
// Comment control:
diff --git a/includes/common.inc b/includes/common.inc
index 2d24df5a5..3dece2c39 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -13,6 +13,7 @@ $conf = conf_init();
include_once "includes/$conf.conf";
include_once "includes/database.inc";
+include_once "includes/variable.inc";
include_once "includes/watchdog.inc";
include_once "includes/function.inc";
include_once "includes/comment.inc";
@@ -25,6 +26,7 @@ include_once "includes/node.inc";
user_init();
$locale = locale_init();
+$conf = variable_init();
$theme = theme_init();
?> \ No newline at end of file
diff --git a/includes/hostname.conf b/includes/hostname.conf
index 7decbdb7d..871110493 100644
--- a/includes/hostname.conf
+++ b/includes/hostname.conf
@@ -56,26 +56,4 @@ $themes = array("UnConeD" => array(
#$language = array(); // = language support disabled
$languages = array("en" => "English");
-#
-# Submission moderation votes:
-# The keys of this associative array are displayed in each submission's selection box whereas the corresponding values represent the mathematical calculation to be performed to update a comment's value.
-# Warning: changing $moderation_votes will affect the integrity of all pending stories in the open submission queue. Do not change this setting unless there are no pending stories in the submission queue or unless you know what you are doing.
-$moderation_votes = array("neutral (+0)" => "+ 0",
- "post it (+1)" => "+ 1",
- "dump it (-1)" => "- 1");
-
-#
-# Submission rate:
-# Defines the submission rate for the different types of content submission. It is supposed to stop malicious attempts to screw with the database and to stop denial of service attacks.
-# Example: '"comment" => 60' means that there is only one new comment allowed from the same IP-address every 60 seconds.
-#
-$submission_rate = array("comment" => "60", // 60 seconds = 1 minute
- "node" => "300"); // 300 seconds = 5 minutes
-
-#
-# Submission size:
-# The maximum length (i.e. the maximum number of characters) a story, a diary entry, or a comment is allowed to be.
-#
-$submission_size = 12000; // 12.000 characters is appr. 300 lines
-
?>
diff --git a/includes/node.inc b/includes/node.inc
index d894c6749..462fc7a47 100644
--- a/includes/node.inc
+++ b/includes/node.inc
@@ -161,16 +161,4 @@ function node_visible($node) {
return ($node->status == $status[posted]) || ($node->status == $status[queued] && $user->id) || user_access($user, "node");
}
-function node_post_threshold($node, $threshold = 5) {
- return 3;
-}
-
-function node_dump_threshold($node, $threshold = - 3) {
- return -2;
-}
-
-function node_timout_threshold($node, $threshold = 10) {
- return 9;
-}
-
?>
diff --git a/includes/user.inc b/includes/user.inc
index 5c97cb02d..18f48ce52 100644
--- a/includes/user.inc
+++ b/includes/user.inc
@@ -103,7 +103,7 @@ function user_ban($mask, $type) {
function user_gravity($id) {
global $status;
- $period = 5184000; // maximum 60 days
+ $period = 5184000; // maximum 60 days
$number = 30; // maximum 30 comments
$r1 = db_query("SELECT COUNT(nid) AS number FROM node WHERE author = '$id' AND (". time() ." - timestamp < $period) AND status = '$status[posted]'");
diff --git a/includes/watchdog.inc b/includes/watchdog.inc
index 2d221c842..9b28f3904 100644
--- a/includes/watchdog.inc
+++ b/includes/watchdog.inc
@@ -1,7 +1,7 @@
<?php
-$watchdog = array("comment" => array("0", $submission_rate["comment"]),
- "node" => array("1", $submission_rate["node"]),
+$watchdog = array("comment" => array("0", variable_get("max_comment_rate", 60)),
+ "node" => array("1", variable_get("max_node_rate", 900)),
"message" => array("3", "0"),
"warning" => array("4", "0"),
"error" => array("5", "0"));