diff --git a/pool/base.php b/pool/base.php index a016fc3e..64f7ee5c 100644 --- a/pool/base.php +++ b/pool/base.php @@ -233,6 +233,19 @@ function difffmt($amt) return siprefmt($amt, 3); } # +function dspname($name) +{ + if (strlen($name) < 23) + return array(false, htmlspecialchars($name)); + + if (strpbrk($name, '._') === false) + return array(false, htmlspecialchars(substr($name, 0, 20)).'…'); + + $left = htmlspecialchars(substr($name, 0, 17)); + $right = htmlspecialchars(substr($name, -3)); + return array(true, $left.'…'.$right); +} +# function emailStr($str) { $all = '/[^A-Za-z0-9_+\.@-]/'; // no space = trim diff --git a/pool/page_blocks.php b/pool/page_blocks.php index 231703ad..6a1591a9 100644 --- a/pool/page_blocks.php +++ b/pool/page_blocks.php @@ -330,7 +330,10 @@ function doblocks($data, $user) $pg .= "