summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpfspot.class.php5
-rw-r--r--phpfspot.js17
-rw-r--r--templates/index.tpl2
-rw-r--r--templates/photo_index.tpl4
4 files changed, 25 insertions, 3 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index 9d159ff..204c8a7 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -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);
diff --git a/phpfspot.js b/phpfspot.js
index 2d7e780..22840b7 100644
--- a/phpfspot.js
+++ b/phpfspot.js
@@ -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;
+
diff --git a/templates/index.tpl b/templates/index.tpl
index c00a591..3cad8ba 100644
--- a/templates/index.tpl
+++ b/templates/index.tpl
@@ -1,5 +1,5 @@
{include file="header.tpl"}
- <body onload="refreshAvailableTags(); refreshSelectedTags();">
+ <body onload="init_phpfspot();">
<div id="frame">
<table>
<tr>
diff --git a/templates/photo_index.tpl b/templates/photo_index.tpl
index ee11a4f..8111b1b 100644
--- a/templates/photo_index.tpl
+++ b/templates/photo_index.tpl
@@ -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>