";
print "
";
if ( isset($_REQUEST[ 'nomedir' ]) == "" ) {
$realpath = $gallery_path;
} else {
$realpath = $_REQUEST[ 'nomedir' ];
$realpath = str_replace( "/mnt/nas12/nas2", "/home/sites/regalamiunsorriso/www", $realpath );
}
if ( stristr( "$realpath", ".." )or!stristr( "$realpath", "$gallery_path" ) ) {
print( " INDIRIZZO NON TROVATO !!" );
exit;
}
$realpath = rawurldecode( $realpath );
$webpath = substr( $realpath, strlen( $www_home ) );
chdir( "$realpath" );
if ( $handle = opendir( '.' ) ) {
while ( false !== ( $entry = readdir( $handle ) ) ) {
if ( $entry != "." && $entry != ".." ) {
if ( is_dir( $entry ) ) {
$dirs[] = $entry;
} else {
if ( strtolower( substr( $entry, 0, 3 ) ) != $tn_prefix && ( strtolower( substr( $entry, -3 ) ) == "jpg" || strtolower( substr( $entry, -4 ) ) == "jpeg" ) ) {
$files[] = $entry;
}
}
}
}
closedir( $handle );
}
if ( count((array)$dirs ) != 0 ) {
sort( $dirs );
$index = 0;
print "
";
foreach ( $dirs as $dir ) {
print "";
if ( $dir[ 0 ] != '_' )
print " $dir | ";
$index++;
if ( $index % 4 == 0 ) {
echo "
";
}
}
print "
";
}
if ( count( (array)$files ) != 0 ) {
sort( $files );
$index = 0;
print "
";
if ( file_exists( $realpath . "/slideshow.px" ) ) {
print "";
print "" .
" ";
$index++;
}
foreach ( $files as $file ) {
$thumb = $webpath . "/" . $tn_prefix . "" . $file;
$rthumb = $realpath . "/" . $tn_prefix . "" . $file;
$picture = $webpath . "/" . $file;
print " | ";
if ( file_exists( $rthumb ) == false ) {
$thumb_notfound = true;
if ( $force_tn == true ) {
$thumb = $picture;
} else {
$thumb = $default_tn;
}
}
# list($wsize, $hsize, $imgtype, $imgattr) = getimagesize($file);
$picture_orig = $picture;
$picture = rawurlencode( $picture );
print "" .
" " .
" | ";
$index++;
if ( $index % 3 == 0 ) {
echo "
";
}
}
print "
";
}
?>