|
| |
 |
ÔÎÒÎ
|
 |
";
include($filename);
print"";
}
}
///// for album description
function album($filename) {
$is_captioned = check_perms($filename);
if ($is_captioned) {
print"";
include($filename);
print" ";
}
}
////check file permission
function check_perms($filename) {
if (! file_exists($filename)) return false;
$fileperms = fileperms($filename);
$isreadable = $fileperms & 4;
if ( is_file($filename) ) {
// pictures, thumbnails, config files and comments only need to be readable
if (! $isreadable) {
if (MODE_WARNING) print "$filename: wrong permission ";
}
return $isreadable;
}
else if ( is_dir($filename) ) {
// galleries need to be both readable and executable
$isexecutable = $fileperms & 1;
if (! $isreadable || ! $isexecutable)
if (MODE_WARNING) print "$filename: wrong permission ";
return ( $isreadable && $isexecutable); // ($dirperms & 5) == 5 ?
}
// default behavior: the filename does not exist
return false;
}
$dh = opendir($dir);
while($file = readdir($dh))
{
if ($file != "." && $file != ".." && is_dir($file))
{$dname[] = $file;
sort($dname);
reset ($dname);
}
}
print "";
print "";
///print album description
$album_name = "$imgdir/album.txt";
album($album_name);
print "\n";
// start page
if($page=="" || $page==1)
{
$x=0;
$page = 1;
}
else
$x = (($page-1)*($totxpage));
$r=0;
// print of table
foreach($a_img as $key=>$val)
{
$caption_name = "$imgdir/$a_img[$x].txt";
if(($x%$col)==0)
print "\n";
if($a_img[$x])
{
$size = getimagesize ("$imgdir/$a_img[$x]");
$halfw = round($size[0]/2);
$halfh = round($size[1]/2);
$quarterw = round($size[0]/4);
$quarterh = round($size[1]/4);
if($size[1] < $size[0])
{
$height = 86;
$width = 130;
$imgnumber = ($x+1);
if("$imgdir/$a_img[$x]" !="")
if ($thumb){
$thumbnail = "thumbs.php?image=$imgdir/$a_img[$x]&newheight=86&newwidth=130&width=$size[0]&height=$size[1]";
}
else
{
$thumbnail = "$imgdir/$a_img[$x]";
}
print "| ";
print "";
print " | \n";
}
else
{ $height = 130;
$width = 86;
if ($thumb){
$thumbnail = "thumbs.php?image=$imgdir/$a_img[$x]&newheight=130&newwidth=86&width=$size[0]&height=$size[1]";
}
else
{
$thumbnail = "$imgdir/$a_img[$x]";
}
$imgnumber = ($x+1);
if("$imgdir/$a_img[$x]" !="")
print "";
print "";
print " | ";
pr | | |