<?

//=============================//
//                             //
//   MSNStatus v0.2            //
//   MSNStatus Cron Job file   //
//   MSNStatus.Cron.php        //
//   by Stanga Razvan          //
//   razvan_stanga@yahoo.com   //
//   http://www.phprebel.org   //
//                             //
//       MADE IN ROMANIA       //
//                             //
//=============================//

class MSNStatusCron {

//---------
// Cron Job
//---------

function do_write ($time_cache$file) {
    global 
$config;

        
ksort ($time_cache);

        
$file_data "<?\r\n";
        
        foreach( 
$time_cache as $t => $c )
        {
            
$file_data .= '$time_cache['."'".$t."'".']'."\t=\t'".$c."';\r\n";    
        }
        
        
$file_data .= "".'?'.'>';

        
$this->writetofile ("includes/_time/".$file.".php"$file_data);

}

//-------------------
// Start Write 2 File
//-------------------

function writetofile ($path,$data,$backup=0) {

  if (
file_exists($path)!=0) {
    if (
$backup==1) {
      
$filenamenew=$path."venom";

      
rename ($path,$filenamenew);
    } else {
      
unlink($path);
    }
  }

  if (
$data!="") {

    
$filenum=fopen($path,"w");

    
fwrite($filenum,$data);

    
fclose($filenum);

  }

}

}

?>