Hello all, I've got album named,for example,'graphics' and subalbums 'birds' and 'fishes' in it. I need to print links to 'birds' and 'fishes' in both of them. How I can do it?
If you "know" the names of the albums you can make static links using the form `http://domain/zenphoto folder/graphics/birds` and `http://domain/zenphoto folder/graphics/fishes` (This assumes mod_rewrite is enabled for your site.)
If you need to discover the subalbums you can use the object model: `$mainAlbumObject->getAlbums(0);` This will return, in the case of your example, an array containing `[birds, fishes]` You create the links from there.
getAlbums() gets ALL albums from gallery, i don't need it. And I don't know how to get names and etc. of that albums.. how to use print_album_menu plugin for my need?
The $_zp_current_album variable containing the object of the current album is only setup in album context. (next_album loop or on album.php). To use a specific album outside of that you have to setup the album object before hand. Please take the time to read a little on the theming tutorial and the object model tutorial.
I made it like this: [code] $a=$_zp_current_album->getParent()->getAlbums(); foreach($a as $val) { $b = new Album($_zp_gallery,$val,true); echo "name.">".$b->data[title].""; [/code]
Comments
If you need to discover the subalbums you can use the object model: `$mainAlbumObject->getAlbums(0);` This will return, in the case of your example, an array containing `[birds, fishes]` You create the links from there.
acrylian, I tried, but I failed =\
how to use print_album_menu plugin for my need?
Regarding the album menu please see the documentation.
(now it's $_zp_current_album->getAlbums(), that's not right)
1. how to get album name from Album object?
2. is there any function to get name of parent album from subalbum?
2. http://www.zenphoto.org/documentation/classes/Album.html#methodgetParent
You will probably also need to understand the concept of object orientation.
[code]
$a=$_zp_current_album->getParent()->getAlbums();
foreach($a as $val) {
$b = new Album($_zp_gallery,$val,true);
echo "name.">".$b->data[title]."";
[/code]