X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.class.php;h=8fe0f77e40824092049fa1b7eb0864cd7a05ab71;hp=33d4e24ffe0a5b99469ecb75a62f23b8cf048d9a;hb=856af471b7a6025f1438f09ff0d701dd78fd99ea;hpb=82778dd9e72a9f424fe6d66ce866cbf4ba178c2c diff --git a/phpfspot.class.php b/phpfspot.class.php index 33d4e24..8fe0f77 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -12,7 +12,6 @@ class PHPFSPOT { var $tmpl; var $tags; var $avail_tags; - var $current_tags; public function __construct() { @@ -64,6 +63,14 @@ class PHPFSPOT { $_SESSION['selected_tags'] = split(',', $_GET['tags']); } break; + case 'showp': + if(isset($_GET['tags'])) { + $_SESSION['selected_tags'] = split(',', $_GET['tags']); + } + if(isset($_GET['id'])) { + $_SESSION['current_photo'] = $_GET['id']; + } + break; case 'export': $this->tmpl->show("export.tpl"); return; @@ -192,6 +199,14 @@ class PHPFSPOT { $meta_make = isset($meta['Make']) ? $meta['Make'] ." ". $meta['Model'] : "n/a"; $meta_size = isset($meta['FileSize']) ? round($meta['FileSize']/1024, 1) ."kbyte" : "n/a"; + $current_tags = $this->getCurrentTags(); + $extern_link = "index.php?mode=showp&id=". $photo; + if($current_tags != "") { + $extern_link.= "&tags=". $current_tags; + } + + $this->tmpl->assign('extern_link', $extern_link); + if(file_exists($thumb_path)) { $info = getimagesize($thumb_path); @@ -328,6 +343,12 @@ class PHPFSPOT { } // resetTags() + public function resetPhotoView() + { + unset($_SESSION['current_photo']); + + } // resetPhotoView(); + public function resetTagSearch() { unset($_SESSION['searchfor']); @@ -585,13 +606,8 @@ class PHPFSPOT { $this->tmpl->assign('page_selector', $page_select); } - $current_tags = ""; - if($_SESSION['selected_tags'] != "") { - foreach($_SESSION['selected_tags'] as $tag) - $current_tags.= $tag .","; - $current_tags = substr($current_tags, 0, strlen($current_tags)-1); - } - + + $current_tags = $this->getCurrentTags(); $extern_link = "index.php?mode=showpi"; if($current_tags != "") { $extern_link.= "&tags=". $current_tags; @@ -619,43 +635,6 @@ class PHPFSPOT { } // showPhotoIndex() - public function showBubbleDetails($photo, $direction) - { - if($direction == "up") - $direction = "bubbleimg_up"; - else - $direction = "bubbleimg_down"; - - $details = $this->get_photo_details($photo); - $orig_path = $this->translate_path($details['directory_path']) ."/". $details['name']; - - $image_url = "phpfspot_img.php?idx=". $photo ."&width=". $this->cfg->bubble_width; - - $filesize = filesize($orig_path); - $filesize = rand($filesize/1024, 2); - - if(!file_exists($orig_path)) { - $this->_warning("Photo ". $orig_path ." does not exist!
\n"); - return; - } - - if(!is_readable($orig_path)) { - $this->_warning("Photo ". $orig_path ." is not readable for user ". get_current_user() ."
\n"); - return; - } - - $img = getimagesize($orig_path); - - $this->tmpl->assign('file_size', $filesize); - $this->tmpl->assign('width', $img[0]); - $this->tmpl->assign('height', $img[1]); - $this->tmpl->assign('file_name', $details['name']); - $this->tmpl->assign('image_id', $direction); - $this->tmpl->assign('image_url', $image_url); - $this->tmpl->show("bubble_details.tpl"); - - } // showBubbleDetails() - public function showCredits() { $this->tmpl->assign('version', $this->cfg->version); @@ -833,7 +812,6 @@ class PHPFSPOT { $resolutions = Array( $this->cfg->thumb_width, - $this->cfg->bubble_width, $this->cfg->photo_width, $this->cfg->mini_width, ); @@ -1139,6 +1117,7 @@ class PHPFSPOT { public function getExport($mode) { $pictures = $this->getPhotoSelection(); + $current_tags = $this->getCurrentTags(); if(!isset($_SERVER['HTTPS'])) $protocol = "http"; else $protocol = "https"; @@ -1147,7 +1126,11 @@ class PHPFSPOT { foreach($pictures as $picture) { - $orig_url = $protocol ."://". $server_name . $this->cfg->web_path ."phpfspot_img.php?idx=". $picture ."&width=". $this->cfg->photo_width; + $orig_url = $protocol ."://". $server_name . $this->cfg->web_path ."index.php?mode=showp&id=". $picture; + if($current_tags != "") { + $orig_url.= "&tags=". $current_tags; + } + $thumb_url = $protocol ."://". $server_name . $this->cfg->web_path ."phpfspot_img.php?idx=". $picture ."&width=". $this->cfg->thumb_width; switch($mode) { @@ -1167,6 +1150,25 @@ class PHPFSPOT { } // getExport() + private function getCurrentTags() + { + $current_tags = ""; + if($_SESSION['selected_tags'] != "") { + foreach($_SESSION['selected_tags'] as $tag) + $current_tags.= $tag .","; + $current_tags = substr($current_tags, 0, strlen($current_tags)-1); + } + return $current_tags; + + } // getCurrentTags() + + public function getCurrentPhoto() + { + if(isset($_SESSION['current_photo'])) { + print $_SESSION['current_photo']; + } + } // getCurrentPhoto() + } ?>