while ($entry = $d->read())
{
$x="."; $y=","; $tim = filemtime($entry); $time = date("d-m-y
H:i","$tim");
$swatch = date("B","$tim"); $delka_entry = strlen($entry);
$poc_m1z = "30" - "$delka_entry";
for($n=1;$n<=$poc_m1z;$n++){$m1z.=" ";}
$size_old = filesize($entry);$delka_size = strlen($size_old);
for($ns=0;$ns<=$delka_size;$ns++):
$spec="s_$ns";
${$spec} = substr($size_old,$ns,1);
endfor;
if($delka_size=="1"):
$siz="$s_0";
elseif($delka_size=="2"): $siz="$s_0$s_1";
elseif($delka_size=="3"): $siz="$s_0$s_1$s_2";
elseif($delka_size=="4"): $siz="$s_0$x$s_1$s_2$s_3";
elseif($delka_size=="5"): $siz="$s_0$s_1$x$s_2$s_3$s_4";
elseif($delka_size=="6"): $siz="$s_0$s_1$s_2$x$s_3$s_4$s_5";
elseif($delka_size=="7"): $siz="$s_0$y$s_1$s_2$s_3$x$s_4$s_5$s_6";
elseif($delka_size=="8"): $siz="$s_0$s_1$y$s_2$s_3$s_4$x$s_5$s_6$s_7";
endif;
$d_s = strlen($siz);$poc_m2z = "11" - "$d_s";
for($nz=1;$nz<=$poc_m2z;$nz++){;$m2z.=" ";}
if($entry=="." ||
$entry==".."):
elseif(ereg("\.", $entry)):
echo "<a href=\"http://temp.crudo.cz/$entry\">$entry</a>$m1z
$time $m2z $siz";
else:
echo "<a href=\"http://temp.crudo.cz/$entry\">$entry</a>$m1z
$time";
endif;
echo "\n";
unset($m1z,$m2z);
$tot= $tot + $size_old;
}
$delka_total=strlen($tot);
for($nt=0;$nt<=$delka_total;$nt++){
$spet="t_$nt";
${$spet} = substr($tot,$nt,1);
if($delka_total=="1"):
$total="$t_0";
elseif($delka_total=="2"): $total="$t_0$t_1";
elseif($delka_total=="3"): $total="$t_0$t_1$t_2";
elseif($delka_total=="4"): $total="$t_0$x$t_1$t_2$t_3";
elseif($delka_total=="5"): $total="$t_0$t_1$x$t_2$t_3$t_4";
elseif($delka_total=="6"): $total="$t_0$t_1$t_2$x$t_3$t_4$t_5";
elseif($delka_total=="7"): $total="$t_0$y$t_1$t_2$t_3$x$t_4$t_5$t_6";
elseif($delka_total=="8"): $total="$t_0$t_1$y$t_2$t_3$t_4$x$t_5$t_6$t_7";
endif;
}
$mtz="30" - $delka_total + 15;
echo "\n\ntotal size:";
for($nm=1;$nm<=$mtz;$nm++){ echo " ";}
echo "$total\n";
echo "</pre>";
$d->close();
?>