issue29, shorten too long names
authorAndreas Unterkircher <unki@netshadow.at>
Fri, 6 Jul 2007 17:01:45 +0000 (17:01 +0000)
committerAndreas Unterkircher <unki@netshadow.at>
Fri, 6 Jul 2007 17:01:45 +0000 (17:01 +0000)
git-svn-id: file:///var/lib/svn/phpfspot/trunk@167 fa6a889d-dae6-447d-9e79-4ba9a3039384

phpfspot.class.php

index d6d3e691902f019bab998e5abd22a291ab4f7de8..4b304a1275435ae83536041fd5eb1fa84def8e84 100644 (file)
@@ -114,9 +114,17 @@ class PHPFSPOT {
 
    public function getPhotoName($idx)
    {
-      $details = $this->get_photo_details($idx);
+      if($details = $this->get_photo_details($idx)) {
+
+         $name = $details['name'];
+
+         if(strlen($name) > 15) {
+            $name = substr($name, 0, 10) ."...". substr($name, -10);
+         }
 
-      return $details['name'];
+         return $name;
+   
+      }
 
    } // getPhotoName()