summaryrefslogtreecommitdiffstats
path: root/phpfspot.class.php
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2008-05-04 21:46:25 +0200
committerAndreas Unterkircher <unki@netshadow.at>2008-05-11 09:14:44 +0200
commit50e939560cd42cd4355fc130cfea0389e380694f (patch)
tree474302d6f2474e28fd4dcf0c554c5e72fdf788fe /phpfspot.class.php
parent89f78a74b9e4633e92eaf7a47da8b5242edc38e0 (diff)
issue118, user-friendly-url to directly address a tag
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r--phpfspot.class.php22
1 files changed, 14 insertions, 8 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index 55bd713..49d0c7d 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -314,13 +314,17 @@ class PHPFSPOT {
$this->tmpl->assign('from_date', $this->get_calendar('from'));
$this->tmpl->assign('to_date', $this->get_calendar('to'));
+ $this->tmpl->assign('preset_selected_tags', $this->getSelectedTags());
+ $this->tmpl->assign('preset_available_tags', $this->getAvailableTags());
+
if(!isset($content)) {
- $this->tmpl->assign('preset_selected_tags', $this->getSelectedTags());
- $this->tmpl->assign('preset_available_tags', $this->getAvailableTags());
- $this->tmpl->assign('content_page', $this->tmpl->fetch('welcome.tpl'));
+ if(isset($_SESSION['selected_tags']) && !empty($_SESSION['selected_tags']))
+ $this->tmpl->assign('initial_content', $this->showPhotoIndex());
+ else
+ $this->tmpl->assign('initial_content', $this->tmpl->fetch('welcome.tpl'));
}
else
- $this->tmpl->assign('content_page', $content);
+ $this->tmpl->assign('initial_content', $content);
$this->tmpl->show("index.tpl");
@@ -730,9 +734,11 @@ class PHPFSPOT {
$b = '88';
if(isset($this->tags[$key])) {
- $output.= "<a href=\"javascript:Tags('add', ". $key .");\" class=\"tag\" style=\"font-size: ". $size ."%; color: #". $r.$g.$b .";\">". $this->tags[$key] ."</a>, ";
+ if($this->is_user_friendly_url())
+ $output.= "<a href=\"". $this->cfg->web_path ."/tag/". $key ."\" onclick=\"Tags('add', ". $key ."); return false;\" class=\"tag\" style=\"font-size: ". $size ."%; color: #". $r.$g.$b .";\">". $this->tags[$key] ."</a>, ";
+ else
+ $output.= "<a href=\"". $this->cfg->web_path ."/index.php?mode=showpi\" onclick=\"Tags('add', ". $key ."); return false;\" class=\"tag\" style=\"font-size: ". $size ."%; color: #". $r.$g.$b .";\">". $this->tags[$key] ."</a>, ";
}
-
}
$output = substr($output, 0, strlen($output)-2);
@@ -1176,6 +1182,7 @@ class PHPFSPOT {
*
* this function provides all the necessary information
* for the photo index template.
+ * @return string
*/
public function showPhotoIndex()
{
@@ -3122,9 +3129,8 @@ class PHPFSPOT {
break;
case 'tag':
if(is_numeric($options[2])) {
- $_GET['mode'] = 'showpi';
- $_SESSION['selected_tags'] = Array($options[2]);
$_GET['tags'] = $options[2];
+ $_SESSION['selected_tags'] = Array($options[2]);
return $this->showPhotoIndex();
}
break;