process_comment_form(); //START RENDERING $page->header("Photos"); require("inc/header.inc.php"); // folder > tree //print "
\n\n";}// end last year if this is // not the first one #This is a new year unset($thismonth); print ""; print $galeriename[$foldername]; print ""; } else { print " href=\"$ThisScript?galerie=$foldername\">$foldername"; } if (@$galeriedesc[$foldername]) { print "" . $galeriedesc[$foldername]; print "\n"; } if (@$galerieauthor[$foldername]) { print " \n"; } if (@$galerieday[$foldername]) { print ""; print "$monthname " . $galerieday[$foldername]; print "\n"; } print "
\n"; $thisyear=$year; $thismonth=$month; } if ($one_out) print ("\n";
$path = "$gallery_dir/$galerie/thumbs";
$imgfiles = new SortDir($path);
check($galerie); // check for nasty input
while ($file = $imgfiles->read()) {
if (is_file("$path/$file") && eregi("^img-([0-9]+)\.(png|jpe?g)", $file, $x)) {
$thumb = "$gallery_dir/$galerie/thumbs/img-${x[1]}.${x[2]}";
$imgsize = getimagesize("$root/$thumb");
//check for portraits
$portrait = "false";
$class = "";
if($imgsize[0]<100) {
//portraits need a special class for styling
$class = "portrait";
}
//check for number of comments per photo
if ($comments) { //there probably won't be user comments if it's off
$NumOfComments = 0;
if (file_exists("$gallery_dir/$galerie/comments/user_${x[1]}.txt")) {
if ($class) $class .= " ";
$class .= "hascomments";
//now let's count'em
$fh = fopen("$gallery_dir/$galerie/comments/user_${x[1]}.txt","r");
while (!feof($fh)) {
$line = fgets($fh);
if (eregi("commententry",$line)) $NumOfComments++;
}
fclose($fh);
}
if ($NumOfComments==1) {
$NumOfComments = $NumOfComments . " " . __('Comment');
} else {
$NumOfComments = $NumOfComments . " " . __('Comments');
}
}
if (file_exists("$gallery_dir/$galerie/comments/${x[1]}.txt") &&
$title = file_get_contents("$gallery_dir/$galerie/comments/${x[1]}.txt")) {
$title = ereg_replace("(\"|\')","",trim(strip_tags($title)));
$title = ereg_replace("(.{77}).*","\\1",$title);
} else
$title = "Photo ${x[1]}";
print " ";
print "";
print "\n";
}
}
print "
"; print ""; print $galeriedesc[$galerie] . "
\n"; } if ($galerieauthor[$galerie]) { print "Author: "; print ""; print $galerieauthor[$galerie] . "
\n"; } print "\n"; if (file_exists("$gallery_dir/$galerie/zip/mq.zip")) { print "[ " . __('zipped MQ images') . " ] "; } if (file_exists("$gallery_dir/$galerie/zip/mq.tar.bz2")) { print "[ " . __('MQ images tarball') . " ] "; } if (file_exists("$gallery_dir/$galerie/zip/hq.zip")) { print "[ " . __('zipped HQ images') . " ]"; } if (file_exists("$gallery_dir/$galerie/zip/hq.tar.bz2")) { print "[ " . __('HQ images tarball') . " ]"; } print "
"; ####################### # Individual Image # ####################### } else { //low-res image # finish off header print "\n > "; if ($galeriename[$galerie]) { print $galeriename[$galerie]; } else { print $galerie; } print "\n > Photo"; print " $snimek"; $path = "$gallery_dir/$galerie/thumbs"; $imgfiles = new SortDir("$path"); check($galerie); $path = "$gallery_dir/$galerie/lq"; $file = "$path/img-$snimek.jpg"; if (!file_exists($file)) { print __('No such image'); $page->footer(); exit; } if (!$picture) { //picture may have been created if commentform submitted require_once("$root/inc/photo.class.inc.php"); $picture = new C_photo($file, $snimek); } // mini thumbnail roll if ($show_thumbs) { print "\n\n