public function showPhoto($photo)
{
+ $all_photos = $this->getAllTagPhotos();
+
+ foreach($all_photos as $all_photo) {
+
+ if($get_next) {
+ $next_img = $all_photo;
+ break;
+ }
+
+ if($all_photo == $photo) {
+ $get_next = 1;
+ }
+ else {
+ $previous_img = $all_photo;
+ }
+ }
+
if(isset($photo)) {
$this->tmpl->assign('image_url', 'phpfspot_img.php?idx='. $photo ."&width=". $this->cfg->photo_width);
}
- if($photo > 0) {
- $this->tmpl->assign('previous_url', "javascript:showImage(". ($photo-1) .");");
+ if($previous_img) {
+ $this->tmpl->assign('previous_url', "javascript:showImage(". $previous_img .");");
}
- if($photo < count($this->photos)) {
- $this->tmpl->assign('next_url', "javascript:showImage(". ($photo+1) .");");
+ if($next_img) {
+ $this->tmpl->assign('next_url', "javascript:showImage(". $next_img .");");
}
$this->tmpl->show("single_photo.tpl");