begin the process of using the relevant attach directory/path for photo albums instead of an album basename which may not be unique. Created an 'ellipsify()' function to shorten long names and keep the beginning and end intact

This commit is contained in:
zotlabs
2017-03-21 20:11:48 -07:00
parent c1cc7bfc94
commit bedc393425
4 changed files with 62 additions and 48 deletions

View File

@@ -3113,3 +3113,14 @@ function array_escape_tags(&$v,$k) {
$v = escape_tags($v);
}
function ellipsify($s,$maxlen) {
if($maxlen & 1)
$maxlen --;
if($maxlen < 4)
$maxlen = 4;
if(mb_strlen($s) < $maxlen)
return $s;
return mb_substr($s,0,$maxlen / 2) . '...' . mb_substr($s,mb_strlen($s) - ($maxlen / 2));
}