fix conflicts during merge of Arun's tree
authorAndreas Unterkircher <unki@netshadow.at>
Sun, 11 May 2008 07:42:36 +0000 (09:42 +0200)
committerAndreas Unterkircher <unki@netshadow.at>
Sun, 11 May 2008 07:42:36 +0000 (09:42 +0200)
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
24 files changed:
CHANGELOG
phpfspot.class.php
phpfspot.js
phpfspot_cfg.php.dist
resources/16_play.png [new file with mode: 0644]
resources/export.png
resources/link.png
resources/original.png
resources/rss.png
resources/slideshow.png
resources/zoom-100.png
resources/zoom-in.png
resources/zoom-out.png
rpc.php
themes/default/stylesheet.css
themes/default/templates/export.tpl
themes/default/templates/header.tpl
themes/default/templates/index.tpl
themes/default/templates/photo_index.tpl
themes/default/templates/search.tpl
themes/default/templates/single_photo.tpl
themes/default/templates/slideshow.tpl
themes/default/templates/tags.tpl
themes/default/templates/welcome.tpl

index fe5117a1d6d5c0dc06774c5eea206a48f0026b86..a96c36163970f61e6cd402ff1f404185ab883e3f 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,6 @@
 phpfspot (1.5)
 
+  * feature, user-friendly URL's (with Apache's mod_rewrite).
   * feature, display tag-selection with preview-icons in photo index.
   * feature, support for Nikon's NEF RAW photo format (via dcraw and ImageMagick).
   * feature, auto-scroll in photo index if thumbnails are out of sight.
