var $tmpl;
var $tags;
var $avail_tags;
- var $current_tags;
public function __construct()
{
$_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;
$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);
} // resetTags()
+ public function resetPhotoView()
+ {
+ unset($_SESSION['current_photo']);
+
+ } // resetPhotoView();
+
public function resetTagSearch()
{
unset($_SESSION['searchfor']);
$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;
} // 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()
+
}
?>
{
refreshAvailableTags();
- if(refreshSelectedTags()) {
- showPhotoIndex();
+ if(photo = getPhotoToShow()) {
+ showImage(photo)
+ refreshSelectedTags();
+ }
+ else {
+ if(refreshSelectedTags()) {
+ showPhotoIndex();
+ }
}
}
item.style.backgroundColor='#93A8CA';
}
+function getPhotoToShow()
+{
+ // update selected tags
+ var photo_to_show = HTML_AJAX.grab(encodeURI('rpc.php?action=get_photo_to_show'));
+
+ // if no image needs to be shown, return false from here
+ if(photo_to_show == "")
+ return false;
+
+ return photo_to_show;
+}
+
+
+
var startup = 1;