Fixed the robot for the arrayed config
This commit is contained in:
parent
a655d930d0
commit
626179d553
@ -533,7 +533,7 @@
|
|||||||
global $config;
|
global $config;
|
||||||
// Find number of mutes in the past X hours
|
// Find number of mutes in the past X hours
|
||||||
$query = prepare("SELECT COUNT(*) as `count` FROM `mutes` WHERE `time` >= :time AND `ip` = :ip");
|
$query = prepare("SELECT COUNT(*) as `count` FROM `mutes` WHERE `time` >= :time AND `ip` = :ip");
|
||||||
$query->bindValue(':time', time()-(ROBOT_MUTE_HOUR*3600), PDO::PARAM_INT);
|
$query->bindValue(':time', time()-($config['robot_mute_hour']*3600), PDO::PARAM_INT);
|
||||||
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
|
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
|
||||||
$query->execute() or error(db_error($query));
|
$query->execute() or error(db_error($query));
|
||||||
|
|
||||||
@ -553,6 +553,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkMute() {
|
function checkMute() {
|
||||||
|
global $config;
|
||||||
|
|
||||||
$mutetime = muteTime();
|
$mutetime = muteTime();
|
||||||
if($mutetime > 0) {
|
if($mutetime > 0) {
|
||||||
// Find last mute time
|
// Find last mute time
|
||||||
|
12
post.php
12
post.php
@ -128,9 +128,9 @@
|
|||||||
if(!openBoard($post['board']))
|
if(!openBoard($post['board']))
|
||||||
error($config['error']['noboard']);
|
error($config['error']['noboard']);
|
||||||
|
|
||||||
//if(ROBOT_ENABLE && $board['uri'] == ROBOT_BOARD && ROBOT_MUTE) {
|
if($config['robot_enable'] && $config['robot_mute']) {
|
||||||
// checkMute();
|
checkMute();
|
||||||
//}
|
}
|
||||||
|
|
||||||
//Check if thread exists
|
//Check if thread exists
|
||||||
if(!$OP && !threadExists($post['thread']))
|
if(!$OP && !threadExists($post['thread']))
|
||||||
@ -265,15 +265,13 @@
|
|||||||
$post['thumbheight'] = $thumb['height'];
|
$post['thumbheight'] = $thumb['height'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
if(!($mod && $mod['type'] >= $config['mod']['postunoriginal']) && $config['robot_enable'] && checkRobot($post['body_nomarkup'])) {
|
||||||
if(!($mod && $mod['type'] >= $config['mod']['postunoriginal']) && ROBOT_ENABLE && $board['uri'] == ROBOT_BOARD && checkRobot($post['body_nomarkup'])) {
|
if($config['robot_mute']) {
|
||||||
if(ROBOT_MUTE) {
|
|
||||||
error(sprintf($config['error']['muted'], mute()));
|
error(sprintf($config['error']['muted'], mute()));
|
||||||
} else {
|
} else {
|
||||||
error($config['error']['unoriginal']);
|
error($config['error']['unoriginal']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// Remove DIR_* before inserting them into the database.
|
// Remove DIR_* before inserting them into the database.
|
||||||
if($post['has_file']) {
|
if($post['has_file']) {
|
||||||
|
Loading…
Reference in New Issue
Block a user