![]() |
|
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: ` <?php } if (hasNextImage()) { ?> <a>"><?php printDefaultSizedImage(getImageTitle()); ?></a><?php } ?> ` 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 2. 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: ` <?php } if (hasNextImage()) { ?> <?php printDefaultSizedImage(getImageTitle());} else ?> <?php printDefaultSizedImage(getImageTitle()); ?> ` 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 `<a href></a>` is not correct, too. Problem with getNextImageURL - PierreSnugg - 2008-04-28 for some reason, that works: `<?php } if (hasNextImage()) { ?> <?php printDefaultSizedImage(getImageTitle());} else { ?> <a href="<?php echo getFirstImageURL();?>"><?php printDefaultSizedImage(getImageTitle());?>} <?php }?>` but of course there is a missing after the if statement. don´t know where to place... 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! ` <?php } if (hasNextImage()) { ?> <?php printCustomSizedImageMaxHeight(400);} else { ?> <a href="<?php echo getFirstImageURL();?>"><?php printCustomSizedImageMaxHeight(400);?> <?php }?> ` 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: ` <?php } if (hasNextImage()) { ?> <?php printCustomSizedImageMaxHeight(400);?> else { ?> <?php printCustomSizedImageMaxHeight(400);?> <?php }?> ` 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 `else`needs to be `<?php else { ?>`. Always close what you open and always open what you close..:-) |