Просмотр файла pages/nag.php

Размер файла: 4.7Kb
<?php
	
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=b><img src="../../images/img/akcias2.png" alt=""> <b>У кого какой орден:</b></div><br><br>';

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

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

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[36]>=500){

$dat_user[]=$data[0];
$dat_kol[]=$data[36];
$dat_nag[]=$data[85];

}

}


asort($dat_kol);	

foreach($dat_kol as $k=>$v){
$admin_top[]='|'.$dat_user[$k].'|'.$dat_kol[$k].'|'.$dat_nag[$k].'|';	
}
	
$admin_top=implode("\r\n",$admin_top);

if($admin_top!=""){
$fp = fopen(BASEDIR."local/datatmp/nag.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/nag.dat", 0666); 	
}
}



//------------------------------ ВЫВОД ИЗ КЕША ------------------------------//	
$userfile=file(BASEDIR."local/datatmp/nag.dat");
$total=count($userfile);
if($userfile==""){echo 'Нет медалистов=(';}else{
foreach($userfile as $key=>$value){

$userdata = explode("|",$value);
$tex2 = file(BASEDIR."local/profil/$userdata[1].prof");
$data2 = explode(":||:",$tex2[0]);
if($data2[36]>=0){$nag='Не заслужил!';}
if($data2[36]>=5){$nag='<img src="../images/nagrads/5.gif" alt="+">';}
if($data2[36]>=10){$nag='<img src="../images/nagrads/10.gif" alt="+">';}
if($data2[36]>=15){$nag='<img src="../images/nagrads/15.gif" alt="+">';}

if($data2[36]>=25){$nag='<img src="../images/nagrads/25.gif" alt="+">';}
if($data2[36]>=40){$nag='<img src="../images/nagrads/40.gif" alt="+">';}
if($data2[36]>=50){$nag='<img src="../images/nagrads/50.gif" alt="+">';}

if($data2[36]>=80){$nag='<img src="../images/nagrads/80.gif" alt="+">';}
if($data2[36]>=90){$nag='<img src="../images/nagrads/90.gif" alt="+">';}
if($data2[36]>=120){$nag='<img src="../images/nagrads/120.gif" alt="+">';}

if($data2[36]>=150){$nag='<img src="../images/nagrads/150.gif" alt="+">';}
if($data2[36]>=200){$nag='<img src="../images/nagrads/200.gif" alt="+">';}
if($data2[36]>=250){$nag='<img src="../images/nagrads/250.gif" alt="+">';}

if($data2[36]>=300){$nag='<img src="../images/nagrads/300.gif" alt="+">';}
if($data2[36]>=400){$nag='<img src="../images/nagrads/400.gif" alt="+">';}
if($data2[36]>=450){$nag='<img src="../images/nagrads/450.gif" alt="+">';}

if($data2[36]>=550){$nag='<img src="../images/nagrads/550.gif" alt="+">';}
if($data2[36]>=650){$nag='<img src="../images/nagrads/650.gif" alt="+">';}
if($data2[36]>=780){$nag='<img src="../images/nagrads/780.gif" alt="+">';}

if($data2[36]>=850){$nag='<img src="../images/nagrads/850.gif" alt="+">';}
if($data2[36]>=1000){$nag='<img src="../images/nagrads/1000.gif" alt="+">';}
if($data2[36]>=2000){$nag='<img src="../images/nagrads/2000.gif" alt="+">';}

if($data2[36]>=3500){$nag='<img src="../images/nagrads/3500.gif" alt="+">';}
if($data2[36]>=5000){$nag='<img src="../images/nagrads/5000.gif" alt="+">';}
if($data2[36]>=6000){$nag='<img src="../images/nagrads/6000.gif" alt="+">';}

if($data2[36]>=7000){$nag='<img src="../images/nagrads/7000.gif" alt="+">';}
if($data2[36]>=8500){$nag='<img src="../images/nagrads/8500.gif" alt="+">';}
if($data2[36]>=10000){$nag='<img src="../images/nagrads/10000.gif" alt="+">';}

if($data2[36]>=15000){$nag='<img src="../images/nagrads/15000.gif" alt="+">';}
if($data2[36]>=20000){$nag='<img src="../images/nagrads/20000.gif" alt="+">';}

if($data2[85]==1){$nag2=' <img src="../images/nagrads/slow.png" alt="+++">';}
else{$icq_admin ="";}
echo '<img src="../images/img/chat.gif" alt=""> '.($key+1).'. <b><a href="../pages/anketa.php?uz='.$userdata[1].'&amp;'.SID.'">'.nickname($userdata[1]).'</a></b>'.user_online($userdata[1]).'  '.$nag.' '.$nag2.'<br>';	
}

echo '<hr>Всего <b>'.(int)$total.'</b> чел. в медалистах....<br>';

}

echo'<hr><img src="../images/img/homepage.gif" alt=""> <a href="../index.php?'.SID.'">На главную</a><br>';

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