How to get parent album title

ZenPhoto looks really good but I'm struggling with it.
I'm using the default theme.
I have 3-levels of album - gallery / year / location.
From within image.php, I've managed to display the EXIF image copyright information using $_zp_current_image->getCopyright(). But I would like to append the year to this - i.e. the title of the parent album.
$_zp_current_image->GetAlbumName() displays [year]/[location]. How can I pick up just the year value?

Any suggestions would be greatly appreciated.

I'm very much a novice with PHP b-t-w.

Comments

  • Sadly when you want to do something special you will have to acquire extra knowledge.

    You can get the "date" from the image object via imageObject-> getDate(); But that is a full date, so you will have to parse it with PHP code to extract just the year.

    Also, the album name is not the same thing as the album title, so if you really want the title you will have to use the album->getTitle() method.

    I am afraid you will need to study up on PHP and the Zenphoto object model if you are going to branch out from what is provided standard.
  • Bob03 Member
    Many thanks for the quick reply - and at the week-end too.

    The image date would not be so good because many of the older images are scanned. My 2nd level albums have names & titles which are just the 4-digit year. If this can't be retrieved directly, I'll have to simply extract the 1st 4 characters from the GetAlbumName()return.

    I have solid software development experience so I fully appreciate what's needed to get to grips with php.

    But re the Zenphoto object model, I started with the assumption that I should be able to find the answer to this myself. But after a lot of searching through the forum and the user guide I'm making no headway at all. I've just not been able to find documentation on the data model and the functions. Am I looking in the wrong place? Can you point me in the right direction?
  • The "name" of an album is album->name; title is album->getTitle(); all this is part of the object model.

    Start here:http://www.zenphoto.org/news/zenphotos-object-model-framework

    Then here:http://www.zenphoto.org/news/functions-documentation
  • Bob03 Member
    Many thanks sbillard.
    I've got no excuses now.
Sign In or Register to comment.