![]() |
|
Thumbnail in the previous and next position - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Thumbnail in the previous and next position (/thread-39.html) |
Thumbnail in the previous and next position - khaled - 2005-09-23 I love that feature in flickr. It makes going through the photos much less of an action, and much more fun in general. Anyone know how to go about this, surely it can't be that hard right? Thumbnail in the previous and next position - trisweb - 2005-09-24 Really easy in fact. I was planning on making a theme that used that kind of navigation. Basically, it's just [$image]->getPrevImage()->getThumbnail() Thumbnail in the previous and next position - sjard - 2005-09-25 Could you please post the exact code for this, because I would like to have the same function in my new zp-theme and this is one of only two things that are still missing. The best would be a simple php-code that i can put into the next/prev-navigation from the default theme: ` [img]xxx[/img] ` and in xxx should be the path to the thumbnail. Thanks! Thumbnail in the previous and next position - trisweb - 2005-09-25 It's hard to do outside the theme functions, so I made some new ones. Paste these into template-functions.php. They will be included in future releases, so anything you make with them now should work in the future. `function getPrevImageThumb() { if(!in_context(ZP_IMAGE)) return false;
$img = new Image($_zp_current_album, $_zp_current_image->getPrevImage()); return $img->getThumb(); }` `function getNextImageThumb() { if(!in_context(ZP_IMAGE)) return false;
$img = new Image($_zp_current_album, $_zp_current_image->getNextImage()); return $img->getThumb(); }` And here's an example of how to use it on the image.php theme page:
Note that I may work on these functions more, adding custom thumb sizes and better checking for next/prev existence, so be prepared to update your themes. Thumbnail in the previous and next position - reidab - 2005-09-25 Thanks! I'd been hoping for this. If anyone wants to see a demo integration I just threw it in to my template along with get next and previous title functions. http://www.reidab.com/photos/nyc2004/IMG_1039.JPG [i]Note:[/i] I'm in the middle of struggling to make IE not break this layout, so don't use it if you want to actually see anything properly at the above link. Thumbnail in the previous and next position - afrojas - 2005-10-15 Hey there. Thanks for adding this function, but I have a question slash request: Can I see a range of thumbnails forwards and backwards of the current image? I want to have a navigation bar at the bottom of the page that shows a range of the photos one has seen and to get a quick look ahead of what's coming. I'm not sure if this can be done with the current function, or if I need to write my own. Thanks. Thumbnail in the previous and next position - afrojas - 2005-10-15 I actually just figured it out. I'm crazy tired so there is probably a better way of doing this, but this works: (Put it in image.php) please let me know if this makes or doesn't make any sense. It's 4:30 in the morning and I'm going to bed... g-night Thumbnail in the previous and next position - afrojas - 2005-10-15 jesus, my echoed html got all screwed up. whatever, ya'll know what I meant Thumbnail in the previous and next position - nathan - 2005-10-15 @reidab: I love that theme. It looks terrific. Great work. Thumbnail in the previous and next position - zoggop - 2005-12-04 Yup, reid, your theme is hot, cold and dark though it may be. Thumbnail in the previous and next position - rich68 - 2007-11-18 Hi Could anyone explain what is wrong in the above example from afrojas with the echo please? I'm trying it out but hardly know any php. Thanks! Thumbnail in the previous and next position - sbillard - 2007-11-19 Look at the stopdesign theme that comes with the distribution. It's image page has thumbs for the next and previous images. Thumbnail in the previous and next position - rich68 - 2007-11-21 Thanks, will check it out. |