@@ -903,7 +903,7 @@ function valid_url($url, $absolute = FALSE) {
* The name of an event.
*/
functionflood_register_event($name){
db_query("INSERT INTO {flood} (event, hostname, timestamp) VALUES ('%s', '%s', %d)",$name,ip_address(),$_SERVER['REQUEST_TIME']);
db_query("INSERT INTO {flood} (event, hostname, timestamp) VALUES ('%s', '%s', %d)",$name,ip_address(),REQUEST_TIME);
}
/**
...
...
@@ -920,7 +920,7 @@ function flood_register_event($name) {
* True if the user did not exceed the hourly threshold. False otherwise.
*/
functionflood_is_allowed($name,$threshold){
$number=db_result(db_query("SELECT COUNT(*) FROM {flood} WHERE event = '%s' AND hostname = '%s' AND timestamp > %d",$name,ip_address(),$_SERVER['REQUEST_TIME']-3600));
$number=db_result(db_query("SELECT COUNT(*) FROM {flood} WHERE event = '%s' AND hostname = '%s' AND timestamp > %d",$name,ip_address(),REQUEST_TIME-3600));
// Change any future last comment timestamps to current time.
db_query('UPDATE {node_comment_statistics} SET last_comment_timestamp = %d WHERE last_comment_timestamp > %d',$_SERVER['REQUEST_TIME'],$_SERVER['REQUEST_TIME']);
db_query('UPDATE {node_comment_statistics} SET last_comment_timestamp = %d WHERE last_comment_timestamp > %d',REQUEST_TIME,REQUEST_TIME);
* Closes polls that have exceeded their allowed runtime.
*/
functionpoll_cron(){
$result=db_query('SELECT p.nid FROM {poll} p INNER JOIN {node} n ON p.nid = n.nid WHERE (n.created + p.runtime) < '.$_SERVER['REQUEST_TIME'].' AND p.active = 1 AND p.runtime != 0');
$result=db_query('SELECT p.nid FROM {poll} p INNER JOIN {node} n ON p.nid = n.nid WHERE (n.created + p.runtime) < '.REQUEST_TIME.' AND p.active = 1 AND p.runtime != 0');
while($poll=db_fetch_object($result)){
db_query("UPDATE {poll} SET active = 0 WHERE nid = %d",$poll->nid);