Member
Member
khaled   23-09-2005, 21:29
#1

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?

Developer
Developer
trisweb   24-09-2005, 01:13
#2

Really easy in fact. I was planning on making a theme that used that kind of navigation.

Basically, it's just [$image]->getPrevImage()->getThumbnail()
(but you of course have to check if the next/prev image actually exists first).

Member
Member
sjard   25-09-2005, 12:45
#3

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!

Developer
Developer
trisweb   25-09-2005, 20:32
#4

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;

global $_zp_current_album, $_zp_current_image;

$img = new Image($_zp_current_album, $_zp_current_image->getPrevImage());

return $img->getThumb();

}`

`function getNextImageThumb() {

if(!in_context(ZP_IMAGE)) return false;

global $_zp_current_album, $_zp_current_image;

$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:

[img][/img]

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.

Member
Member
reidab   25-09-2005, 22:05
#5

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.

Member
Member
afrojas   15-10-2005, 10:19
#6

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.

Member
Member
afrojas   15-10-2005, 11:27
#7

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

Member
Member
afrojas   15-10-2005, 11:29
#8

jesus, my echoed html got all screwed up. whatever, ya'll know what I meant

Member
Member
nathan   15-10-2005, 11:42
#9

@reidab: I love that theme. It looks terrific. Great work.

Member
Member
zoggop   04-12-2005, 03:13
#10

Yup, reid, your theme is hot, cold and dark though it may be.

Member
Member
rich68   18-11-2007, 20:55
#11

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!

Member
Member
sbillard   19-11-2007, 17:46
#12

Look at the stopdesign theme that comes with the distribution. It's image page has thumbs for the next and previous images.

Member
Member
rich68   21-11-2007, 16:45
#13

Thanks, will check it out.

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