Файл: enterklan.php
Строк: 95
<?
include_once("mysql.php");
include_once("include/antixak.php");
include_once("include/zag.php");
include_once("include/ini.php");
include 'include/sesi.php';
if (isset($user)) {
switch($go) {
default:
echo"<b>Общая комната Кланов</b><br/>";
if(@file("local/enterklan/$num.dat")){
$file = @file("local/enterklan/$nam.dat");
$total = count($file);
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + 5){ $end = $total; }
else {$end = $start + 5; }
for ($i = $start; $i < $end; $i++){
$file = @file("local/enterklan/$nam.dat");
$file = array_reverse($file);
$data = explode("|",$file[$i]);
$i2=round($i+1);
$id=$total-$i-1;
$data[1]=trim($data[1]);
$data[2]=trim($data[2]);
$elita=mysql_query("SELECT * FROM `table_admin` WHERE `nick`='$data[1]' LIMIT 1");
if(mysql_num_rows($elita)==1){
echo"<a href="search.php?$sd&nick=$data[1]&go=go"><font color=lime>$data[1]</font></a>[A]($data[3]) - $data[2]<br/>";}else{
$elita=mysql_query("SELECT * FROM `table_moder` WHERE `nick`='$data[1]' LIMIT 1");
if(mysql_num_rows($elita)==1){
echo"<a href="search.php?$sd&nick=$data[1]&go=go"><font color=#00FFFF>$data[1]</font></a>[M]($data[3]) - $data[2]<br/>";}else{
if(@file("MySql/base123/rating/olimpiads/$data[1].dat")){
echo"<a href="search.php?$sd&nick=$data[1]&go=go"><font color=#C71585>$data[1]</font></a>($data[3]) - $data[2]<br/>";}else{
echo"<a href="search.php?$sd&nick=$data[1]&go=go">$data[1]</a>($data[3]) - $data[2]<br/>";}}}
}
if($total=="0"){echo"Сообщений нет.</small>";}
}else{echo"Сообщений нет.</small>";}
if ($start != 0) {echo '<a href="enterklan.php?start='.($start - 5).'&'.$sd.'&go=list&nam='.$nam.'">Назад</a> ';}
if ($total > $start + 5) {echo ' <a href="enterklan.php?start='.($start + 5).'&'.$sd.'&go=list&nam='.$num.'">Далее</a>';}
echo"<br/><a href="enterklan.php?$sd&go=add&nam=$nam">Подать заявку</a>";
break;
case 'komentadd':
if(empty($msg)){echo"<b>Не введено сообщение.</b><br/><a href="enterklan.php?$sd&nam=$nam">Назад</a>"; include 'include/down.php'; exit;}
$elita=mysql_query("SELECT * FROM `table_admin` WHERE `nick`='$log' LIMIT 1");
if(mysql_num_rows($elita)==1){
$msg="<font color=red>$msg</font>";}
$text='|'.$log.'|'.$msg.'|'.date("H:i:s").'';
$fp=fopen("local/enterklan/$nam.dat","a+");
flock ($fp,LOCK_EX);
fputs($fp,"$textrn");
flock ($fp,LOCK_UN);
fclose($fp);
echo"Сообщение отправлено!
<br/><a href="enterklan.php?$sd&nam=$nam">Назад</a>";
break;
case 'add':
echo"Добавить сообщение<br/>";
echo'<form method="post" action="enterklan.php?'.$sd.'&go=komentadd&nam='.$nam.'">';
echo "<input name="msg" maxlength="200" title="name"/><br/>";
echo '<input class="button" type="submit" value="Добавить"/></form>';
break;
}}else{echo"<small>Пароль или логин неверен!</small>";}
include 'include/down.php';
?>