summaryrefslogtreecommitdiff
path: root/inc/display.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-04-12 18:02:20 +1000
committerSavetheinternet <savetheinternet@n0v4.com>2011-04-12 18:02:20 +1000
commit9dc1e9870418a54f834c2e546e1c549c3662c4e8 (patch)
treee1229e521a30450daa7bd39ec97ecdb086ac3309 /inc/display.php
parentd6d017e36800fb952049a1a20a5af1e37d869db4 (diff)
PM inbox
Diffstat (limited to 'inc/display.php')
-rw-r--r--inc/display.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/inc/display.php b/inc/display.php
index 72983a49..c0d2dde1 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -92,6 +92,24 @@
)));
}
+ function pm_snippet($body) {
+ global $config;
+
+ // Replace line breaks with some whitespace
+ $body = str_replace('<br/>', ' ', $body);
+
+ // Strip tags
+ $body = strip_tags($body);
+
+ // 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'] ? '…' : '');
+
+ // Re-escape the characters.
+ return '<em>' . utf8tohtml($body) . '</em>';
+ }
+
function confirmLink($text, $title, $confirm, $href) {
global $config, $mod;
if($config['mod']['server-side_confirm'])