summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpfspot.class.php5
-rw-r--r--themes/default/templates/photo_index.tpl6
2 files changed, 10 insertions, 1 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index 0e2ea44..f938dbc 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()
diff --git a/themes/default/templates/photo_index.tpl b/themes/default/templates/photo_index.tpl
index b14afe4..9f0531e 100644
--- a/themes/default/templates/photo_index.tpl
+++ b/themes/default/templates/photo_index.tpl
@@ -69,7 +69,11 @@
{if $images[thumb] }
<div class="thumb" onmouseover="setBackGrdColor(this, 'mouseover');" onmouseout="setBackGrdColor(this, 'mouseout');" style="width: { $thumb_container_width }px; height: { $thumb_container_height }px;">
- <a href="javascript:showImage({$images[thumb]}, 'scrollup');" id="thumblink{$images[thumb]}" name="image{$img_id[thumb]}" class="thumblink" onclick="click(this);" title="{$img_title[thumb]}">
+ { if $user_friendly_url }
+ <a href="{$web_path}/photoview/{$images[thumb]}" onclick="showImage({$images[thumb]}, 'scrollup'); return false;" id="thumblink{$images[thumb]}" name="image{$img_id[thumb]}" class="thumblink" onfocus="click(this);" title="{$img_title[thumb]}">
+ { else }
+ <a href="{$web_path}/index.php?mode=showp&amp;id={$images[thumb]}" onclick="showImage({$images[thumb]}, 'scrollup'); return false;" id="thumblink{$images[thumb]}" name="image{$img_id[thumb]}" class="thumblink" onfocus="click(this);" title="{$img_title[thumb]}">
+ { /if }
<img class="thumb" id="thumbimg{$images[thumb]}" width="{$img_width[thumb]}" height="{$img_height[thumb]}" src="{$web_path}/phpfspot_img.php?idx={$images[thumb]}&width={$width}" />
<br />
{$img_name[thumb]}