issue13, first try of external links, this time for photo index
[phpfspot.git] / phpfspot.class.php
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);