How to get an album object by ID

Hey people.

I'm trying to find this out for at least one hour but I guess nobody ever tried to do that simple thing... I'm creating a custom page (like archive.php or slideshow.php) and in this page I need to access the album the user was looking at and its properties. The only way I managed to do pass the album as a parameter to the custom page is to forcing the album object into a session variable when I'm on album.php (using $_zp_current_album) and accessing it on the custom_page, using "session_start()" in both pages. I feel like I need to take a shower after doing that... is there a decent way to do that?

The closest appropriate thing was to call a SearchEngine object, but as far as I could read on the documentation there is no way to get albums by ID, only by title, description. Am I missing something?

Thank you :)

Comments

  • acrylian Administrator, Developer
    You have to look into the object model on our site. Actually Zenphoto gets albums not by title but by name (as well as images, Zenpage pages and articles).

    The name of an album is its folder name. For subalbums it is the path (toplevel/sublevel/...). There is a tutorial on our site. Once you have the album object you can also get the id (see the documentation). But using the name makes things easier if you want to do more stuff with the album later.
  • Well, I guess folder name is as unique as the ID... I will follow this path, then.

    Thanks for pointing this out.
Sign In or Register to comment.