View Single Post
  #1  
Old 2nd March 2010, 10:42
Edgein's Avatar
Edgein Edgein is offline
Senior Member
 
Join Date: Sep 2008
Netherlands
Posts: 154
Smile [FIX] FTS 1.1 remove expired warnings
When a user is warned and the warned time is over
the system does not remove the warning automatic

go to /include/libs/cron/cron_class.php
and find

PHP Code:
    public function deadtime()
    { 
above add

PHP Code:
//remove expired warnings
  
$res mysql_query("SELECT id FROM users WHERE warned='yes' AND warneduntil < NOW() AND warneduntil <> '0000-00-00 00:00:00'") or sqlerr(__FILE____LINE__);
  if (
mysql_num_rows($res) > 0)
  {
    
$dt sqlesc(get_date_time());
    
$msg sqlesc("Your warning has been removed. Please keep in your best behaviour from now on.\n");
    while (
$arr mysql_fetch_assoc($res))
    {
      
mysql_query("UPDATE users SET warned = 'no', warneduntil = '0000-00-00 00:00:00' WHERE id = $arr[id]") or sqlerr(__FILE____LINE__);
      
mysql_query("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $arr[id]$dt$msg, 0)") or sqlerr(__FILE____LINE__);
    }
  }
//end remove expired warnings 
grtzz Edgein
Reply With Quote
The Following User Says Thank You to Edgein For This Useful Post:
Phogo (4th March 2010)