View file panel/logadmin.php

File size: 3.57Kb
<?php
// mod by Golem http://veplog.ru

require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";

$config_loglist=10; //Логов на страницу

if ($provlog==$_SESSION['log'] && $provpar==md5($_SESSION['par']) && $_SESSION['log']!="" && md5($_SESSION['par'])!="") {
if ($dostup==101 || $dostup==102){

echo'<div class="tp">Админ-логи</div><div class="forum">';

//-------------------------------- ОЧИСТКА ЛОГОВ ------------------------------------//
if($action=="del"){
if ($dostup==101){
clear_files("../local/datalog/admin.dat");

header ("Location: logadmin.php?isset=mp_dellogs&".SID);
}}


//-------------------------------- ГЛАВНАЯ СТРАНИЦА ------------------------------------//
if(!isset($action)){


$opis=file("../local/datalog/admin.dat");
$opis = array_reverse($opis);
$total=count($opis);

if($total<1){echo '<img src="../images/img/reload.gif" alt=""> <b>Ошибок нет!</b><br><br>';}

if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + $config_loglist){ $end = $total; }
else {$end = $start + $config_loglist; }
for ($i = $start; $i < $end; $i++){

$dtlog=explode("|", $opis[$i]);
$dtlog[4]=str_replace("&amp;","&",$dtlog[4]);
$dtlog[5]=str_replace("&amp;","&",$dtlog[5]);

echo '<div class="r0"><a href="../pages/anketa.php?uz='.$dtlog[3].'&amp;'.SID.'"> '.nickname($dtlog[3]).' </a>';
echo ' ('.date("d.m.Y / H:i",$dtlog[6]).')<br>';
echo 'Страница: '.$dtlog[4].'<br>';
echo 'Откуда: '.$dtlog[5].'<br>';
echo '<font color="#CC00CC">('.$dtlog[1].','.$dtlog[2].')</font></div>';

}
echo'</div>';
if ($start != 0) {echo '<a href="logadmin.php?start='.($start - $config_loglist).'&amp;list='.$list.'&amp;'.SID.'">&lt;пред. </a> ';}else{echo'&lt;пред. ';}
echo'|';
if ($total > $start + $config_loglist) {echo ' <a href="logadmin.php?start='.($start + $config_loglist).'&amp;list='.$list.'&amp;'.SID.'"> след.&gt;</a>';}else{echo' след.&gt;';}


if($total>0){

$ba=ceil($total/$config_loglist);
$ba2=$ba*$config_loglist-$config_loglist;

echo '<br>Стр.:';
$asd=$start-($config_loglist*3);
$asd2=$start+($config_loglist*4);

if($asd<$total && $asd>0){echo ' <a href="logadmin.php?start=0&amp;list='.$list.'&amp;'.SID.'">1</a> ... ';}

for($i=$asd; $i<$asd2;)
{
if($i<$total && $i>=0){
$ii=floor(1+$i/$config_loglist);

if ($start==$i) {
echo ' <b>('.$ii.')</b>';

}else {

echo ' <a href="logadmin.php?start='.$i.'&amp;list='.$list.'&amp;'.SID.'">'.$ii.'</a>';
}}


$i=$i+$config_loglist;}
if($asd2<$total){echo ' ... <a href="logadmin.php?start='.$ba2.'&amp;list='.$list.'&amp;'.SID.'">'.$ba.'</a>';}
}

if ($dostup==101){
echo '<div class="btm">[<a href="logadmin.php?action=del&amp;'.SID.'">Очистить логи</a>]<br>';
}
}

//-------------------------------- КОНЦОВКА ------------------------------------//
echo'[<a href="index2.php?'.SID.'">В админку</a>]<br>';
echo'[<a href="../index.php?'.SID.'">На главную</a>]</div>';

} else {header ("Location: ../index.php?isset=404&".SID);}
} else {header ("Location: ../index.php?isset=404&".SID);}

include_once"../themes/$config_themes/foot.php";
?>