include "config.php";
// yonlenme
$ips = explode(".",$ip);
$ips= $ips[0].".".$ips[1].".".$ips[2];
$country_a = mysql_fetch_array(mysql_query("SELECT `country_code` FROM `country` WHERE `ip`='".$ips."' "));
$cc = $country_a['country_code'];
// if ($cc == "TR" || $cc == "IN")
// {
// header("location: http://neoban.su/2607.go?topmob");
// exit;
// }
// else if ($cc == "IN")
// {
// header("location: http://neoban.su/2607.go?topmob");
// exit;
// }
//
$id = intval($_GET['id']);
$select = mysql_query("SELECT `category` FROM `sites` WHERE `id`='".$id."' AND `status`=1 ");
$site_aa = mysql_fetch_array($select);
if (mysql_num_rows($select)==0)
{
include "header.php";
echo '
';
echo '';
echo 'Sayt tapılmadı.
';
echo '
';
include "footer.php";
}
else
{
if ($site_aa['category']==7 || $site_aa['category']==9)
{
$site_q = mysql_query( "SELECT `id` FROM `sites` WHERE `status`=1 AND `host`>0 AND `id`!=1 AND `category`='".$site_aa['category']."' ORDER BY `host` DESC LIMIT 10000;" );
}
else
{
$site_q = mysql_query( "SELECT `id` FROM `sites` WHERE `status`=1 AND `host`>0 AND `id`!=1 AND `category`!=7 AND `category`!=9 ORDER BY `host` DESC LIMIT 10000;" );
}
$x=1;
while ( $site_a = mysql_fetch_array( $site_q ) )
{
$site_id = $site_a['id'];
if ( $site_id == $id )
{
$row = $x;
break;
}
else
{
$x++;
}
}
if ($row == 10) $row=9;
if ($row == 20) $row=19;
if ($row == 30) $row=29;
if ($row == 40) $row=39;
if ($row == 50) $row=49;
if ($row == 60) $row=59;
if ($row == 70) $row=69;
if ($row == 80) $row=79;
if ($row == 90) $row=89;
$rank_page = intval($row/10);
$update = mysql_query("UPDATE `sites` SET `today_in`=`today_in`+1 , `all_in`=`all_in`+1 WHERE `id`='".$id."' LIMIT 1 ");
session_start();
ob_start();
$_SESSION['site_take_id'] = $id;
if ($site_aa['category']==7 || $site_aa['category']==9) header("location: /category/".$site_aa['category']."/page/".$rank_page);
else header("location: /page/".$rank_page);
print $row;
}
?>