Member
Member
risk08   2011-02-01, 22:26
#1

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?

PS. Sorry for my bad english

Member
Member
sbillard   2011-02-02, 01:28
#2

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.

Administrator
Administrator
acrylian   2011-02-02, 10:30
#3

You could also use the print_album_menu plugin with appropiate settings.

Member
Member
risk08   2011-02-02, 11:03
#4

sbillard, thanks! I will try to use getAlbums() function.
acrylian, I tried, but I failed =\

Member
Member
risk08   2011-02-02, 11:09
#5

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?

Administrator
Administrator
acrylian   2011-02-02, 11:23
#6

No, it is also a album class method which means used on an album it gets its direct subalbums.

Regarding the album menu please see the documentation.

Member
Member
risk08   2011-02-02, 13:35
#7

I can't find which variable I must use, can you help me?
(now it's $_zp_current_album->getAlbums(), that's not right)

Administrator
Administrator
acrylian   2011-02-02, 14:17
#8

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.

Member
Member
risk08   2011-02-02, 15:02
#9

Sorry, but English isn't my native language, so reading manuals for me is very hard. Can you just give me source?

Administrator
Administrator
acrylian   2011-02-02, 15:26
#10

Sorry, our site is English only. Examples are in those tutorials.

Member
Member
risk08   2011-02-02, 15:37
#11

I don't get which variable I must use

Member
Member
risk08   2011-02-02, 15:45
#12
Member
Member
risk08   2011-02-02, 15:57
#13

Last questions:

  1. how to get album name from Album object?
  2. is there any function to get name of parent album from subalbum?
Administrator
Administrator
acrylian   2011-02-02, 16:53
#14
  1. http://www.zenphoto.org/documentation/classes/Album.html#var$name
  2. http://www.zenphoto.org/documentation/classes/Album.html#methodgetParent

You will probably also need to understand the concept of object orientation.

Member
Member
risk08   2011-02-02, 17:50
#15

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]

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.