File size: 1.98Kb
<?php
define('NTOP', 1);
require_once ('../system/connect.php');
require_once ('../system/core.php');
require_once ('../system/function.php');
$prefix = "top_";
mysql_query("UPDATE `".$prefix."sait` SET `hosts` = '0', `hits` = '0', `in` = '0', `out` = '0'");
$saits = mysql_query("SELECT * FROM `".$prefix."sait`");
mysql_query("TRUNCATE TABLE `".$prefix."online`");
$time = time()-(23*3600);
//echo date("d.m.y h:i", $time);
mysql_query("DELETE FROM `".$prefix."hosts` WHERE `time` < '$time'");
mysql_query("DELETE FROM `".$prefix."hits` WHERE `time` < '$time'");
mysql_query("DELETE FROM `".$prefix."go` WHERE `time` < '$time'");//UPDATE
mysql_query("TRUNCATE TABLE `top_inhost`");
//mysql_query("DELETE FROM `".$prefix."sait` WHERE `all_hosts` < 1 AND `status` = 1");
mysql_query("UPDATE `".$prefix."sait` SET `newsait` = '1' WHERE `all_in` > '".$set['newsait']."'");
mysql_query("TRUNCATE TABLE `".$prefix."sait_online`");
mysql_query("TRUNCATE TABLE `counter`");
mysql_query("OPTIMIZE TABLE `counter`");
mysql_query("OPTIMIZE TABLE `".$prefix."online`");
mysql_query("OPTIMIZE TABLE `".$prefix."sait_online`");
mysql_query("OPTIMIZE TABLE `".$prefix."cat`");
mysql_query("OPTIMIZE TABLE `".$prefix."go`");
mysql_query("OPTIMIZE TABLE `".$prefix."hits`");
mysql_query("OPTIMIZE TABLE `".$prefix."hosts`");
mysql_query("OPTIMIZE TABLE `".$prefix."images`");
mysql_query("OPTIMIZE TABLE `".$prefix."ip`");
mysql_query("OPTIMIZE TABLE `".$prefix."ip_name`");
mysql_query("OPTIMIZE TABLE `".$prefix."news`");
mysql_query("OPTIMIZE TABLE `".$prefix."news_comments`");
mysql_query("OPTIMIZE TABLE `".$prefix."reputation`");
mysql_query("OPTIMIZE TABLE `".$prefix."sait_comments`");
mysql_query("OPTIMIZE TABLE `".$prefix."sait`");
mysql_query("OPTIMIZE TABLE `".$prefix."settings`");
mysql_query("OPTIMIZE TABLE `".$prefix."users`");
while($row = mysql_fetch_array($saits))
{
$pr=getpr($row['url']);
$up = mysql_query("UPDATE `".$prefix."sait` SET `cy`='".$cy."' WHERE `id` = '".$row['id']."'");
}
?>