<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';

if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `views` WHERE `id` = '".intval($_GET['id'])."'"),0)==1)
{
$post=mysql_fetch_assoc(mysql_query("SELECT * FROM `views` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));

$ank=get_user($post['id_user']);

if($user[id]==$ank[id]|| $user[level]>3){
mysql_query("DELETE FROM `views` WHERE `id` = '$post[id]'");
}
}


header("Location: index.php?id=$ank[id]");

?>