<?
include_once("mysql.php");
include 'inclydings/sesi.php';
Error_Reporting(E_ALL);
include_once("inclydings/antixak.php");
include 'inclydings/ini.php';
$_title = '::LinEagE2::';
include 'inclydings/header.php';
$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
$go = htmlspecialchars(stripslashes($go));
$text = @file("L2dbnam/esql2db/reg/$log.dat");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
if (isset($user)) {
include_once("inclydings/udata.php");
$col="10";
$mmm=$col;
if(empty($go)){$go="1";}
$dir=opendir("L2dbnam/esql2db/clan/");
$n = "0";
while(($k=readdir($dir))!==false){
if ($k=='.'||$k=='..'||$k=='name'||$k=='tmp'||$k=='bank'||$k=='blocksklad'||$k=='chat'||$k=='clanholl'||$k=='coin'||$k=='desk'||$k=='kazna'||$k=='kaznacoin'||$k=='kaznagold'||$k=='logs'||$k=='logscoin'||$k=='logsgold'||$k=='site'||$k=='sklad'||$k=='status'||$k=='zahvat'||$k=='zam'||$k=='gold') continue;
$n++;
}
closedir($dir);
$num=($n/$col);
if ($num!==(int)$num){$foo = (int) $num;
$fo = ($foo + 1);}   else  {$fo=$num;}
for ($i="1"; $i<=$fo; $i++)
if ($go == "") {$c="0";}   else     {$c=($col*($go-1));}
$dir = opendir ("L2dbnam/esql2db/clan");
while ($file = readdir ($dir))
{
if (( $file != ".") && ($file != "..") && ($file != "name") && ($file != "tmp") && ($file != "sklad") && ($file != "zahvat") && ($file != "chat") && ($file != "desk") && ($file != "logs") && ($file != "bank"))
{ $file= str_replace(".dat","",$file);
$file2= "$file";
$text = @file("L2dbnam/esql2db/clan/$file2.dat");
$udat = explode(":||:",$text[0]);
$name=trim($udat[1]);
$la = $la + 1;
if($go=="1"){$col=round($mmm+1);}
if($la>$c-1 and $la<$c+$col){
if ($mode == "1"){$ee = strtr($e1,$tran);}else{$ee = $e1;}
$laa = $la + 1;
$file=@file("L2dbnam/esql2db/clan/name/$file2.dat");
$total=count($file);
echo "$la. Клан: <b>$name</b><br/>
Глава: <b>$file2</b><br/>
В клане <b>$total</b> человек<br/><br/>";
}}
}
closedir ($dir);
if ($go == "") {$c="0";}   else{$c=($col*($go-1));}
$lis = $go + 1;
$lis1 = $go - 1;
echo"<br/>";
if ($lis1 < "1") {} else{print "<a href=\"clanlist.php?go=$lis1&$sd\">Назад</a> | ";}
if ($lis == "$i")  {} else { print "<a href=\"clanlist.php?go=$lis&$sd\">Вперед</a>";}
//</anchor></small><br/>";
echo"<br/><br/>Кланов всего: $n";
}else{echo"Пароль или ник неверен.Возможно сессия устарела.Попробуйте авторизироваться заново...";}
include_once"inclydings/down.php";
?>