From 21d97bab29cc09c807bfa08c751aa47a55987539 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Fri, 15 Apr 2011 04:59:04 +1000 Subject: ... --- inc/display.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'inc/display.php') diff --git a/inc/display.php b/inc/display.php index ab6f9cda..34be2dcc 100644 --- a/inc/display.php +++ b/inc/display.php @@ -98,9 +98,12 @@ ))); } - function pm_snippet($body) { + function pm_snippet($body, $len=null) { global $config; + if(!isset($len)) + $len = $config['mod']['snippet_length']; + // Replace line breaks with some whitespace $body = str_replace('
', ' ', $body); @@ -110,7 +113,7 @@ // Unescape HTML characters, to avoid splitting them in half $body = html_entity_decode_utf8($body); - $body = substr($body, 0, $config['mod']['snippet_length']) . (strlen($body) > $config['mod']['snippet_length'] ? '…' : ''); + $body = substr($body, 0, $len) . (strlen($body) > $len ? '…' : ''); // Re-escape the characters. return '' . utf8tohtml($body) . ''; -- cgit v1.3