hello all,
what can be wrong here
Code:
if (isset($CURUSER)) {
$transfer_filename = $BASEURL['cache'].'/transfer_crazyhour.txt';
$crazyhour_filename = $BASEURL['cache'].'/crazy_hour.txt';
$crazyhour_cache = fopen($crazyhour_filename,'r+');
$crazyhour_var = fread($crazyhour_cache, filesize($BASEURL['cache'].'/crazy_hour.txt'));
fclose($crazyhour_cache);
$cimg = '<img src=\''.$BASEURL.'pic\cat_free.gif\' alt=\'FREE!\' />';
if ($crazyhour_var >= sqlesc(get_date_time()) && $crazyhour_var < sqlesc(get_date_time()) + 3600) { // is crazyhourmkprettytime(strtotime($leechwarnuntil) - gmtime())
echo"<table width='50%'><tr><td class='colhead' colspan='3' align='center'>
w00 Vrijeme je za slobodne sate! Zavrsava u ".mkprettytime($crazyhour_var - time)."</td></tr>
<tr><td width='42px' align='center' valign='middle'>". $cimg."</td>
<td><div align='center'>Svi torrenti su FREE/SLOBODNI i upload statistika se UTROSTRUCUJE!</div></td>
<td width='42px' align='center' valign='middle'>".$cimg."</td></tr></table><br />";
if (is_file($transfer_filename))
unlink($transfer_filename);
}
elseif ($crazyhour_var < sqlesc(get_date_time()) + 3600 && !is_file($transfer_filename)) { //== crazyhour over
$transfer_file_created = fopen($transfer_filename, 'w');
fclose($transfer_file_created);
$crazyhour['crazyhour_new'] = mktime(23, 59, 59, date('m'), date('d'), date('y'));
$crazyhour['crazyhour']['var'] = mt_rand($crazyhour['crazyhour_new'], ($crazyhour['crazyhour_new'] + 86400);
$fp = fopen($crazyhour_filename, 'w');
fwrite($fp, $crazyhour['crazyhour']['var']);
fclose($fp);
write_log('Naslednji slobodni sati u '.gmdate('Y-m-d H:i', $crazyhour['crazyhour'] ['var']));
echo"<table cellpadding='3'><tr><td class='colhead' colspan='3' align='center'>"." Crazyhour will be ".get_date_time($crazyhour['crazyhour']['var'], '')." -------------- ".mkprettytime(strtotime($crazyhour['crazyhour']['var'] - gmtime()))." remaining till Crazyhour</td></tr></table><br />";
}
else // make date look prettier with countdown etc even :]
echo"<table cellpadding='3'><tr><td class='colhead' colspan='3' align='center'>"." Crazyhour will be ".get_date_time($crazyhour_var, '')." ".mkprettytime(strtotime($crazyhour_var - gmtime()))." remaining till Crazyhour</td></tr></table><br />";
}
Thanks for help