Файл: click.php
Строк: 45
<?php
###############################################
# by MaZaFaKa #
# ICQ: 449-559 #
# E-mail: Dimonnet@inbox.ru #
# Потраченное время: Около 2х недель #
###############################################
error_reporting(0);
define('ROOTPATH', getcwd());
include(ROOTPATH.'/includes/config');
include(ROOTPATH.'/includes/functions');
include(ROOTPATH.'/includes/version');
echo ('<meta http-equiv="REFRESH" content="1;url=https://topwap.us"/>');
//=============================================//
//UPDATE
mysql_unbuffered_query("DELETE FROM `".INHOST."` WHERE `time` < (".time()." - 450);");
$id = (int) $_SERVER['QUERY_STRING'];
if($id < 1) errors();
$sql = mysql_query("SELECT `in`, `all_in` FROM `".USERS."` WHERE `status` != 'locked' AND `id` = ".$id.";");
if(mysql_affected_rows() < 1) exits();
$ip = substr(str_replace('.', '', getenv('REMOTE_ADDR')), 0, 5);
$ip = intval($ip);
list($in, $all_in) = mysql_fetch_row($sql);
// ----
$sql = mysql_query("SELECT * FROM `".INHOST."` WHERE `ip` = ".$ip." AND `time` > (".time()." - 3);");
if(mysql_affected_rows() > 0) exits();
$sql = mysql_query("SELECT * FROM `".INHOST."` WHERE `ip` = ".$ip." AND `id` = ".$id.";");
if(mysql_affected_rows() > 0) exits();
// ---
$in++;
$all_in++;
mysql_unbuffered_query("INSERT INTO `".INHOST."` SET `id` = ".$id.", `time` = ".time().", `ip` = ".$ip.";");
mysql_unbuffered_query("UPDATE `".USERS."` SET `in` = '".$in."', `all_in` = '".$all_in."' WHERE `id` = ".$id.";");
$sql = mysql_query("SELECT * FROM `".USERS."` WHERE `hosts` > 0 AND `hits` > 0 ORDER BY `hosts` DESC, `hits` DESC;");
$c = 1;
if(VERSION=='html')
{
if(mysql_num_rows($sql))
{
while($up = mysql_fetch_assoc($sql))
{
if($up['id'] != $id) $c++;
else
{
$page = ceil($c / PAGE);
}
}
$page = intval($page);
header("Location: ".PATH."/?page=".$page."&id=".$id);
exit();
}
else
{
header("Location: index.php");
exit();
}
}
else
{
if(mysql_num_rows($sql))
{
while($up = mysql_fetch_assoc($sql))
{
if($up['id'] != $id) $c++;
else
{
$page = ceil($c / 10);
}
}
$page = intval($page);
header("Location: https://topwap.us/?page=".$page."&id=".$id, true, 301);
//header("Location: ".PATH."/?page=".$page."&id=".$id, true, 301);
exit();
}
else
{
header("Location: index.php", true, 301);
exit();
}
}
?>