ZenphotoCMS Forum
Problem with getNextImageURL - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: Themes (https://forum.zenphoto.org/forum-5.html)
+--- Thread: Problem with getNextImageURL (/thread-2764.html)



Problem with getNextImageURL - PierreSnugg - 2008-04-28

Hy, i customized the workflow of the image.php.

so if you click on a image it goes directly to the next one, i wrote:

`

">

`

So my problem is, that as soon as you come to the last image, it doesn´t show up (makes sense if you got this function on a button..)

how can i hack that?

  1. to show the last image and if there is no image after just stop there, or remove the
    link function

or better

  1. start looping again from the first image of the album...

Is that possible?




Problem with getNextImageURL - acrylian - 2008-04-28

[i]So my problem is, that as soon as you come to the last image, it doesn´t show up (makes sense if you got this function on a button..)

how can i hack that?

  1. to show the last image and if there is no image after just stop there, or remove the
    link function[/i]

That is a little confusing, do you want the link to be shown if there is no next image or not?

Anyway, how about?: if(next_image()) { show link } else { do something }

The nightly build has functions for first and last image:
www.zenphoto.org/documentation




Problem with getNextImageURL - PierreSnugg - 2008-04-28

Ok, i wrote:

`

`

how can i now loop back to the first? sorry, couldn´t find it in docmentation...




Problem with getNextImageURL - acrylian - 2008-04-28

http://www.zenphoto.org/documentation/zenphoto/_template-functions.php.html#functiongetFirstImageURL

BTW, you code misses two "{" and "}" for the else part and the `` is not correct, too.




Problem with getNextImageURL - PierreSnugg - 2008-04-28

for some reason, that works:

`




Problem with getNextImageURL - PierreSnugg - 2008-04-30

can somebody correct that code? it works, but i know there is something wrong.
I don´t get the link closed!

`




Problem with getNextImageURL - acrylian - 2008-04-30

The first link is not closed.




Problem with getNextImageURL - PierreSnugg - 2008-04-30

well, where should i close?

i tried to close after the '}' but than i get an error. i think something else is wrong.
maby the declaration of the if/else statement.

somebody knows?




Problem with getNextImageURL - acrylian - 2008-04-30

You just need to look at the second link...




Problem with getNextImageURL - PierreSnugg - 2008-04-30

If i write:

`

else { ?>

`

i see beside my image "else { ?>" showing up and the last image is missing...




Problem with getNextImageURL - acrylian - 2008-04-30

Of course, you need to look closer. the elseneeds to be ``. Always close what you open and always open what you close..:-)