issue27, added a nice export icon
[phpfspot.git] / phpfspot.class.php
index 47ce21109e2e980f56dd160bc51182f86ebd1b0a..33d4e24ffe0a5b99469ecb75a62f23b8cf048d9a 100644 (file)
@@ -119,18 +119,14 @@ class PHPFSPOT {
 
    } // get_photo_details
 
-   public function getPhotoName($idx)
+   public function getPhotoName($idx, $limit = 0)
    {
       if($details = $this->get_photo_details($idx)) {
-
          $name = $details['name'];
-
-         if(strlen($name) > 15) {
-            $name = substr($name, 0, 10) ."...". substr($name, -10);
+         if($limit != 0 && strlen($name) > $limit) {
+            $name = substr($name, 0, $limit-5) ."...". substr($name, -($limit-5));
          }
-
          return $name;
-   
       }
 
    } // getPhotoName()
@@ -482,12 +478,14 @@ class PHPFSPOT {
       $img_width[$rows] = Array();
       $img_id[$rows] = Array();
       $img_name[$rows] = Array();
+      $img_title = Array();
 
       for($i = $begin_with; $i < $end_with; $i++) {
 
          $images[$rows][$cols] = $photos[$i];
          $img_id[$rows][$cols] = $i;
-         $img_name[$rows][$cols] = $this->getPhotoName($photos[$i]);
+         $img_name[$rows][$cols] = htmlspecialchars($this->getPhotoName($photos[$i], 15));
+         $img_title[$rows][$cols] = "Click to view photo ". htmlspecialchars($this->getPhotoName($photos[$i], 0));
 
          $thumb_path = $this->cfg->base_path ."/thumbs/". $this->cfg->thumb_width ."_". $this->getMD5($photos[$i]);
 
@@ -610,6 +608,7 @@ class PHPFSPOT {
       $this->tmpl->assign('img_height', $img_height);
       $this->tmpl->assign('img_id', $img_id);
       $this->tmpl->assign('img_name', $img_name);
+      $this->tmpl->assign('img_title', $img_title);
       $this->tmpl->assign('rows', $rows);
       $this->tmpl->assign('columns', $this->cfg->thumbs_per_row);
 
@@ -1160,7 +1159,7 @@ class PHPFSPOT {
                
             case 'MoinMoin':
                // [%pictureurl% %thumbnailurl%]
-               print htmlspecialchars("[$orig_url $thumb_url]") ."<br />\n";
+               print htmlspecialchars(" * [".$orig_url." ".$thumb_url."&fake=1.jpg]") ."<br />\n";
                break;
          }