diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2011-04-15 04:59:04 +1000 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2011-04-15 04:59:04 +1000 |
| commit | 21d97bab29cc09c807bfa08c751aa47a55987539 (patch) | |
| tree | f1aead10b33255281551544887a6cfe38fe9378e /inc | |
| parent | 81851e64f3d0d0386edf5b096bf76e1160ce261c (diff) | |
...
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/display.php | 7 | ||||
| -rw-r--r-- | inc/functions.php | 4 |
2 files changed, 7 insertions, 4 deletions
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('<br/>', ' ', $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 '<em>' . utf8tohtml($body) . '</em>'; diff --git a/inc/functions.php b/inc/functions.php index f5c502f4..318cfa1c 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -105,7 +105,7 @@ } function rebuildTheme($action) { - global $config; + global $config, $_theme; $query = query("SELECT `value` AS `theme` FROM `theme_settings` WHERE `name` = 'theme'") or error(db_error()); if($theme = $query->fetch()) { @@ -976,7 +976,7 @@ } } - function quote($body) { + function quote($body, $quote=true) { $body = str_replace('<br/>', "\n", $body); $body = strip_tags($body); |
