X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.class.php;h=54308aa25ca3e109e2e4d7c7ada4e958b72a1b44;hp=49d0c7df071da319c16c829bbc9d5be55a101d2e;hb=b690db6fe75d323ff4f30e2be0a447a75e140cb5;hpb=50e939560cd42cd4355fc130cfea0389e380694f
diff --git a/phpfspot.class.php b/phpfspot.class.php
index 49d0c7d..54308aa 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -223,6 +223,11 @@ class PHPFSPOT {
if(isset($_SESSION['begin_with']) && $this->cfg->thumbs_per_page == 0)
unset($_SESSION['begin_with']);
+ // if user-friendly-url's are enabled, set also a flag for the template handler
+ if($this->is_user_friendly_url()) {
+ $this->tmpl->assign('user_friendly_url', 'true');
+ }
+
} // __construct()
public function __destruct()
@@ -311,8 +316,8 @@ class PHPFSPOT {
$this->tmpl->assign('date_search_enabled', true);
$this->tmpl->register_function("sort_select_list", array(&$this, "smarty_sort_select_list"), false);
- $this->tmpl->assign('from_date', $this->get_calendar('from'));
- $this->tmpl->assign('to_date', $this->get_calendar('to'));
+ $this->tmpl->assign('search_from_date', $this->get_calendar('from'));
+ $this->tmpl->assign('search_to_date', $this->get_calendar('to'));
$this->tmpl->assign('preset_selected_tags', $this->getSelectedTags());
$this->tmpl->assign('preset_available_tags', $this->getAvailableTags());
@@ -773,17 +778,10 @@ class PHPFSPOT {
break;
case 'img':
$output.= "
-
-
-
+
";
break;
@@ -867,7 +865,7 @@ class PHPFSPOT {
} // resetTags()
/**
- * returns the value for the autocomplet tag-search
+ * returns the value for the autocomplete tag-search
* @return string
*/
public function get_xml_tag_list()
@@ -1294,7 +1292,16 @@ class PHPFSPOT {
else
$style = "";
- $select = "
is_user_friendly_url()) {
+ $select = "cfg->web_path ."/tag/205/". $start_with ."\"";
+ }
+ else {
+ $select = "cfg->web_path ."/index.php?mode=showpi tags=". $current_tags ." begin_with=". $begin_with ."\"";
+ }
+ $select.= " onclick=\"showPhotoIndex(". $start_with ."); return false;\"";
+
if($style != "")
$select.= $style;
$select.= ">". $i ." ";
@@ -1332,7 +1339,6 @@ class PHPFSPOT {
if($last_page > 1)
$this->tmpl->assign('page_selector', $page_select);
}
-
$current_tags = $this->getCurrentTags();
$extern_link = "index.php?mode=showpi";
@@ -2711,7 +2717,9 @@ class PHPFSPOT {
*/
private function ts2str($timestamp)
{
- return strftime("%Y-%m-%d", $timestamp);
+ if(!empty($timestamp) && is_numeric($timestamp))
+ return strftime("%Y-%m-%d", $timestamp);
+
} // ts2str()
/**
@@ -3104,14 +3112,14 @@ class PHPFSPOT {
{
if(preg_match('/\/photoview\/|\/photo\/|\/tag\//', $request_uri)) {
- unset($_SESSION['start_action']);
- unset($_SESSION['selected_tags']);
-
$options = explode('/', $request_uri);
switch($options[1]) {
case 'photoview':
if(is_numeric($options[2])) {
+ $this->session_cleanup();
+ //unset($_SESSION['start_action']);
+ //unset($_SESSION['selected_tags']);
$_GET['mode'] = 'showp';
return $this->showPhoto($options[2]);
}
@@ -3129,8 +3137,11 @@ class PHPFSPOT {
break;
case 'tag':
if(is_numeric($options[2])) {
+ $this->session_cleanup();
$_GET['tags'] = $options[2];
$_SESSION['selected_tags'] = Array($options[2]);
+ if(isset($options[3]) && is_numeric($options[3]))
+ $_SESSION['begin_with'] = $options[3];
return $this->showPhotoIndex();
}
break;
@@ -3155,6 +3166,22 @@ class PHPFSPOT {
} // is_user_friendly_url()
+ /**
+ * session cleanup
+ *
+ * this function will cleanup user's session information
+ */
+ private function session_cleanup()
+ {
+ unset($_SESSION['begin_with']);
+ $this->resetDateSearch();
+ $this->resetPhotoView();
+ $this->resetTagSearch();
+ $this->resetNameSearch();
+ $this->resetDateSearch();
+ $this->resetTags();
+
+ } // session_cleanup()
} // class PHPFSPOT