Файл: 2/3020.ru/modules/files/plugins/file/eye_list.php
Строк: 51
<?php
IF (ISSET($user)){
IF (DB::GET_COLUMN("SELECT COUNT(`ID`) FROM `FILES_EYE_USERS` WHERE `USER_ID` = '".$user['ID']."' AND `FILE_ID` = '".$files['ID']."' LIMIT 1") == 0){
DB::GET_ADD("INSERT INTO `FILES_EYE_USERS` (`USER_ID`, `TIME`, `FILE_ID`) VALUES ('".$user['ID']."', '".TIME()."', '".$files['ID']."')");
}
}ELSE{
IF (DB::GET_COLUMN("SELECT COUNT(`ID`) FROM `FILES_EYE_GUESTS` WHERE `BROWSER` = '".USER_BROWSER."' AND `IP` = '".IP."' AND `FILE_ID` = '".$files['ID']."' LIMIT 1") == 0){
$location = @UNSERIALIZE(FILE_GET_CONTENTS('http://ip-api.com/php/'.IP.'?lang=ru'));
DB::GET_ADD("INSERT INTO `FILES_EYE_GUESTS` (`IP`, `TIME`, `FILE_ID`, `COUNTRY`, `BROWSER`) VALUES ('".IP."', '".TIME()."', '".$files['ID']."', '".ADSL($location['country'])."', '".USER_BROWSER."')");
}
}
IF (ISSET($user) && GET('get') == "eye_guests_list" && MANAGEMENT == 1){
$column = DB::GET_COLUMN("SELECT COUNT(`ID`) FROM `FILES_EYE_GUESTS` WHERE `FILE_ID` = '".$files['ID']."'");
$spage = SPAGE($column, $page_settings);
$page = PAGE($spage);
$limit = $page_settings * $page - $page_settings;
IF ($column == 0){
HTML::EMPTY();
}ELSE{
ECHO "<div class='list-body'>";
ECHO "<div class='list-menu'>";
ECHO " ".LG('Файл просмотрели из гостей').":";
ECHO "</div>";
}
$data = DB::GET_STRING_ALL("SELECT * FROM `FILES_EYE_GUESTS` WHERE `FILE_ID` = '".$files['ID']."' ORDER BY `TIME` DESC LIMIT ".$limit.", ".$page_settings."");
WHILE ($list = $data->FETCH()){
ECHO "<div class='list-menu'>";
ECHO "<b>IP</b>: ".$list['IP']."<br />";
ECHO "<b>".LG('Посещение')."</b>: ".FTIME($list['TIME'])."<br />";
ECHO "<b>".LG('Страна')."</b>: ".TEXT_ABSOLUTE($list['COUNTRY'])."<br />";
ECHO "<b>".LG('Браузер')."</b>: ".TEXT_ABSOLUTE($list['BROWSER'])."<br />";
ECHO "</div>";
}
IF ($column > 0){
ECHO "</div>";
}
IF ($spage > 1){ ECHO STR_PAGE('/modules/?path=files§ion=show&id='.$files['ID'].'&get=eye_guests_list&', $spage, $page); }
ECHO "<a href='/modules/?path=files§ion=show&id=".$files['ID']."'><div class='list'>";
ECHO ICONS('arrow-left', 17, 'fa-fw')." ".LG('Назад');
ECHO "</div></a>";
//Навигация
ECHO "<div class='navigation'>";
ECHO "<a href='/'>".ICONS('home', 25, 'fa-fw')."</a>";
ECHO "".ICONS('angle-right', 20, 'fa-fw')."";
ECHO "<a href='/id".$account['ID']."'>".$account['LOGIN']."</a>";
ECHO "".ICONS('angle-right', 20, 'fa-fw')."";
ECHO $nav;
ECHO "</div>";
REQUIRE (ROOT.'/system/connections/footer.php');
EXIT;
}
IF (ISSET($user) && GET('get') == "eye_users_list" && MANAGEMENT == 1){
$column = DB::GET_COLUMN("SELECT COUNT(`ID`) FROM `FILES_EYE_USERS` WHERE `FILE_ID` = '".$files['ID']."'");
$spage = SPAGE($column, $page_settings);
$page = PAGE($spage);
$limit = $page_settings * $page - $page_settings;
IF ($column == 0){
HTML::EMPTY();
}ELSE{
ECHO "<div class='list-body'>";
ECHO "<div class='list-menu'>";
ECHO " ".LG('Файл просмотрели из пользователей').":";
ECHO "</div>";
}
$data = DB::GET_STRING_ALL("SELECT * FROM `FILES_EYE_USERS` WHERE `FILE_ID` = '".$files['ID']."' ORDER BY `TIME` DESC LIMIT ".$limit.", ".$page_settings."");
WHILE ($list = $data->FETCH()){
ECHO "<div class='list-menu'>";
USER::LOGIN($list['USER_ID'], 1, 1);
ECHO "<span class='time'>- ".FTIME($list['TIME'])."</span>";
ECHO "</div>";
}
IF ($column > 0){
ECHO "</div>";
}
IF ($spage > 1){ ECHO STR_PAGE('/modules/?path=files§ion=show&id='.$files['ID'].'&get=eye_users_list&', $spage, $page); }
ECHO "<a href='/modules/?path=files§ion=show&id=".$files['ID']."'><div class='list'>";
ECHO ICONS('arrow-left', 17, 'fa-fw')." ".LG('Назад');
ECHO "</div></a>";
//Навигация
ECHO "<div class='navigation'>";
ECHO "<a href='/'>".ICONS('home', 25, 'fa-fw')."</a>";
ECHO "".ICONS('angle-right', 20, 'fa-fw')."";
ECHO "<a href='/id".$account['ID']."'>".$account['LOGIN']."</a>";
ECHO "".ICONS('angle-right', 20, 'fa-fw')."";
ECHO $nav;
ECHO "</div>";
REQUIRE (ROOT.'/system/connections/footer.php');
EXIT;
}
?>