mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-24 14:23:23 +01:00
Add board wide new thread limit
This commit is contained in:
parent
42f3f5ee8f
commit
3894f1e0b8
@ -2643,6 +2643,20 @@ function diceRoller($post) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function max_posts_per_hour($post) {
|
||||||
|
global $config, $board;
|
||||||
|
if (!$config['hour_max_threads']) return false;
|
||||||
|
|
||||||
|
if ($post['op']) {
|
||||||
|
$query = prepare(sprintf('SELECT COUNT(*) AS `count` FROM ``posts_%s`` WHERE `thread` IS NULL AND FROM_UNIXTIME(`time`) > DATE_SUB(NOW(), INTERVAL 1 HOUR);', $board['uri']));
|
||||||
|
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR);
|
||||||
|
$query->execute() or error(db_error($query));
|
||||||
|
$r = $query->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
return ($r['count'] >= $config['hour_max_threads']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function slugify($post) {
|
function slugify($post) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user