index eba23ca42cb0dbf8f6588c7efb3d17ddacb8dc1a..1e07ccc586ec146aa34fcc0c857b0e265e5b8c0d 100644 (file)
@@ -201,6 +201,8 @@ class PHPFSPOT {
       require_once "phpfspot_tmpl.php";
       $this->tmpl = new PHPFSPOT_TMPL();
 
+      $this->tmpl->assign('web_path', $this->cfg->web_path);
+
       /* check if all necessary indices exist */
       $this->checkDbIndices();
 
@@ -244,6 +246,11 @@ class PHPFSPOT {
       $this->tmpl->assign('current_condition', $_SESSION['tag_condition']);
       $this->tmpl->assign('template_path', 'themes/'. $this->cfg->theme_name);
 
+      /* parse URL */
+      if($this->is_user_friendly_url()) {
+         $content = $this->parse_user_friendly_url($_SERVER['REQUEST_URI']);
+      }
+
       if(isset($_GET['mode'])) {
 
          $_SESSION['start_action'] = $_GET['mode'];
@@ -306,7 +313,19 @@ class PHPFSPOT {
       $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('content_page', 'welcome.tpl');
+
+      $this->tmpl->assign('preset_selected_tags', $this->getSelectedTags());
+      $this->tmpl->assign('preset_available_tags', $this->getAvailableTags());
+
+      if(!isset($content)) {
+         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('initial_content', $content);
+
       $this->tmpl->show("index.tpl");
 
    } // show()
@@ -609,8 +628,15 @@ class PHPFSPOT {
       $this->tmpl->assign('ExifOrigResolution', $meta_res);
       $this->tmpl->assign('ExifFileSize', $meta_size);
  
-      $this->tmpl->assign('image_url', 'phpfspot_img.php?idx='. $photo ."&amp;width=". $this->cfg->photo_width);
-      $this->tmpl->assign('image_url_full', 'phpfspot_img.php?idx='. $photo);
+      if($this->is_user_friendly_url()) {
+         $this->tmpl->assign('image_url', '/photo/'. $photo ."/". $this->cfg->photo_width);
+         $this->tmpl->assign('image_url_full', '/photo/'. $photo);
+      }
+      else {
+         $this->tmpl->assign('image_url', 'phpfspot_img.php?idx='. $photo ."&amp;width=". $this->cfg->photo_width);
+         $this->tmpl->assign('image_url_full', 'phpfspot_img.php?idx='. $photo);
+      }
+
       $this->tmpl->assign('image_filename', $this->parse_uri($details['uri'], 'filename'));
 
       $this->tmpl->assign('tags', $this->get_photo_tags($photo));
@@ -631,7 +657,7 @@ class PHPFSPOT {
       $this->tmpl->assign('photo_number', $i);
       $this->tmpl->assign('photo_count', count($all_photos));
 
-      $this->tmpl->show("single_photo.tpl");
+      return $this->tmpl->fetch("single_photo.tpl");
 
    } // showPhoto()
 
@@ -708,13 +734,15 @@ 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);
-      print $output;
+      return $output;
 
    } // getAvailableTags()
 
@@ -1154,6 +1182,7 @@ class PHPFSPOT {
     *
     * this function provides all the necessary information
     * for the photo index template.
+    * @return string
     */
    public function showPhotoIndex()
    {
@@ -1339,17 +1368,19 @@ class PHPFSPOT {
       $this->tmpl->assign('thumbs', $thumbs);
       $this->tmpl->assign('selected_tags', $this->getSelectedTags('img'));
 
-      $this->tmpl->show("photo_index.tpl");
+      $result = $this->tmpl->fetch("photo_index.tpl");
 
       /* if we are returning to photo index from an photo-view,
          scroll the window to the last shown photo-thumbnail.
          after this, unset the last_photo session variable.
       */
       if(isset($_SESSION['last_photo'])) {
-         print "<script language=\"JavaScript\">moveToThumb(". $_SESSION['last_photo'] .");</script>\n";
+         $result.= "<script language=\"JavaScript\">moveToThumb(". $_SESSION['last_photo'] .");</script>\n";
          unset($_SESSION['last_photo']);
       }
 
+      return $result;
+
    } // showPhotoIndex()
 
    /**
@@ -2263,7 +2294,7 @@ class PHPFSPOT {
 
       foreach($pictures as $picture) {
 
-         $orig_url = $this->get_phpfspot_url() ."index.php?mode=showp&id=". $picture;
+         $orig_url = $this->get_phpfspot_url() ."/index.php?mode=showp&id=". $picture;
          if($current_tags != "") {
             $orig_url.= "&tags=". $current_tags;
          } 
@@ -2271,7 +2302,12 @@ class PHPFSPOT {
             $orig_url.= "&from_date=". $_SESSION['from_date'] ."&to_date=". $_SESSION['to_date'];
          }
 
-         $thumb_url = $this->get_phpfspot_url() ."phpfspot_img.php?idx=". $picture ."&width=". $this->cfg->thumb_width;
+         if($this->is_user_friendly_url()) {
+            $thumb_url = $this->get_phpfspot_url() ."/photo/". $picture ."/". $this->cfg->thumb_width;
+         }
+         else {
+            $thumb_url = $this->get_phpfspot_url() ."/phpfspot_img.php?idx=". $picture ."&width=". $this->cfg->thumb_width;
+         }
 
          switch($mode) {
 
@@ -2320,7 +2356,7 @@ class PHPFSPOT {
 
       foreach($pictures as $picture) {
 
-         $orig_url = $this->get_phpfspot_url() ."index.php?mode=showp&id=". $picture;
+         $orig_url = $this->get_phpfspot_url() ."/index.php?mode=showp&id=". $picture;
          if($current_tags != "") {
             $orig_url.= "&tags=". $current_tags;
          } 
@@ -2330,7 +2366,13 @@ class PHPFSPOT {
 
          $details = $this->get_photo_details($picture);
 
-         $thumb_url = $this->get_phpfspot_url() ."phpfspot_img.php?idx=". $picture ."&width=". $this->cfg->thumb_width;
+         if($this->is_user_friendly_url()) {
+            $thumb_url = $this->get_phpfspot_url() ."/photo/". $picture ."/". $this->cfg->thumb_width;
+         }
+         else {
+            $thumb_url = $this->get_phpfspot_url() ."/phpfspot_img.php?idx=". $picture ."&width=". $this->cfg->thumb_width;
+         }
+
          $thumb_html = htmlspecialchars("
 <a href=\"". $orig_url ."\"><img src=\"". $thumb_url ."\" /></a>
 <br>
@@ -2407,7 +2449,6 @@ class PHPFSPOT {
    public function whatToDo()
    {
       if(isset($_SESSION['current_photo']) && $_SESSION['start_action'] == 'showp') {
-         return "show_photo";
       }
       elseif(isset($_SESSION['selected_tags']) && !empty($_SESSION['selected_tags'])) {
          return "showpi_tags";
@@ -2416,8 +2457,6 @@ class PHPFSPOT {
          return "showpi";
       }
 
-      return "nothing special";
-
    } // whatToDo()
 
    /**
@@ -2513,7 +2552,11 @@ class PHPFSPOT {
       else
          $_SESSION['slideshow_img']++;
 
-      return $this->get_phpfspot_url() ."phpfspot_img.php?idx=". $all_photos[$_SESSION['slideshow_img']] ."&width=". $this->cfg->photo_width;
+      if($this->is_user_friendly_url()) {
+         return $this->get_phpfspot_url() ."/photo/". $all_photos[$_SESSION['slideshow_img']] ."/". $this->cfg->photo_width;
+      }
+
+      return $this->get_phpfspot_url() ."/phpfspot_img.php?idx=". $all_photos[$_SESSION['slideshow_img']] ."&width=". $this->cfg->photo_width;
 
    } // getNextSlideShowImage()
 
@@ -2533,7 +2576,11 @@ class PHPFSPOT {
       else
          $_SESSION['slideshow_img']--;
 
-      return $this->get_phpfspot_url() ."phpfspot_img.php?idx=". $all_photos[$_SESSION['slideshow_img']] ."&width=". $this->cfg->photo_width;
+      if($this->is_user_friendly_url()) {
+         return $this->get_phpfspot_url() ."/photo/". $all_photos[$_SESSION['slideshow_img']] ."/". $this->cfg->photo_width;
+      }
+
+      return $this->get_phpfspot_url() ."/phpfspot_img.php?idx=". $all_photos[$_SESSION['slideshow_img']] ."&width=". $this->cfg->photo_width;
 
    } // getPrevSlideShowImage()
 
@@ -2734,6 +2781,7 @@ class PHPFSPOT {
    private function get_phpfspot_url()
    {
       return $this->get_web_protocol() ."://". $this->get_server_name() . $this->cfg->web_path;
+
    } // get_phpfspot_url()
 
    /**
@@ -2926,9 +2974,11 @@ class PHPFSPOT {
 
       }
 
-      /* check for pending slash on web_path */
-      if(!preg_match("/\/$/", $this->cfg->web_path))
-         $this->cfg->web_path.= "/";
+      /* remove trailing slash, if set */
+      if($this->cfg->web_path == "/")
+         $this->cfg->web_path = "";
+      elseif(preg_match('/\/$/', $this->cfg->web_path))
+         $this->cfg->web_path = preg_replace('/\/$/', '', $this->cfg->web_path);
 
       return $this->runtime_error;
 
@@ -3045,6 +3095,67 @@ class PHPFSPOT {
       
    } // get_tag_name()
 
+   /**
+    * parse user friendly url which got rewritten by the websever
+    * @param string $request_uri
+    * @return string
+    */
+   private function parse_user_friendly_url($request_uri)
+   {
+      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])) {
+                  $_GET['mode'] = 'showp';
+                  return $this->showPhoto($options[2]);
+               }
+               break;
+            case 'photo':
+               if(is_numeric($options[2])) {
+                  require_once "phpfspot_img.php";
+                  $img = new PHPFSPOT_IMG;
+                  if(isset($options[3]) && is_numeric($options[3]))
+                     $img->showImg($options[2], $options[3]);
+                  else
+                     $img->showImg($options[2]);
+               }
+               exit;
+               break;
+            case 'tag':
+               if(is_numeric($options[2])) {
+                  $_GET['tags'] = $options[2];
+                  $_SESSION['selected_tags'] = Array($options[2]);
+                  return $this->showPhotoIndex();
+               }
+               break;
+         }
+      }
+
+   } // parse_user_friendly_url()
+
+   /**
+    * check if user-friendly-urls are enabled
+    *
+    * this function will return true, if the config option
+    * $user_friendly_url has been set. Otherwise false.
+    * @return boolean
+    */
+   private function is_user_friendly_url()
+   {
+      if(isset($this->cfg->user_friendly_url) && $this->cfg->user_friendly_url)
+         return true;
+
+      return false;
+
+   } // is_user_friendly_url()
+
+
 } // class PHPFSPOT
 
 ?>
