Use the class directly and pass an array of all geodata you want to the $geodata parameter of the constructor. The constructor doc has info how that array has to be setup.
Generally the plugin is setup so you can use it for any kind of geodata, e.g. it must not even use albums/images from Zenphoto itself.
The core of Zenphoto is class based. You basically have to loop through all albums recursively via the gallery class and then album class on each.
You could also get all album names from the database directly but you still need to create album objects and check on them as you otherwise will bypass publish status or protection which is inherited from parents.
Basics of the object model behind everything:
http://www.zenphoto.org/news/zenphotos-object-model-framework/
I have not found a function to grab all image filenames in subfolders from a parent folder.
I will rewrite the function getAlbumGeodata($album) { with (not finally, in progress)
[code]$All_SubAlbum_IDs = getAllSubAlbumIDs();
$images = array();
for ($i = 1; $i < count($All_SubAlbum_IDs); $i++) {
$result = query("SELECT filename FROM " . prefix('images') . " WHERE albumid = '" . $All_SubAlbum_IDs[$i]["id"] . "'");
while ($row = db_fetch_assoc($result)) {
array_push($images, $row["filename"]);
}
}[/code]
And than i can display the zpOpenStreetMap() in parent folders, i think. But for today is enough.
I have not found a function to grab all image filenames in subfolders from a parent folder.
Create an album object for an album and get its images via the appropiate method getImages() is the way to do that. Again you have to do this recursively for further levels by using the getAlbums() method of the album object.
Note that you your code does not check for the publish state of the images and getAllSubAlbumIDs() does not check for protection, publish state or if this is a user's album either. You have to use the objects and the related methods as well. Use the function getItemByID() to get an oject from those ids.
Again you should extend the plugin class either theme based or via an additional plugin and modify any method of the original class you need different.
I understood that differently. In a parent album, where there are only sub albums, getAlbums() will deliver the subalbums. In a parent album where there are only subalbums, getImages() = NULL. Everything always works only on the current album. There is no function getImages('any-album'), but only getImages('current-album').
Create an album object for an album
How does it work?
How does the getAlbumGeodata() function check whether the images are published or locked?
http://docs.zenphoto.org/source-function-getAlbumGeodata.html#278-295
getImages() is not in the documentation.
An album can have both images and sub albums.
I understood that differently. In a parent album, where there are only sub albums, getAlbums() will deliver the subalbums. In a parent album where there are only subalbums, getImages() = NULL. Everything always works only on the current album.
Yes, but I am not talking about the standard template functions that are procedural.
There is no function getImages('any-album'), but only getImages('current-album').
No, you have to use the object model for that which then provides methods to do that.
Please don't confuse procedural general template functions with class methods. There are sometimes similar named in both.
The article I linked above explains how the object model works with examples. If object orientation in general is new to you please see here:
http://php.net/manual/en/language.oop5.php
How does the getAlbumGeodata() function check whether the images are published or locked?
It doesn't itself. Basically the functions/class methods who deliver the data do that and only deliver what is allowed.
No, because it does not work that way. You cannot use class methods directy…
This should work:
Create an image object of image.jpg in album album;
$albobj = newAlbum('album');
$imgobj = newImage($albobj, 'image.jpg');
$geodata= array(
array(
'lat' => $imgobj->get('EXIFGPSLatitude'),
'long' => $imgobj->get('EXIFGPSLongitude'),
'title' => $imgobj->getTItle(),
'desc' => $imgobj->getDesc(),
'thumb' => '' // an [img][/img] for example for a thumb or whatever
)
);
Add arrays within the array for every further image.
Then either setup a map object:
$map = new zpOpenStreetMap($geodata);
$map->printMap();
Or use the procedural wrapper:
printOpenStreetMap($geodata);
This will get you a map outside any album/image context since you wanted all images. Be aware that hundreds or thousand markers will make the map probably quite slow.