View file lib/in.php

File size: 1.67Kb
<?php
if (! defined ( 'CATALOGDEEP' )) {
	die ( "Hacking attempt!" );
}
$date = time();
$id = abs((int)$_GET['id']);
if(empty($id)){
	header ("Location: http://".$_SERVER['SERVER_NAME']);
	die();
	}else{
	$sql = mysql_query("SELECT `status` FROM `cat_users` WHERE `id` = '".$id."'");
	$sql = mysql_result($sql,0);
	if($sql != 'mod'){
	
$sql = mysql_query("SELECT `ids` FROM `cat_ip` WHERE INET_ATON('".getenv('REMOTE_ADDR')."') BETWEEN `ip1` AND `ip2`;");

                if(mysql_num_rows($sql) > 0)
                {
                $operator = mysql_result($sql, 0);
                }
                else
                {
                $operator = 0;
                }
		$sql = mysql_query("SELECT * FROM `cat_opsos_in` WHERE `ip` = INET_ATON('".getenv('REMOTE_ADDR')."') AND `idsite` = '".$id."'");
	if(mysql_num_rows($sql) == 0){
if(detect_mobile_device()){			
$sql = mysql_query("SELECT * FROM `cat_opsos_in` WHERE `opsos` = '".$operator."' AND `idsite` = '".$id."'");
if(mysql_num_rows($sql) > 0){
	$sql = mysql_query("UPDATE `cat_opsos_in` SET `in` = (`in` + 1) WHERE `opsos` = '".$operator."' AND `idsite` = '".$id."'");
	}else{
$sql = mysql_query("INSERT INTO `cat_opsos_in` SET `ip` = INET_ATON('".getenv('REMOTE_ADDR')."'), `opsos` = '".$operator."', `date` = '".$date."', `idsite` = '".$id."', `in` = '1'");
	}							
$sql = mysql_query("UPDATE `cat_users` SET `in` = (`in` + 1), `inall` = (`inall` + 1), `status` = 'on' WHERE `id` = '".$id."'");
}
}
}
	header ("Location: http://".$_SERVER['SERVER_NAME']);
	
	}
die();	

/**********************/
/*Нарушение авторских прав, приследуется темной за углом*/
/*(с) govnokod by DeeP      http://lovap.ru             */                         
?>