Файл: list.php
Строк: 68
<?php
error_reporting(0);
$sid=trim($_GET["sid"]);
$k=trim($_GET['k']); include("key.php");
$d=rawurldecode(trim($_GET['d'])); $n=rawurldecode(trim($_GET['n']));
if ($d==NULL) {$d="";} else {if ($d=="/") {$d="";}}
if ($n==NULL) {$n=preg_replace("~.*/([^/]*)~m","\1",$d);
$d=preg_replace("~(.*)/[^/]*~m","\1",$d);}
$rd=rawurlencode($d); $rn=rawurlencode($n);
$d=str_replace('$','$$',$d); $n=str_replace('$','$$',$n);
$d=str_replace(".|htaccess",".htaccess",$d);
$n=str_replace(".|htaccess",".htaccess",$n);
$fls=@file("data/$k.act"); $links="";
if ($fls<>NULL) {$bln=true;
$p=trim($_GET['p']); $cnt=count($fls); $v=20; $allp=ceil($cnt/$v);
if (($p==NULL)||($p==0)) {$p=1;} elseif ($p>$allp) {$p=$allp;}
$begin=$p*$v-$v; if ($begin>$cnt) {$begin=0;}
$end=$begin+$v; if ($end>$cnt) {$end=$cnt;}
for ($i=$begin;$i<$end;$i++) {
list($p1,$p2,$p3)=split('[|]',$fls[$i]);
$p1=trim($p1); $p2=trim($p2); $p3=trim($p3);
if ($p3=="copy") {$act=" [es]";}
elseif ($p3=="cut") {$act=" [ez]";}
elseif ($p3=="arh") {$act=" [ZIP]";}
elseif ($p3=="at1") {$act=" [TAR]";}
elseif ($p3=="at2") {$act=" [TGZ]";}
elseif ($p3=="at3") {$act=" [TGZ2]";}
elseif ($p3=="at4") {$act=" [TBZ]";}
elseif ($p3=="at5") {$act=" [TBZ2]";} else {$act="";}
$links.="<a href="actn.php?k=$k&d=$rd&n=$rn&ac=rm&lnm=".str_replace(".htaccess",".|htaccess",$p1)."&go=1">[X]</a> $p1$act<br/>rn";
} $bl="";
if ($p>1) {$v=$p-1; $bl.="<a style="color:red" href="list.php?k=$k&d=$rd&n=$rn&p=$v"><b><<</b></a>|";} elseif ($allp>$p) {$bl.="<<|";}
if ($allp>$p) {$v=$p+1; $bl.="<a style="color:red" href="list.php?k=$k&d=$rd&n=$rn&p=$v"><b>>></b></a><br/>rn";} elseif ($p>1) {$bl.=">><br/>rn";}
if ($bl<>NULL) {$bl.="...";}
} else {$bln=false; $links="empty...<br/>";}
$title="View file lists";
include("inc/head.php");
echo ('<div class="gmenu" align="left"><a href="ftp.php?k='.$k.'&d='.$rd.'&n='.$rn.'">'.$d.'/</a><a href="file.php?k='.$k.'&d='.$rd.'&n='.$rn.'">'.$n.'</a></div>');
echo("<div class="bmenu"><b>$title</b></div>");
echo("<div class="menu">
<br/>$links<br/>$bl");
if ($bln) {echo("<a href="listex.php?k=$k&d=$rd&n=$rn">paste in this folder</a><br/>
<a href="actn.php?k=$k&d=$rd&n=$rn&ac=rmall&go=1">clear list</a><br/>");}
echo("<div class="ads">");
include("buzz.php");
echo "<br/></div></div>";
include("inc/foot.php");
?>