if (!isset($_GET['dir'])) {
?>
Photos
$dir = opendir("$rep_photos");
$dirlist=array();
while ($name = readdir($dir)) {
if (is_dir("$rep_photos/$name") && ($name!=".") && ($name!="..")) {
$parm="$rep_photos/$name/params.inc";
if (file_exists($parm)) {
array_push($dirlist, $name);
}
}
}
closedir($dir);
sort($dirlist);
$dirlist = array_reverse($dirlist);
reset($dirlist);
for ($i=0; $i";
if (($i%$nb_w_main)==0) echo "";
?>
echo "$title $cell"; ?> |
if ((($i+1)%$nb_w_main)==0) echo " ";
}
?>
}
else {
//$sub_rep=$_GET['dir'];
$sub_rep=preg_quote(htmlentities(addslashes($_GET['dir'])));
if (isset($_GET['start']))
$start=$_GET['start'];
else
$start=0;
if (is_dir($rep_photos."/".$sub_rep)) {
$dir = opendir("$rep_photos/$sub_rep");
include_once("$rep_photos/$sub_rep/params.inc");
$filelist=array();
while ($file=readdir($dir))
if ((eregi(".jpg", $file)) || (eregi(".avi", $file)) || (eregi(".mov", $file)))
array_push($filelist, $file);
closedir($dir);
sort($filelist); reset($filelist);
?>
if ($start>=count($filelist)-1) {
$counter=count($filelist)." (".count($filelist).")";
}
else {
$counter=($start+1)."-".(min($start+$nb_w*$nb_h, count($filelist)))." (".count($filelist).")";
}
?>
echo $title; ?>
echo $counter; ?>
}
for ($cpt=0,$i=max(0,$start); ($i";
//echo "\n";
//echo " | ";
$thumb=str_replace(".AVI", ".JPG", $filelist[$i]);
$thumb=str_replace(".avi", ".jpg", $thumb);
$thumb=str_replace(".MOV", ".JPG", $thumb);
$thumb=str_replace(".mov", ".jpg", $thumb);
echo "\n
| ";
if ((($cpt+1)%$nb_w)==0) echo "\n";
}
?>
// Navigation
$derniere_page=count($filelist)/($nb_w*$nb_h);
if ((count($filelist) % ($nb_w*$nb_h)) != 0) $derniere_page++;
echo "Pages : ";
for ($page=1; $page<=$derniere_page; $page++) {
if (max(0,$start) != (($page-1)*$nb_w*$nb_h)) {
$link=1; $ft=""; $ft_end="";
}
else {
$ft="";
$ft_end="";
$link=0;
}
if ($link) echo "";
echo " $ft".$page."$ft_end ";
if ($link) echo "";
}
echo " (retour)";
echo "";
?>
}
?>
|