issue13, first try of external links, this time for photo index
authorAndreas Unterkircher <unki@netshadow.at>
Sun, 24 Jun 2007 18:08:49 +0000 (18:08 +0000)
committerAndreas Unterkircher <unki@netshadow.at>
Sun, 24 Jun 2007 18:08:49 +0000 (18:08 +0000)
git-svn-id: file:///var/lib/svn/phpfspot/trunk@129 fa6a889d-dae6-447d-9e79-4ba9a3039384

phpfspot.class.php
templates/photo_index.tpl

index 0a59d96c6eb804fc29fce69bc27a486815b00ddb..191e06627f9e8dfc9f13e27877eb2387763d7bbe 100644 (file)
@@ -47,8 +47,19 @@ class PHPFSPOT {
       $this->tmpl->assign('searchfor', $_SESSION['searchfor']);
       $this->tmpl->assign('page_title', $this->cfg->page_title);
       $this->tmpl->assign('current_condition', $_SESSION['tag_condition']);
+
+      switch($_GET['mode']) {
+         case 'showpi':
+            if(isset($_GET['tags'])) {
+               $_SESSION['selected_tags'] = split(',', $_GET['tags']);
+            }
+            break;
+      }
+
+      $this->tmpl->assign('content_page', 'welcome.tpl');
       $this->tmpl->show("index.tpl");
 
+
    } // show()
 
    private function get_tags()
@@ -418,7 +429,14 @@ class PHPFSPOT {
          if($end_with < $count)
             $this->tmpl->assign("next_url", "javascript:showPhotoIndex(". $next_start .");"); 
       }
-   
+
+      $current_tags = "";
+      foreach($_SESSION['selected_tags'] as $tag)
+         $current_tags.= $tag .",";
+      $current_tags = substr($current_tags, 0, strlen($current_tags)-1);
+      $extern_link = "http://". $_SERVER['SERVER_NAME'] ."/index.php?mode=showpi&tags=". $current_tags;
+
+      $this->tmpl->assign('extern_link', $extern_link);
       $this->tmpl->assign('count', $count);
       $this->tmpl->assign('width', $this->cfg->thumb_width);
       $this->tmpl->assign('images', $images);
index 6d109d0f8e953cdf22344cb780377db5835417c5..61f54d4824fd6042ef3b2476985ca41b54d2bd7f 100644 (file)
@@ -18,6 +18,7 @@
    {/if}
   </td>
   <td class="index_header" style="text-align: right;">
+   <a href="{$extern_link}">Extern</a>
    <img src="resources/photo_index.png" alt="photo index" />
   </td>
  </tr>