View file pages/adminlist.php

File size: 4.13Kb
<?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";

##########################################################################
##                         Главная страница
##########################################################################

echo '<div class=tp>Администрация сайта</div>';

$filtime=filemtime(BASEDIR."local/datatmp/adminlist.dat");
$userfile=file(BASEDIR."local/datatmp/adminlist.dat");

$filtime=$filtime+(3600*$config_adminlistcache);

if($sitetime>$filtime){

foreach (glob(BASEDIR."local/profil/*.prof") as $filename) {
$array_allusers[] = basename($filename);
}

foreach($array_allusers as $value){

$tex = file(BASEDIR."local/profil/$value");
$data = explode(":||:",$tex[0]);
if($data[7]>=101 && $data[7]<=105){

$dat_user[]=$data[0];
$dat_status[]=$data[7];
}

}


asort($dat_status);

foreach($dat_status as $k=>$v){
$admin_top[]='|'.$dat_user[$k].'|'.$dat_status[$k].'|';
}

$admin_top=implode("\r\n",$admin_top);
if($admin_top!=""){
$fp = fopen(BASEDIR."local/datatmp/adminlist.dat","a+");
flock ($fp,LOCK_EX);
ftruncate ($fp,0);
fputs($fp,"$admin_top\r\n");
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);
@chmod ($fp, 0666);
@chmod (BASEDIR."local/datatmp/adminlist.dat", 0666);
}
}



//------------------------------ ВЫВОД ИЗ КЕША ------------------------------//
$userfile=file(BASEDIR."local/datatmp/adminlist.dat");
$total=count($userfile);
foreach($userfile as $key=>$value){

$userdata = explode("|",$value);

echo'<div class=forum><div class=r0>';
echo ''.($key+1).'. <b><a href="../pages/anketa.php?uz='.$userdata[1].'&amp;'.SID.'">'.nickname($userdata[1]).'</a></b>  ['.user_status($userdata[2]).'] '.user_online($userdata[1]).'</div></div>';
}

echo '<div class="panel">Всего <b>'.(int)$total.'</b> чел. в администрации</div>';


//---------------------------------  Быстрая почта ----------------------------------//
if ($provlog==$_SESSION['log'] && $provpar==md5($_SESSION['par']) && $_SESSION['log']!="" && md5($_SESSION['par'])!=""){


echo'<div class=tpanel><b>Быстрая почта</b></div><div class=body>';

if($config_themes!=="wml"){
echo'<form method="post" action="addpriv.php?'.SID.'">';


echo 'Выберите адресат:<br><select name="uz">';

foreach($userfile as $value){
$userdata = explode("|",$value);

if($log!=$userdata[1]){
echo '<option value="'.$userdata[1].'"> '.$userdata[1].' </option>';
}}

echo '</select><br>';
echo'Текст:<br>';
echo'<textarea cols="20" rows="3" name="mess"></textarea><br>';

if($config_translit=="1"){
echo'<input name="trans" type="checkbox" value="y" />Транслит<br>';
}

echo'<input value="Отправить" name="do" type="submit" /></form></div>';

}else{

echo 'Выберите адресат:<br><select name="uz">';

foreach($userfile as $value){
$userdata = explode("|",$value);

if($log!=$userdata[1]){
echo '<option value="'.$userdata[1].'"> '.$userdata[1].' </option>';
}}

echo '</select><br>';


echo'Текст:<br>';
echo'<input name="mess"/><br>';

if($config_translit=="1"){
echo'Транслит: <select name="trans"><option value="0">Нет</option>';
echo'<option value="y">Да</option>';
echo'</select><br>';
}

echo'<anchor>Отправить';
echo'<go href="addpriv.php?'.SID.'" method="post">';
echo'<postfield name="trans" value="$(trans)"/>';
echo'<postfield name="uz" value="$(uz)"/>';
echo'<postfield name="mess" value="$(mess)"/>';
echo'</go></anchor><br>--------------------<br>';
}
}

echo'<div class=btm>[<a href="../index.php?'.SID.'">На главную</a>]</div>';

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