1) $ts=$tsize; if($ts) return 'album'; else return 'thumb'; } /** Determines whether $fname is the name an image file. * If so, it return its MIME type. */ function image_mime($fname) { $exts=array( '%/[^.][^/]*[.]jpe?g$%i'=>'image/jpeg', '%/[^.][^/]*[.]png$%i'=>'image/png', '%/[^.][^/]*[.]gif$%i'=>'image/gif' ); foreach($exts as $patt => $mime) { if( preg_match($patt,$fname) && is_file($fname) && is_readable($fname) ) return $mime; } return FALSE; } function hsc($s) { return htmlspecialchars($s); } $admin_message_text=''; function admin_message($msg) { global $admin_message_text; $admin_message_text.='
|
|
current_album_title() ?> |
%s';
else
$a='%s';
printf($a,' |
'.nice($imagefiles[$i]->name).'' .'%s ') .$imagefiles[$i]->numcomments('%s ')." | \n ";
}
echo implode("
Comments
'."\n"; foreach($comments as $c) { global $options; echo ''.$c->text."
\n"; echo 'posted by '.$c->author .' on '.date($options->date_format,$c->time); if($is_admin) echo ' delete'; echo '
Comments
'."\n"; } // Record the time at which the form was generated. Only permit // comments to be submitted within a short time, in order to stop spam. $timestamp=time(); $checksum=md5($options->secret.strval($timestamp)); ?>Leave a Comment
\n"; } function doc_carousel(&$imagefiles) { global $dirs,$img,$options; $len=count($imagefiles); $pos=intval($_POST['pos']); $carousel_size=min($len,6); // Number of images in the carousel. if(array_key_exists('pos',$_POST)) { // Scroll the carousel around with the image. if($pos==$img) $pos=$img-1; else if(normalize($pos+$carousel_size-1,$len) == $img) $pos=$img+2-$carousel_size; } else { // Centre the image in the carousel... $pos=$img-intval(($carousel_size-0.5)/2); // ...but start at the beginning, end at the end. if($pos+$carousel_size-1 >= $len) $pos=$len-$carousel_size; else if($pos < 0) $pos=0; } $pos=normalize($pos,$len); $title=nice($imagefiles[$img]->name); $album=$dirs->current_album_title(); ?>'.$imagefiles[$img]->exif."
\n"; if(intval($options->comments)) div_comments($imagefiles[$img]); ?>'.count($album->imagefiles ).' images
'; if(!$is_here && count($album->directories)) echo ''.count($album->directories).' albums
'; ?>'.nice($directories[$i]).'
'); ?>text.$loff ?>
posted by author ?> on date_format,$c->time).$loff ?>
Latest Comments
path() ?>
'+txt+'
posted by ' +author+' on '+date+'
'; return div; } /** Pop up an alert dialogue, if the album XML contains an