Файл: vsime.com/comm/index.php
Строк: 33
<?
$title = 'Сообщества';
include('../system/includes/system.php');
mysqli_query($dbi, "DELETE FROM `comm_users` WHERE `time` < '".($time-(3600*3))."' AND `invite` = '1'");
mysqli_query($dbi, "DELETE FROM `users_ban` WHERE `time_ban` < '$time'");
mysqli_query($dbi, "DELETE FROM `comm_visits` WHERE `time` < '".mktime(0,0,0)."'");
mysqli_query($dbi, "DELETE FROM `chat_comm_who` WHERE `time` < '".($time-120)."'");
if (isset($user))$mcomms = mysqli_result("SELECT COUNT(*) FROM `comm` WHERE `id_user` = '$user[id]'"); // количество собственных сообществ
if (isset($_GET['id']) && mysqli_result("SELECT COUNT(*) FROM `comm` WHERE `id` = '".intval(@$_GET['id'])."'")!=0)
{
if (@!mysqli_result("SELECT COUNT(*) FROM `comm_visits` WHERE `id_comm` = '".intval($_GET['id'])."' AND `id_user` = '$user[id]'"))mysqli_query($dbi, "INSERT INTO `comm_visits` SET `id_comm` = '".intval($_GET['id'])."', `id_user` = '$user[id]', `time` = '$time'");
$count_visits=mysqli_num_rows(mysqli_query($dbi, "SELECT * FROM `comm_visits` WHERE `id_comm` = '".intval($_GET['id'])."'"));
mysqli_query($dbi, "UPDATE `comm` SET `visits` = '$count_visits' WHERE `id` = '".intval($_GET['id'])."'");
@$uinc=mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `comm_users` WHERE `id_user` = '$user[id]' AND `id_comm` = '".intval($_GET['id'])."'"));
@mysqli_query($dbi, "UPDATE `comm_users` SET `last_time` = '$time' WHERE `id` = '$uinc[id]'");
}
if (isset($_GET['act'])) {$act = my_esc($_GET['act']);} else {$act = 'index';}
if (in_array($act, array('flv', 'prev', 'add_cat', 'edit_cat', 'delete_cat', 'cat', 'add_comm', 'comm', 'comm_users', 'comm_settings', 'comm_avatar', 'comm_join', 'comm_object', 'comm_info', 'comm_cat', 'comm_activlist', 'readmin', 'user', 'blist', 'invite', 'comm_journal', 'comm_users_ban', 'forum', 'chat', 'files')))include_once 'inc/act_'.$act.'.php';
else include_once 'inc/act_index.php';
ex_foot();
?>