'',
preg_replace( '/\t+/', '', preg_replace( "/&#?[a-z0-9]{2,8};/i", "", strip_tags( $data['descr'] ) ) )
);
- $short_descr = substr(implode(' ', array_slice(explode(' ', $stripped), 0, 30)), 0, 116);
+
+ if ( isset( $this->config['settings']['short_desc_char_limit'] ) ) {
+ $short_desc_char_limit = $this->config['settings']['short_desc_char_limit'];
+ } else {
+ $short_desc_char_limit = 120;
+ }
+ $ellipsis = ' ...';
+
+ $short_descr = substr(implode(' ', array_slice(explode(' ', $stripped), 0, 30)), 0, $short_desc_char_limit - strlen($ellipsis));
if (strlen($short_descr) < strlen($stripped)) {
- $short_descr .= ' ...';
+ $short_descr .= $ellipsis;
}
// Setup the Member Profile Status
// Add this member to the names inserted so we can check for duplicates
$namesInserted[$membName] = true;
+ if ( isset( $this->config['settings']['short_desc_char_limit'] ) ) {
+ $short_desc_char_limit = $this->config['settings']['short_desc_char_limit'];
+ } else {
+ $short_desc_char_limit = 120;
+ }
+ $ellipsis = ' ...';
+
// Create truncated short_descr from descriptions - Less tags, html encoded characters, newlines, tabs, etc.
$stripped = str_replace(PHP_EOL, '', preg_replace('/\t+/', '', preg_replace("/&#?[a-z0-9]{2,8};/i", "", strip_tags($val['description']))));
- $short_descr = substr(implode(' ', array_slice(explode(' ', $stripped), 0, 30)), 0, 116);
+ $short_descr = substr(implode(' ', array_slice(explode(' ', $stripped), 0, 30)), 0, $short_desc_char_limit - strlen($ellipsis));
if (strlen($short_descr) < strlen($stripped)) {
- $short_descr .= ' ...';
+ $short_descr .= $ellipsis;
}
// Build Credit Card bitmap