diff options
author | Andreas Unterkircher <unki@netshadow.at> | 2007-07-06 17:01:45 +0000 |
---|---|---|
committer | Andreas Unterkircher <unki@netshadow.at> | 2007-07-06 17:01:45 +0000 |
commit | 74295f1b4a8e3b0ba1588486eae20e82e1142c76 (patch) | |
tree | 8e490d10f148430afae5715c63c91c6219e5290f | |
parent | 8f3e27ca1aea300a47d35b9474c8f5fd588460da (diff) |
issue29, shorten too long names
git-svn-id: file:///var/lib/svn/phpfspot/trunk@167 fa6a889d-dae6-447d-9e79-4ba9a3039384
-rw-r--r-- | phpfspot.class.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php index d6d3e69..4b304a1 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -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() |