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:
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.
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.
Note: 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.
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.
Comments
Basically, it's just [$image]->getPrevImage()->getThumbnail()
(but you of course have to check if the next/prev image actually exists first).
The best would be a simple php-code that i can put into the next/prev-navigation from the default theme:
`<?php if (hasPrevImage()) { ?>
">
<?php } ?>`
and in xxx should be the path to the thumbnail.
Thanks!
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:
`<?php if (hasPrevImage()) { ?> " title="Previous Image">" /><?php } ?>`
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.
http://www.reidab.com/photos/nyc2004/IMG_1039.JPG
Note: 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.
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.
<?php
$currentImageTitle = getImageTitle();
$thumbRange = 2;
$iterator = 0;
$controlInt = 0;
while(next_Image()) {
if ($currentImageTitle == getImageTitle()) {
$controlInt = $iterator;
}
$iterator ++;
}
$iterator = 0;
while(next_image()) {
if(($iterator >= ($controlInt - $thumbRange)) && ($iterator <= ($controlInt + $thumbRange))) {
echo '';
echo printImageThumb();
echo '';
}
$iterator ++;
}
?>
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
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!