index 6c0054dfe2f80cbd737f30b2be72a8a9b243f0d9..ae202a0c004f69d0e7eb792c19f62711d787b571 100644 (file)
@@ -42,7 +42,7 @@ function showImage(id, scrollup)
    }
 
    /* fetch single-photo view from server */
-   HTML_AJAX.replace(content, encodeURI('rpc.php?action=showphoto&id=' + id));
+   HTML_AJAX.replace(content, encodeURI(web_path + '/rpc.php?action=showphoto&id=' + id));
 
    /* scroll the window up to the top */
    if(scrollup != undefined) {
@@ -101,7 +101,7 @@ function findPos(obj, direction) {
 function showCredits()
 {
    var credits = document.getElementById("content");
-   credits.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=showcredits'));
+   credits.innerHTML = HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=showcredits'));
 
 } // showCredits()
 
@@ -136,7 +136,7 @@ function Tags(mode, id)
       objTemp['mode'] = id.value;
    }
 
-   var retr = HTML_AJAX.post('rpc.php', objTemp);
+   var retr = HTML_AJAX.post(web_path + '/rpc.php', objTemp);
    if(retr == "ok") {
       refreshAvailableTags();
       refreshSelectedTags();
@@ -159,8 +159,10 @@ function refreshAvailableTags()
 {
    // update available tags
    var avail_tags = document.getElementById('available_tags');
-   avail_tags.innerHTML = "Loading...";
-   avail_tags.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_available_tags'));
+   if(avail_tags != undefined) {
+      avail_tags.innerHTML = "Loading...";
+      avail_tags.innerHTML = HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=show_available_tags'));
+   }
 
 } // refreshAvailableTags()
 
@@ -174,8 +176,10 @@ function refreshSelectedTags()
 {
    // update selected tags
    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(selected_tags != undefined) {
+      selected_tags.innerHTML = "Loading...";
+      selected_tags.innerHTML = HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=show_selected_tags'));
+   }
 
 } // refreshSelectedTags()
 
@@ -188,7 +192,7 @@ function refreshSelectedTags()
  */
 function showPhotoIndex(begin_with, last_photo)
 {
-   var url = "rpc.php?action=show_photo_index";
+   var url = web_path + "/rpc.php?action=show_photo_index";
    if(begin_with != undefined)
       url = url + '&begin_with=' + begin_with;
    if(last_photo != undefined)
@@ -284,7 +288,7 @@ function startSearch()
       objTemp['to'] = to;
    }
 
-   var retr = HTML_AJAX.post('rpc.php', objTemp);
+   var retr = HTML_AJAX.post(web_path + '/rpc.php', objTemp);
    if(retr == "ok") {
       refreshAvailableTags();
       refreshSelectedTags();
@@ -329,7 +333,7 @@ function setViewMode(mode)
 {
    var exprt = document.getElementById('output');
    exprt.innerHTML = "Loading...";
-   exprt.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=get_export&mode=' + mode));
+   exprt.innerHTML = HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=get_export&mode=' + mode));
 
 } // setViewMode()
 
@@ -354,7 +358,8 @@ function clearSearch()
  */
 function AskServerWhatToDo()
 {
-   return HTML_AJAX.grab(encodeURI('rpc.php?action=what_to_do'));
+   return HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=what_to_do'));
+
 } // AskServerWhatToDo()
 
 /**
@@ -364,11 +369,22 @@ function AskServerWhatToDo()
  * the first time. It will fetch the tag-lists and will then
  * switch to the right view, which the browser got told from
  * the server (maybe someone hit the refresh button...).
+ *
+ * as parameter the server can set the correct webpath.
+ * espacialley when using user-friendly url's, the browser
+ * does not know the correct URLs to address images, stylesheets,
+ * ... then.
  */
-function init_phpfspot(mode)
+function init_phpfspot(srv_webpath)
 {
+   if(srv_webpath != undefined)
+      web_path = srv_webpath;
+   else
+      web_path = '';
+
    /* always load list of available tags */
-   refreshAvailableTags();
+   //this should not be more necessary since 4.5.08
+   //refreshAvailableTags();
 
    /* ask the server what we are currently displaying */
    whattodo = AskServerWhatToDo();
@@ -413,7 +429,7 @@ function setBackGrdColor(item, color)
  */
 function getPhotoToShow()
 {
-   var photo_to_show = HTML_AJAX.grab(encodeURI('rpc.php?action=get_photo_to_show'));
+   var photo_to_show = HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=get_photo_to_show'));
 
    // if no image needs to be shown, return false from here
    if(photo_to_show == "")
@@ -523,7 +539,7 @@ function showCalendar(date_box, click_obj)
    if(calendar.style.visibility == "" || calendar.style.visibility == 'hidden') {
       calendar.style.visibility = 'visible';
       calendar.innerHTML = "Loading...";
-      calendar.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=get_calendar_matrix&year=' + year + '&month=' + month));
+      calendar.innerHTML = HTML_AJAX.grab(encodeURI(web_path +'/rpc.php?action=get_calendar_matrix&year=' + year + '&month=' + month));
       calendar_shown = 1;
    }
    else {
@@ -551,7 +567,7 @@ function setMonth(year, month, day)
 {
    var calendar = document.getElementById('calendar');
    calendar.innerHTML = "Loading...";
-   calendar.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=get_calendar_matrix&year='+ year +'&month='+ month +'&day='+ day));
+   calendar.innerHTML = HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=get_calendar_matrix&year='+ year +'&month='+ month +'&day='+ day));
 }
 
 /**
@@ -572,7 +588,7 @@ function setCalendarDate(year, month, day)
  */
 function resetAll()
 {
-   HTML_AJAX.grab(encodeURI('rpc.php?action=reset'));
+   HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=reset'));
    clearSearch();
    refreshAvailableTags();
    refreshSelectedTags();
@@ -650,15 +666,15 @@ function noop() {}
 function startSlideShow()
 {
    if(!sliding) {
-      HTML_AJAX.grab(encodeURI('rpc.php?action=reset_slideshow'));
+      HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=reset_slideshow'));
       nextSlide();
       sliding = setInterval("nextSlide()", sliding_time*1000);
-      document.getElementById('stop_ico').src = "resources/32_stop.png";
+      document.getElementById('stop_ico').src = web_path + "/resources/32_stop.png";
    }
    else {
       clearInterval(sliding);
       sliding = 0;
-      document.getElementById('stop_ico').src = "resources/32_play.png";
+      document.getElementById('stop_ico').src = web_path + "/resources/32_play.png";
    }
 
 } // startSlideShow()
@@ -668,7 +684,7 @@ function startSlideShow()
  */
 function nextSlide()
 {
-   var next_img = HTML_AJAX.grab(encodeURI('rpc.php?action=get_next_slideshow_img'));
+   var next_img = HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=get_next_slideshow_img'));
    document.getElementById('slide_img').src = next_img;
 
 } // nextSlide()
@@ -678,7 +694,7 @@ function nextSlide()
  */
 function prevSlide()
 {
-   var prev_img = HTML_AJAX.grab(encodeURI('rpc.php?action=get_prev_slideshow_img'));
+   var prev_img = HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=get_prev_slideshow_img'));
    document.getElementById('slide_img').src = prev_img;
 
 } // prevSlide()
@@ -691,12 +707,12 @@ function pauseSlideShow()
    if(!sliding_paused) {
       sliding_paused = 1;
       clearInterval(sliding);
-      document.getElementById('pause_ico').src = "resources/32_play.png";
+      document.getElementById('pause_ico').src = web_path + "/resources/32_play.png";
    }
    else {
       sliding_paused = 0;
       sliding = setInterval("nextSlide()", sliding_time*1000);
-      document.getElementById('pause_ico').src = "resources/32_pause.png";
+      document.getElementById('pause_ico').src = web_path + "/resources/32_pause.png";
    }
 
 } // pauseSlideShow()
@@ -713,7 +729,7 @@ function startAutoBrowse()
    else {
       clearInterval(autobrowse);
       autobrowse = 0;
-      document.getElementById('autobrowse_ico').src = "resources/32_play.png";
+      document.getElementById('autobrowse_ico').src = web_path + "/resources/32_play.png";
    }
 
 } // startAutoBrowser()
@@ -726,12 +742,12 @@ function autoBrowse()
    if(document.getElementById('next_link')) {
       var next_link = document.getElementById('next_link').href;
       window.location.href = next_link;
-      document.getElementById('autobrowse_ico').src = "resources/32_pause.png";
+      document.getElementById('autobrowse_ico').src = web_path + "/resources/32_pause.png";
    }
    /* we have reached the last photo */
    else {
       if(ab_ico = document.getElementById('autobrowse_ico'))
-         ab_ico.src = "resources/32_play.png";
+         ab_ico.src = web_path + "/resources/32_play.png";
       clearInterval(autobrowse);
    }
 
@@ -772,7 +788,7 @@ function update_sort_order(obj)
    var objTemp = new Object();
    objTemp['value'] = obj.options[obj.selectedIndex].value;
 
-   var retr = HTML_AJAX.post('rpc.php?action=update_sort_order', objTemp);
+   var retr = HTML_AJAX.post(web_path + '/rpc.php?action=update_sort_order', objTemp);
 
    if(retr == "ok") {
       showPhotoIndex();
@@ -841,3 +857,4 @@ var origHeight;
 var origWidth;
 // position of the last shown photo in photo-index
 var photo_details_pos;
+var web_path;
index 4eb5894fe4de1d04809f813972379204b0279ee8..3793c541414d7da39735a62937a24e3a4090a2fa 100644 (file)
@@ -116,6 +116,9 @@ class PHPFSPOT_CFG {
    /* path to dcraw to decode Nikon's NEF format */
    // var $dcraw_bin = "/usr/bin/dcraw";
 
+   /* user friendly URLs */
+   var $user_friendly_url = false;
+
    public function __construct()
    {
 
diff --git a/resources/16_play.png b/resources/16_play.png
new file mode 100644 (file)
index 0000000..ca1d222
Binary files /dev/null and b/resources/16_play.png differ
index 130d7619a737e199ba903a938ec31de1949da8d8..b2391c303b8d4c0a45e52081c14c93bd0242b17e 100644 (file)
Binary files a/resources/export.png and b/resources/export.png differ
index 4a2a843671e00afcd0c4b0a8eaba66ffa6c971c8..f6afa174a9c63edcd34a2958fe050e549d28ae34 100644 (file)
Binary files a/resources/link.png and b/resources/link.png differ
index 67e14b840d4b047371e4db82144c0bd6b3c78158..c5772b9ed3b6e63f7964f27deca51b8d14916d08 100644 (file)
Binary files a/resources/original.png and b/resources/original.png differ
index 4a74d4bf38fcec07d5414111b1050bcd1886ea8f..9bc86f78e4f5ca484ee9fcdbfb73a14238725e87 100644 (file)
Binary files a/resources/rss.png and b/resources/rss.png differ
index 4a9c6d5633a54eed5c985a9cff32443f032b21de..8e11a1f16de000b01d19264ef9c58c14a845ce57 100644 (file)
Binary files a/resources/slideshow.png and b/resources/slideshow.png differ
index aad8b325dbb68ea69f7f18fe45469c71034ca353..9ed4da61a407501a46075a301e4a6551a912f2f0 100644 (file)
Binary files a/resources/zoom-100.png and b/resources/zoom-100.png differ
index b63f0e54fdde4bd7d394414fedecda22c2f3fc48..ea7e42ff68feb8f07c42c1935e45a6bdea0c32e6 100644 (file)
Binary files a/resources/zoom-in.png and b/resources/zoom-in.png differ
index 31034a0089515498202f37fd32341006ec0c13af..2802bb2d44182983a6e666bbb41dae12349467c3 100644 (file)
Binary files a/resources/zoom-out.png and b/resources/zoom-out.png differ
diff --git a/rpc.php b/rpc.php
index bdb62069eb11d7d6605f97f463b0d07c510b24d4..f4a93ce6eb728a8232616ec6584a558e762cb19b 100644 (file)
--- a/rpc.php
+++ b/rpc.php
@@ -65,7 +65,7 @@ class PHPFSPOT_RPC {
       switch($action) {
          case 'showphoto':
             if(isset($_GET['id']) && is_numeric($_GET['id'])) {
-               $phpfspot->showPhoto($_GET['id']);
+               print $phpfspot->showPhoto($_GET['id']);
             }
             break;
    
@@ -117,7 +117,7 @@ class PHPFSPOT_RPC {
             if(isset($_GET['last_photo']) && is_numeric($_GET['last_photo']))
                $_SESSION['last_photo'] = $_GET['last_photo'];
 
-            $phpfspot->showPhotoIndex();
+            print $phpfspot->showPhotoIndex();
             break;
    
          case 'showcredits':
index 9fe2c4e5bfb5193b5dab35e3773978ae21b818f2..93e56b79cedf4ce32fd411d3bca32ed2430d17c6 100644 (file)
@@ -326,4 +326,4 @@ input, select, textarea {
 
 #slider-1{ 
    margin:                 0 auto;
-}
\ No newline at end of file
+}
index 364786323f0a3c8c92d27b68475acfbdd5829109..7f6f2de9ec0a00a3368ce4dbb08a2cf042cf84ad 100644 (file)
@@ -7,7 +7,7 @@
     <option value="MoinMoin">MoinMoin Wiki</option>
     <option value="MoinMoinList">MoinMoin Wiki List</option>
    </select>
-   <input type="image" src="resources/doit.png" alt="Switch View" />
+   <input type="image" src="{$web_path}/resources/doit.png" alt="Switch View" />
   </form>
   <div id="output"></div>
  </body>
index 39b42ca6d12d44d2114ec5291fbccb31f02f73f6..c1d7a0cd694a5f0ad469359ee51a9227e5c49cad 100644 (file)
@@ -3,19 +3,19 @@
  <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>{$page_title}</title>
-  <link href="{$template_path}/stylesheet.css" type="text/css" rel="stylesheet" />
-  <script type="text/javascript" src="rpc.php?mode=init&amp;client=all"></script>
-  <script type="text/javascript" src="phpfspot.js"></script>
-  <link rel="shortcut icon" href="resources/gpl_16.png" type="image/png" />
-  <link rel="icon" href="resources/gpl_16.png" type="image/png" />
+  <link href="{$web_path}/{$template_path}/stylesheet.css" type="text/css" rel="stylesheet" />
+  <script type="text/javascript" src="{$web_path}/rpc.php?mode=init&amp;client=all"></script>
+  <script type="text/javascript" src="{$web_path}/phpfspot.js"></script>
+  <link rel="shortcut icon" href="{$web_path}/resources/gpl_16.png" type="image/png" />
+  <link rel="icon" href="{$web_path}/resources/gpl_16.png" type="image/png" />
   { if $use_lightbox }
-  <script type="text/javascript" src="lightbox2/js/prototype.js"></script>
-  <script type="text/javascript" src="lightbox2/js/scriptaculous.js?load=effects,builder"></script>
-  <script type="text/javascript" src="lightbox2/js/lightbox.js"></script>
-  <link rel="stylesheet" href="lightbox2/css/lightbox.css" type="text/css" media="screen" />
+  <script type="text/javascript" src="{$web_path}/lightbox2/js/prototype.js"></script>
+  <script type="text/javascript" src="{$web_path}/lightbox2/js/scriptaculous.js?load=effects,builder"></script>
+  <script type="text/javascript" src="{$web_path}/lightbox2/js/lightbox.js"></script>
+  <link rel="stylesheet" href="{$web_path}/lightbox2/css/lightbox.css" type="text/css" media="screen" />
   { /if }
   { if $use_autocomplete }
-  <script type="text/javascript" src="autosuggest/js/bsn.AutoSuggest_2.1.3_comp.js"></script>
-  <link rel="stylesheet" href="autosuggest/css/autosuggest_inquisitor.css" type="text/css" media="screen" charset="utf-8" />
+  <script type="text/javascript" src="{$web_path}/autosuggest/js/bsn.AutoSuggest_2.1.3_comp.js"></script>
+  <link rel="stylesheet" href="{$web_path}/autosuggest/css/autosuggest_inquisitor.css" type="text/css" media="screen" charset="utf-8" />
   { /if }
  </head>                                                                                                      
index 87c58b9065a3a7e0c6a32050c51412399fd0f571..694f86a88fe8d977b9972902008d08b759206ab3 100644 (file)
@@ -1,10 +1,10 @@
 {include file="header.tpl"}
- <body onload="init_phpfspot();">
+ <body onload="init_phpfspot('{$web_path}');">
  
   <!-- loading -->
 
   <div id="HTML_AJAX_LOADING">
-   <img src="resources/loading.gif" style="vertical-align: middle;" alt="Loading..." />&nbsp;&nbsp;Loading...
+   <img src="{$web_path}/resources/loading.gif" style="vertical-align: middle;" alt="Loading..." />&nbsp;&nbsp;Loading...
   </div>
 
   <!-- top menu -->
   <div class="menu">
    <div class="icons">
     <a href="javascript:showPhotoIndex();" onclick="click(this);" title="Show Photo Index (CTRL+ALT+i)">
-     <img src="resources/photo_index.png" alt="photo index" />
+     <img src="{$web_path}/resources/photo_index.png" alt="photo index" />
     </a>
     <a href="javascript:resetAll();" onclick="click(this);" title="Reset selected-tags and search results (CTRL+ALT+r)">
-     <img src="resources/reload.png" alt="reset tags" />
+     <img src="{$web_path}/resources/reload.png" alt="reset tags" />
     </a>
     <a href="javascript:showCredits();" onclick="click(this);" title="Show's a little credit page">
-     <img src="resources/credits.png" alt="show credits" />
+     <img src="{$web_path}/resources/credits.png" alt="show credits" />
     </a>
    </div>
    <div class="logo">&nbsp;{$page_title}</div>
@@ -39,7 +39,7 @@
 
   <!-- content column -->
   <div id="content" class="content">
-   {include file="welcome.tpl"}
+   { $initial_content }
   </div>
   </div>
 
index 413ec2668f6713d70f1b54c4e5c0aa2af2b58116..2dedf86d89e3fbb1c4c1f1bba9e4d822ccce64f7 100644 (file)
@@ -1,4 +1,7 @@
 <!-- Photo Index -->
+
+<!-- Header - displays count of matched photos and some link's -->
+
 <div class="header">
  <div class="subheader">
   <b>Photo Index</b>
  </div>
 <div class="textright">
   {if $slideshow_link }
-   <a href="{$slideshow_link}" title="Slideshow" target="_blank"><img src="resources/slideshow.png" /></a>
+   <a href="{$slideshow_link}" title="Slideshow" target="_blank"><img src="{$web_path}/resources/slideshow.png" />&nbsp;Slideshow</a>
   {/if}
   {if $extern_link }
-   <a href="{$extern_link}" title="Use this link to return to the current view"><img src="resources/link.png" /></a>
+   <a href="{$extern_link}" title="Use this link to return to the current view"><img src="{$web_path}/resources/link.png" />&nbsp;External Link</a>
   {/if} 
   {if $export_link }
-   <a href="{$export_link}" target="_blank" title="this will open a new browser window where you can export this page in several formats"><img src="resources/export.png" /></a>
+   <a href="{$export_link}" target="_blank" title="this will open a new browser window where you can export this page in several formats"><img src="{$web_path}/resources/export.png" />&nbsp;Export</a>
   {/if}
   {if $rss_link }
-   <a href="{$rss_link}" target="_blank" title="RSS feed"><img src="resources/rss.png" /></a>
+   <a href="{$rss_link}" target="_blank" title="RSS feed"><img src="{$web_path}/resources/rss.png" />&nbsp;RSS-Feed</a>
   {/if}
  </div>
 </div>
+
+<!-- if result of a tag-search is displayed, show the selected tags
+     with some small pictures in a bar. -->
+
 { if $tag_result }
 <div class="tagresult"></div>
 <div class="subheader">
@@ -51,6 +58,8 @@
 </div>
 { /if }
 
+<!-- the photo matrix itself -->
+
 <div id="index">
 
  {section name="thumb" loop=$thumbs step=1}
@@ -64,7 +73,7 @@
     {$img_name[thumb]}
     </a>
     { if $use_lightbox }
-    <a href="phpfspot_img.php?idx={$images[thumb]}&amp;width={$preview_width}" alt="thumb_{$images[thumb]}" rel="lightbox[photoidx]" title="Preview of {$img_fullname[thumb]}"><img src="resources/eyes.png" /></a>
+    <a href="{$web_path}/phpfspot_img.php?idx={$images[thumb]}&amp;width={$preview_width}" alt="thumb_{$images[thumb]}" rel="lightbox[photoidx]" title="Preview of {$img_fullname[thumb]}"><img src="{$web_path}/resources/eyes.png" /></a>
     { /if }
    </div>
 
  <div class="indexnavigationright">
  { if $next_url == "" }
   { if $count != 0 }
-   <img src="resources/arrow_right_gray.png" alt="last page reached" />
+   <img src="{$web_path}/resources/arrow_right_gray.png" alt="last page reached" />
   { /if }
  { else }
   <a href="{$next_url}" id="next_link" title="click for the next page (right cursor)">
-   <img src="resources/arrow_right.png" alt="next photo" />
+   <img src="{$web_path}/resources/arrow_right.png" alt="next photo" />
   </a>
  { /if}
  </div>
  <div class="indexnavigationleft">
  { if $previous_url == "" }
   { if $count != 0 }
-   <img src="resources/arrow_left_gray.png" alt="first page reached" />
+   <img src="{$web_path}/resources/arrow_left_gray.png" alt="first page reached" />
   { /if }
  { else }
   <a href="{$previous_url}" id="prev_link" title="click for the previous page (left cursor)">
-  <img src="resources/arrow_left.png" alt="previous photo" />
+  <img src="{$web_path}/resources/arrow_left.png" alt="previous photo" />
   </a>
  { /if }
  </div>
 
    {section name="thumb" loop=$thumbs step=1}
       {if $images[thumb] }
-         image_urls[{counter}] = 'phpfspot_img.php?idx={$images[thumb]}&width={$width}';
+         image_urls[{counter}] = '{$web_path}/phpfspot_img.php?idx={$images[thumb]}&width={$width}';
          last_thumb = {$images[thumb]};
       {/if}
    {/section}
index 77ed7adbadc2d9dfe079361e89e54699b6c02b9e..401d9af937ae3b61addcaa2402fc5699419196fb 100644 (file)
@@ -1,5 +1,5 @@
 <span class="tags">
- <img src="resources/loupe.png" alt="loupe" />Search:
+ <img src="{$web_path}/resources/loupe.png" alt="loupe" />Search:
 </span>
 <form action="" onsubmit="startSearch(); return false;">
 <div class="searchfor">
@@ -25,7 +25,7 @@
    { /if }
   </td>
   <td>
-   <input type="image" class="submit" src="resources/doit.png" alt="start search" title="start search" onclick="click(this);" />
+   <input type="image" class="submit" src="{$web_path}/resources/doit.png" alt="start search" title="start search" onclick="click(this);" />
   </td>
  </tr>
  <tr>
@@ -34,7 +34,7 @@
    <input type="text" name="searchfor_name" value="{$searchfor_name}" size="15" />
   </td>
   <td>
-   <input type="image" class="submit" src="resources/doit.png" alt="start search" title="start search" onclick="click(this);" />
+   <input type="image" class="submit" src="{$web_path}/resources/doit.png" alt="start search" title="start search" onclick="click(this);" />
   </td>
  </tr>
  <tr>
  </tr>
  <tr>
   <td>&nbsp;</td>
-  <td>{$from_date} <a href="javascript:showCalendar('from');" onclick="click(this);"><img src="resources/date.png" id="frompic" alt="from" /></a></td>
+  <td>{$from_date} <a href="javascript:showCalendar('from');" onclick="click(this);"><img src="{$web_path}/resources/date.png" id="frompic" alt="from" /></a></td>
  </tr>
  <tr>
   <td>&nbsp;</td>
   <td>
-   {$to_date} <a href="javascript:showCalendar('to');" onclick="click(this);"><img src="resources/date.png" id="topic" alt="to" /></a>
+   {$to_date} <a href="javascript:showCalendar('to');" onclick="click(this);"><img src="{$web_path}/resources/date.png" id="topic" alt="to" /></a>
   </td>
   <td>
-   <input type="image" class="submit" src="resources/doit.png" alt="start search" title="start search" onclick="click(this);" />
+   <input type="image" class="submit" src="{$web_path}/resources/doit.png" alt="start search" title="start search" onclick="click(this);" />
   </td>
  </tr>
  <tr>
index b6cdecbe7da1b6cdc4fd1a35dad5d971674c9237..571b524b90a39f277d778650906c0828b47b8b1a 100644 (file)
@@ -20,7 +20,7 @@
   <a href="javascript:zoom(10);" title="zoom_in" onclick="click(this);"><img src="resources/zoom-in.png" /></a>
   <a href="javascript:startAutoBrowse();" title="auto browsing"><img id="autobrowse_ico" src="resources/32_play.png" /></a>
   {if $extern_link }
-   <a href="{$extern_link}" title="Use this link to return to the current view"><img src="resources/link.png" /></a>
+   <a href="{$extern_link}" title="Use this link to return to the current view"><img src="{$web_path}/resources/link.png" />&nbsp;External Link</a>
   {/if}
   <a href="{$image_url_full}" title="orig_image" target="_blank" onclick="click(this);">
    <img src="resources/original.png" alt="original resolution" />
 <div>
  <div id="photo_details">
    { if $ExifMadeWith }
-   <u><img src="resources/camera.png" alt="camera icon" />&nbsp;Image taken with:</u><br />
+   <u><img src="{$web_path}/resources/camera.png" alt="camera icon" />&nbsp;Image taken with:</u><br />
    {$ExifMadeWith}<br />
    { /if }
    { if $ExifMadeOn }
-   <u><img src="resources/date.png" alt="calendar icon" />&nbsp;Image made on:</u><br />
+   <u><img src="{$web_path}/resources/date.png" alt="calendar icon" />&nbsp;Image made on:</u><br />
    {$ExifMadeOn}<br />
    { /if }
    { if $ExifOrigResolution }
-   <u><img src="resources/image.png" alt="resolution icon" />&nbsp;Original resolution:</u><br />
+   <u><img src="{$web_path}/resources/image.png" alt="resolution icon" />&nbsp;Original resolution:</u><br />
    {$ExifOrigResolution}<br />
    { /if }
    <u>Size:</u>&nbsp;{$ExifFileSize}<br />
    { if $tags }
     <br />
-    <u><img src="resources/small_available_tags.png" alt="available tags" />&nbsp;Tagged with:</u><br />
+    <u><img src="{$web_path}/resources/small_available_tags.png" alt="available tags" />&nbsp;Tagged with:</u><br />
     { foreach from=$tags key=id item=name }
-    <a class="smalltag" href="javascript:Tags('add', '{$id}');" onclick="click(this);" onclick="click(this);">{$name}</a><br />
+    <a class="smalltag" href="javascript:Tags('add', '{$id}');" onfocus="click(this);">{$name}</a><br />
     { /foreach }
    { /if }
    <hr>
    { if $prev_img }
-    <u><img src="resources/photo.png" alt="photo icon" />&nbsp;Previous:</u><br />
-    <a href="{$previous_url}" onclick="click(this);" id="prev_link">
-     <img src="phpfspot_img.php?idx={$prev_img}&amp;width={$mini_width}" /><br />
+    <u><img src="{$web_path}/resources/photo.png" alt="photo icon" />&nbsp;Previous:</u><br />
+    <a href="{$previous_url}" onfocus="click(this);" id="prev_link">
+     <img src="{$web_path}/phpfspot_img.php?idx={$prev_img}&amp;width={$mini_width}" /><br />
     </a>
    { /if}
    { if $next_img }
-    <u><img src="resources/photo.png" alt="photo icon" />&nbsp;Next:</u><br />
-    <a href="{$next_url}" onclick="click(this);" id="next_link">
-     <img src="phpfspot_img.php?idx={$next_img}&amp;width={$mini_width}" /><br />
+    <u><img src="{$web_path}/resources/photo.png" alt="photo icon" />&nbsp;Next:</u><br />
+    <a href="{$next_url}" onfocus="click(this);" id="next_link">
+     <img src="{$web_path}/phpfspot_img.php?idx={$next_img}&amp;width={$mini_width}" /><br />
     </a>
    { /if}
  </div>
@@ -69,9 +69,9 @@
 
  <div class="photo">
  { if $next_url == "" }
-  <a href="javascript:showPhotoIndex();" onclick="click(this);" name="photo">
+  <a href="{$image_url}" onclick="showPhotoIndex(); return false;" onfocus="click(this);" name="photo">
  { else }
-  <a href="{$next_url}" onclick="click(this);" title="click for the next photo" name="photo">
+  <a href="{$image_url}" onclick="{$next_url}; return false;" onfocus="click(this);" title="click for the next photo" name="photo">
  { /if }
    <img src="{$image_url}" width="{$width}" height="{$height}" alt="{$image_filename}" name="photo" id="photo" />
   </a>
 
  <div class="photonavigation">
   { if $previous_url == "" }
-   <img src="resources/arrow_left_gray.png" alt="first photo reached" />
+   <img src="{$web_path}/resources/arrow_left_gray.png" alt="first photo reached" />
   { else }
-   <a href="{$previous_url}" onclick="click(this);" title="click for the previous photo (left cursor)">
-    <img src="resources/arrow_left.png" alt="previous photo" />
+   <a href="{$previous_url}" onfocus="click(this);" title="click for the previous photo (left cursor)">
+    <img src="{$web_path}/resources/arrow_left.png" alt="previous photo" />
    </a>
   { /if }
-   <a href="javascript:showPhotoIndex({$current_page}, {$current_img});" onclick="click(this);" title="click to go back to the index">
-    <img src="resources/arrow_up.png" alt="photo index" />
+   <a href="javascript:showPhotoIndex({$current_page}, {$current_img});" onfocus="click(this);" title="click to go back to the index">
+    <img src="{$web_path}/resources/arrow_up.png" alt="photo index" />
    </a>
   { if $next_url == "" }
-   <img src="resources/arrow_right_gray.png" alt="last photo reached" />
+   <img src="{$web_path}/resources/arrow_right_gray.png" alt="last photo reached" />
   { else }
-   <a href="{$next_url}" onclick="click(this);" title="click for the next photo (right cursor)"> 
-    <img src="resources/arrow_right.png" alt="next photo" />
+   <a href="{$next_url}" onfocus="click(this);" title="click for the next photo (right cursor)">
+    <img src="{$web_path}/resources/arrow_right.png" alt="next photo" />
    </a>
   { /if}
  </div>
 
    /* lets preload to previous and the next image to speedup */
    var image_next = new Image();
-   image_next.src = "phpfspot_img.php?idx={$next_img}&width={$photo_width}";
+   image_next.src = "{$web_path}/phpfspot_img.php?idx={$next_img}&width={$photo_width}";
    var image_prev = new Image();
-   image_prev.src = "phpfspot_img.php?idx={$prev_img}&width={$photo_width}";
+   image_prev.src = "{$web_path}/phpfspot_img.php?idx={$prev_img}&width={$photo_width}";
 
 -->
 </script>
index 22c86a894a8d4e8cfcb0d72053e0e8fbcb4ec5fd..9a8f1fe7adfca8d85e192ee8808568d29e5ad95a 100644 (file)
@@ -1,14 +1,14 @@
 {include file="header.tpl"}
- <script type="text/javascript" src="slider/js/range.js"></script>
- <script type="text/javascript" src="slider/js/timer.js"></script>
- <script type="text/javascript" src="slider/js/slider.js"></script>
- <link type="text/css" rel="StyleSheet" href="slider/css/bluecurve/bluecurve.css" />
+ <script type="text/javascript" src="{$web_path}/slider/js/range.js"></script>
+ <script type="text/javascript" src="{$web_path}/slider/js/timer.js"></script>
+ <script type="text/javascript" src="{$web_path}/slider/js/slider.js"></script>
+ <link type="text/css" rel="StyleSheet" href="{$web_path}/slider/css/bluecurve/bluecurve.css" />
  <body onload="startSlideShow();" class="slideshow">
   <div id="slide_navigation">
-   <a href="javascript:prevSlide();" onclick="click(this);" title="slive to previous photo"><img id="rew_ico" src="resources/32_rew.png" /></a>
-   <a href="javascript:pauseSlideShow();" onclick="click(this);"><img id="pause_ico" src="resources/32_pause.png" /></a>
-   <a href="javascript:startSlideShow();" onclick="click(this);" title="stop and revert slideshow"><img id="stop_ico" src="resources/32_stop.png" /></a>
-   <a href="javascript:nextSlide();" onclick="click(this);" title="slide to next photo"><img id="fwd_ico" src="resources/32_fwd.png" /></a>
+   <a href="javascript:prevSlide();" onclick="click(this);" title="slive to previous photo"><img id="rew_ico" src="{$web_path}/resources/32_rew.png" /></a>
+   <a href="javascript:pauseSlideShow();" onclick="click(this);"><img id="pause_ico" src="{$web_path}/resources/32_pause.png" /></a>
+   <a href="javascript:startSlideShow();" onclick="click(this);" title="stop and revert slideshow"><img id="stop_ico" src="{$web_path}/resources/32_stop.png" /></a>
+   <a href="javascript:nextSlide();" onclick="click(this);" title="slide to next photo"><img id="fwd_ico" src="{$web_path}/resources/32_fwd.png" /></a>
   </div>
   <div id="slide_close">
    <a href="javascript:window.close();" title="click to close slideshow">
index e4b04a8d56411af3891d9a9d566fbc6601525f1c..817cfbcf2a9590bb8a18be572ed7142c70573121 100644 (file)
@@ -1,11 +1,15 @@
 <span class="tags">
- <img src="resources/available_tags.png" alt="available tags" />Available Tags:
+ <img src="{$web_path}/resources/available_tags.png" alt="available tags" />Available Tags:
 </span>
-<div id="available_tags"></div>
+<div id="available_tags">{ $preset_available_tags }</div>
 <span class="tags">
- <img src="resources/selected_tags.png" alt="selected tags" />Selected Tags:
+ <img src="{$web_path}/resources/selected_tags.png" alt="selected tags" />Selected Tags:
 </span>
  &nbsp;
  <input type="radio" name="condition" value="or" onclick="Tags('condition', this);" {if $current_condition == "or" } checked="checked" { /if } title="OR condition" />||
  <input type="radio" name="condition" value="and" onclick="Tags('condition', this);" {if $current_condition == "and" } checked="checked" { /if } title="AND condition" />&amp;&amp;
-<div id="selected_tags">no tags selected</div>
+{ if $preset_selected_tags }
+ <div id="selected_tags">{ $preset_selected_tags }</div>
+{ else }
+ <div id="selected_tags">no tags selected</div>
+{ /if }
index fbb21a1bcdbdd49218d56d8083f57a0309e5dc7e..073af0053c719591a7c73fd5be3252df9adfcbc4 100644 (file)
@@ -6,7 +6,7 @@
 
  <p>
  <span>
-   <img src="phpfspot_img.php?idx=rand&amp;width=150&amp;i=1" alt="random image" />
+   <img src="{$web_path}/phpfspot_img.php?idx=rand&amp;width=150&amp;i=1" alt="random image" />
  </span>
   This application targets to provide an easy way, to presentate your F-Spot<br />
   pictures in the web, in a way where you do not need any of the current<br />
@@ -17,7 +17,7 @@
 
  <p>
  <span>
-   <img src="phpfspot_img.php?idx=rand&amp;width=150&amp;i=2" alt="random image" />
+   <img src="{$web_path}/phpfspot_img.php?idx=rand&amp;width=150&amp;i=2" alt="random image" />
  </span>
   You can adapt this welcome page in the file "welcome.tpl" in the template<br />
   directory of your current theme.
@@ -27,7 +27,7 @@
 
  <p>
  <span>
-   <img src="phpfspot_img.php?idx=rand&amp;width=150&amp;i=3" alt="random image" />
+   <img src="{$web_path}/phpfspot_img.php?idx=rand&amp;width=150&amp;i=3" alt="random image" />
  </span>
  <a href="javascript:showPhotoIndex();">[ Click here to take a look at your photo index or select a tag from the list on the left ]</a>
  </p>