Member
Member
lordflake   2010-02-22, 14:00
#1

Hi,

I'm trying to generate a link to the next album but I would like to skip the album view completely. It looks as if for this to occur I need to generate a link to the first image in the next album, not just a link to the next album.

If anybody could give any pointers on how to do this, it would much appreciated. Thank you.

L

Administrator
Administrator
acrylian   2010-02-22, 14:12
#2

We have functions like this but those are album context sensitive so they are for the current album not the next.
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetFirstImageURL
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetLastImageURL

You will have to work with the object model framework.

Member
Member
lordflake   2010-02-22, 14:34
#3

Hi Acrylian,

Thanks for your answer. That's what I figured having looked at the available functions. Could you help me out a bit more by expanding on how to use the object model framework please? That's the bit I'm stuck on.

L

Administrator
Administrator
acrylian   2010-02-22, 14:44
#4

We have a short tutorial about the basics in the works if you can wait a little.

Member
Member
lordflake   2010-02-22, 16:16
#5

Thanks - that'll be really helpful.

I've managed to bodge a solution together, but I've no idea if it's sound...

`

$PrevAlbum = getPrevAlbum();

$firstimg = $PrevAlbum->getImage(0);

echo rewrite_path("/" . pathurlencode($PrevAlbum->name) . "/" . urlencode($firstimg->filename) . im_suffix(), "/index.php?album=" . urlencode($PrevAlbum->name) . "&image=" . urlencode($firstimg->filename));

`

L

Administrator
Administrator
acrylian   2010-02-22, 18:18
#6

Actually quite good. Here a little help:
Insert this after the 2nd line:
$imgobj = newImage($prevAlbum,$firstimg); $firstimageeurl = $imgobj->getImageLink();

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