issue13, added first try of external link to directly jump to a photo
[phpfspot.git] / phpfspot.js
index ce66cf6a35a924ec5f5a5e979575f5c06fb791ac..9204f3251c971c9f3a5462ee623e7b1cc1b32c73 100644 (file)
@@ -131,8 +131,14 @@ function init_phpfspot()
 {
    refreshAvailableTags();
 
-   if(refreshSelectedTags()) {
-      showPhotoIndex();
+   if(photo = getPhotoToShow()) {
+      showImage(photo)
+      refreshSelectedTags();
+   }
+   else {
+      if(refreshSelectedTags()) {
+         showPhotoIndex();
+      }
    }
 }
 
@@ -146,5 +152,19 @@ function setBackGrdColor(item, color)
       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;