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

Размер файла: 6.38Kb
<?php
#================================================#
#   === Мод Награды для Wap-motor 19.x ===       #
#             Made by:  Shur1k                   #
#             Site:  WAP.ROVNO.UA                #
#             ICQ: 444307535                     #
#================================================#
require_once ("../includes/start.php");
require_once ("../includes/functions.php");
require_once ("../includes/header.php");
include_once ("../themes/".$config['themes']."/index.php");

if (isset($_GET['start'])) {$start = (int)$_GET['start'];} else {$start = 0;}
if (isset($_GET['uz'])) {$uz = check($_GET['uz']);} elseif (isset($_POST['uz'])) {$uz = check($_POST['uz']);} else {$uz = "";}

echo'<div class=e><b>Рейтинг медалистов</b></div><hr>';

############################################################################################
##                                     Запись в кэш                                       ##
##         Дальше ниже куча ненужного кода :) просто лень всё править                     ##
##                                                                                        ##
##                                                                                        ##
############################################################################################
$filtime = filemtime(DATADIR."datatmp/nag.dat");
$user_count = counter_string(DATADIR."datatmp/nag.dat");

$filtime=$filtime+(3600*$config['userlistcache']);

if (SITETIME>$filtime || $user_count<100){

$array_users = array();
$globusers = glob(DATADIR."profil/*.prof");
foreach ($globusers as $filename) {
$array_users[] = basename($filename);
}

if (count($array_users)>0){

$dat_komm = array();
$dat_chat = array();
$dat_vhod = array();
$dat_guest = array();
$dat_forum = array();
$dat_reg = array();
$dat_log = array();
$dat_ball = array();

foreach ($array_users as $userval){
$tex = file_get_contents(DATADIR."profil/$userval");
$data = explode(":||:",$tex);

$dat_komm[] = (int)$data[33];
$dat_chat[] = (int)$data[12];
$dat_vhod[] = (int)$data[11];
$dat_guest[] = (int)$data[9];
$dat_forum[] = (int)$data[8];
$dat_reg[] = (string)$data[6];
$dat_log[] = (string)$data[0];
$dat_ball[] = (int)$data[36];
}

arsort($dat_ball);
$dat_top = array();
$gg = 0;

foreach($dat_ball as $k=>$v){ $gg++;
$dat_top[] = '|'.$gg.'|'.$dat_log[$k].'|'.$dat_ball[$k].'|'.$dat_forum[$k].'|'.$dat_guest[$k].'|'.$dat_chat[$k].'|'.$dat_komm[$k].'|'.$dat_vhod[$k].'|'.$dat_reg[$k].'|';	
}

$text = implode("\r\n",$dat_top);

write_files(DATADIR."datatmp/nag.dat", "$text\r\n", 1, 0666);
}}

############################################################################################
##                                      Вывод из кэша                                     ##
############################################################################################
if (file_exists(DATADIR."datatmp/nag.dat")){
$file = file(DATADIR."datatmp/nag.dat");
$total = count($file);

if ($total>0){

if ($start < 0 || $start > $total){$start = 0;}
if ($total < $start + 15){ $end = $total; }
else {$end = $start + 15;}
for ($i = $start; $i < $end; $i++){
	
$data = explode("|",$file[$i]);




if($data[3]>=0){$nag='<img src="../images/nagrads/slow.png" alt="+++"> Награду незаслужил! ' ;}
if($data[3]>=5){$nag='<img src="../images/nagrads/5.gif" alt="+">';}
if($data[3]>=10){$nag='<img src="../images/nagrads/10.gif" alt="+">';}
if($data[3]>=15){$nag='<img src="../images/nagrads/15.gif" alt="+">';}

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

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

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

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

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

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

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

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

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


echo ' '.(int)$data[1].'. <img src="../images/img/chel.gif" alt="" /> ';
echo '<b><a href="../pages/anketa.php?uz='.$data[2].'&amp;'.SID.'">'.nickname($data[2]).'</a></b> '.user_online($data[2]).''.user_title($data[2]).' '.$nag.'<hr>';



}

page_jumpnavigation('nag.php?', 15, $start, $total);
page_strnavigation('nag.php?', 15, $start, $total);


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

} else {echo '<img src="../images/img/reload.gif" alt="image" /> <b>Медалистов еще нет!</b><br />';}
} else {echo '<img src="../images/img/reload.gif" alt="image" /> <b>Медалистов еще нет!</b><br />';}

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

include_once ("../themes/".$config['themes']."/foot.php");
?>