issue13, if user jumps into from an external link, immediatley display the photo...
authorAndreas Unterkircher <unki@netshadow.at>
Wed, 4 Jul 2007 19:02:47 +0000 (19:02 +0000)
committerAndreas Unterkircher <unki@netshadow.at>
Wed, 4 Jul 2007 19:02:47 +0000 (19:02 +0000)
git-svn-id: file:///var/lib/svn/phpfspot/trunk@162 fa6a889d-dae6-447d-9e79-4ba9a3039384

phpfspot.class.php
phpfspot.js
templates/index.tpl
templates/photo_index.tpl

index 9d159ff3ff02e09d46c374d50a0a23d1ccb89d87..204c8a7374f4c687ba88ebb2e96d149943f98c7e 100644 (file)
@@ -532,7 +532,10 @@ class PHPFSPOT {
          $current_tags = substr($current_tags, 0, strlen($current_tags)-1);
       }
 
-      $extern_link = "http://". $_SERVER['SERVER_NAME'] ."/index.php?mode=showpi&tags=". $current_tags;
+      $extern_link = "http://". $_SERVER['SERVER_NAME'] ."/index.php?mode=showpi";
+      if($current_tags != "") {
+         $extern_link.= "&tags=". $current_tags;
+      }
 
       $this->tmpl->assign('extern_link', $extern_link);
       $this->tmpl->assign('count', $count);
index 2d7e780c4cf7b4a63400d2dceb7c03a0a75191ae..22840b7990630a18463ea78cb95327a3ede8ce50 100644 (file)
@@ -49,6 +49,13 @@ function refreshSelectedTags()
    var selected_tags = document.getElementById("selected_tags");
    selected_tags.innerHTML = "Loading...";
    selected_tags.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_selected_tags'));
+
+   // if no tags are currently selected, return false from here
+   if(selected_tags.innerHTML == "")
+      return false;
+   
+   return true;
+
 }
 
 function showPhotoIndex(begin_with)
@@ -113,4 +120,14 @@ function clearSearch()
    document.getElementsByName('searchfor')[0].value = '';
 }
 
+function init_phpfspot()
+{
+   refreshAvailableTags();
+
+   if(refreshSelectedTags()) {
+      showPhotoIndex();
+   }
+}
+
 var startup = 1;
+
index c00a59177ba3f01a247186da6ee127a9d79e6152..3cad8ba03049b33350f35d9cb3d2da7726d11c24 100644 (file)
@@ -1,5 +1,5 @@
 {include file="header.tpl"}
- <body onload="refreshAvailableTags(); refreshSelectedTags();">
+ <body onload="init_phpfspot();">
   <div id="frame">
   <table>
    <tr>
index ee11a4f15516225be236241194da80b6fd67fbe6..8111b1bad80719f0990cfe4ef55ebae27683e780 100644 (file)
@@ -21,7 +21,9 @@
       {/if}
      </td>
      <td class="index_header" style="text-align: right;">
-      <a href="{$extern_link}">Extern</a>
+      {if $extern_link }
+       <a href="{$extern_link}">Extern</a>
+      {/if} 
       <img src="resources/photo_index.png" alt="photo index" />
      </td>
     </tr>