1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| <?php
$curdir = @$_GET["dir"];
if(!$curdir) $curdir = ".";
?>
<table align="right" dir="rtl" border="0">
<?php
echo "<tr><td>";
echo "".$curdir."<br><br>\n";
echo "</td></tr>";
$dir = opendir($curdir);
while($p=readdir($dir)) {
if(is_dir($curdir."/".$p)&&($p!=".")) {
if($p=="..") {
if($curdir!=".") {
$tmp = strrpos($curdir,"/"); ?>
<tr><td align="center">
<?php
echo "<a href='?frame=menu&dir=".substr($curdir,0,$tmp)."'
target=menu>Retour</a></td></tr>";
}
} else {
echo "<tr><td><a href='?frame=menu&dir=".$curdir."/".$p."' target=menu>".$p."</a>";
} ?>
</td></tr>
<?php
}
}
closedir($dir);
$dir = opendir($curdir);
while($p=readdir($dir)) {
if(is_file($curdir."/".$p)) {
$ext = strtolower(substr($p, strrpos($p, '.') + 1));
if( ($ext=="jpg") || ($ext=="jpeg")
|| ($ext=="gif")
|| ($ext=="bmp")
|| ($ext=="png")) { ?>
<td align="center" width="200px">
<?php
$pos_point = strpos($p, '.');
$titre = substr($p, 0, $pos_point);
echo $titre;
echo "<br>";
?>
<a href="<?php echo $curdir."/".$p ?>" target='_blank'><img src="<?php echo $curdir."/".$p ?>" width="100px" height="100px" /></a>
</td>
<?php
}
}
} ?> </tr> </table>
<?php
closedir($dir);
?> |
Partager