Hi,
The files I added to
http://www.zombietuesday.com/autogallery in the last few days include an upload form that you are welcome to use and modify (GPL3). This form includes fields for title and description. There is also a Modify page that can add titles etc retrospectively.
Currently the images are sorted alphabetically. If you want something more complex line 227 of AutoGallery.inc.php is where the sorting happens. The PHP sort command takes some arguments (
http://php.net/manual/en/function.sort.php), or you can replace it with something more imaginative...
The thumbnails are auto generated. AutoGallery takes tnwidth, tnheight, and quality arguments. This only happens the first time it is run. Feel free to delete the appropriate tn_ files if you have changed these args and they will regenerate.
At the moment AutoGallery does not include any functionality for listing galleries or presenting a thumbnail to represent the gallery. It as intended to present a single gallery relevant to a particular page, or a particular topic. Our Shared World DOES have a gallery list (and, incidentally, the crude AJAX display thingy I mentioned before). Feel free to do a "view source" of
http://www.oursharedworld.com/Media.html and mock my rush job. I will tidy it up and release it properly when I have more free time. It would also be a nice way of doing a flash scrolly gallery display if you don’t want the all-images-on-one-page approach of standard AutoGallery. The code for the gallery list snippet (which may not be compatible with an up-to-dte version of AutoGallery) is:
<?php
$result = "<gallerylist>\n";
if($basepath == '') {
$basepath = 'assets/galleries/';
}
if(substr($basepath, -1) != '/') {
$basepath .= '/';
}
$dir = opendir($basepath);
$output = '';
$filelist = array();
while($entry = readdir($dir)) {
if(!(($entry == '..')||($entry == '.')||(substr($entry, 0, 3) == 'tn_'))) {
array_push($filelist, $entry);
}
}
sort($filelist);
foreach($filelist as $entry) {
$result .= "<gallery>\n";
$result .= ' <name>' . $entry . "</name>\n";
$result .= ' <thumbnail>';
$subdir = opendir($basepath . $entry);
while($subentry = readdir($subdir)) {
if(substr($subentry, 0, 3) == 'tn_') {
$result .= $basepath . $entry . '/' . $subentry;
break;
}
}
$result .= "</thumbnail>\n";
$result .= "</gallery>\n";
}
return $result . "</gallerylist>";
?>
Don’t forget that the page this snippet is called from needs to have its content type set to XML (I spent ages trying to get JS to cope with it until I spotted the drop down under page settings...). As you can see, this will use the first tn_ it comes to as the gallery thumbnail. Again, change the sort line if you want something different.
Hope this helps. Like I say, I’ll do a more pro job of it later.
Ramsay