I have a toplist script which resets daily at 00:00. Can someone help me to restet this toplist after two days?
Here are config.php and update.php
config.php
<?php $mysqlhost = ""; $database = ""; $mysqluser = ""; $password = ""; $sections = ""; $sites = ""; $ban = ""; $tmp = ""; $news = ""; $rekl = ""; $in_dir = "in"; $out_dir = "out"; $admin_dir = "admin"; $update_file = "updates.dat"; $connection = mysql_connect($mysqlhost, $mysqluser, $password); if(!$connection) { header("Content-type: text/vnd.wap.wml; charset=utf-8"); header("Last-Modified: ".gmdate("D, d M Y H:iConfused")." GMT"); header("Cache-Control: no-cache, must-relative"); $error = mysql_error(); echo <
No connection to MySQL
Home
The database could not be accessed
Home
update.php
<?php if(!defined("OK")) die(); $sql = mysql_query("SELECT * FROM `".$sites."` WHERE `all_in` != 0;"); $date = date("d-m-Y_H-i-s"); $fd = fopen("./logs/".$date.".txt", "w"); $data = "LOGS DATE: ".date("d-m-Y H:iConfused")."\n"; while($sa = mysql_fetch_array($sql)) { $data .= $sa['site']."|".$sa['in']."/".$sa['out']."|".$sa['all_in']."/".$sa['all_out']."\n"; } fwrite($fd, $data); fclose($fd); $fp = fopen("month.dat", "r"); flock($fp, LOCK_EX + LOCK_SH); $buffer = fgets($fp); if($buffer != date("m")) { $fdp = fopen("month.dat", "w"); fputs($fdp, date("m")); fclose($fdp); mysql_unbuffered_query("UPDATE `".$sites."` SET `all_in` = 0, `all_out` = 0;"); } flock($fp, LOCK_UN); fclose($fp); mysql_unbuffered_query("TRUNCATE TABLE `".$tmp."`;"); mysql_unbuffered_query("UPDATE `".$sites."` SET `in` = 0, `out` = 0;"); mysql_unbuffered_query("DELETE FROM `".$sites."` WHERE `all_in` = 0 AND `days` > 2;"); ?>