n/oldblog
Archived
1
0
Fork 0
This repository has been archived on 2024-02-13. You can view files and clone it, but cannot push or open issues or pull requests.
oldblog/modules/affdir.inc.php

36 lines
916 B
PHP
Raw Normal View History

2023-04-30 21:28:42 +02:00
<?php
function AffDir($dirname,$basename)
{
$i = 0;
$d = opendir($dirname);
while (false!==($file = readdir($d)))
if ($file[0] != ".")
$listfile[++$i] = $file;
$dirnametmp = substr($dirname, 0,(strlen($dirname))-1);
$chemin = explode($dirnametmp,"/");
$sup = $chemin[1];
if ($dirname != $basename)
echo "<a
href='$__SELF__?modulepage=affdir&dir=$sup&base=$basename'>[Niveau
sup&eacute;rieur]</a><br><br>";
if (count($listfile) <= 1)
echo "<b>Aucun fichier dans ce r&eacute;pertoire !</b><br>";
else
foreach($listfile as $file)
if (is_dir("$dirname$file"))
echo "<a
href='$__SELF__?modulepage=affdir&dir=$dirname$file/&base=$basename'>[$file]</a
><br>";
else
echo "<a
href='$__SELF__?modulepage=affdir&dir=$dirname&base=$basename&image=$dirname$fi
le&titre=$file'>$file</a><br>";
closedir($d);
}
AffDir($dir,$base);
?>