Elgg  Version 4.3
excerpt.php
Go to the documentation of this file.
1 <?php
10 $text = elgg_extract('text', $vars, '');
12 
13 $suffix = elgg_extract('suffix', $vars, '...');
14 
16 $num_chars = (int) elgg_extract('num_chars', $vars, 250);
17 
18 if ($string_length <= $num_chars) {
19  echo $text;
20  return;
21 }
22 
23 // handle cases
26 
27 // don't crop if can't find a space.
28 if ($space === false) {
30 }
32 
34  $excerpt .= $suffix;
35 }
36 
elgg_strip_tags($string, $allowable_tags=null)
Strip tags and offer plugins the chance.
Definition: output.php:317
$space
Definition: excerpt.php:25
$num_chars
Definition: excerpt.php:16
elgg_strlen()
Wrapper function for mb_strlen().
Definition: mb_wrapper.php:52
elgg_strrpos()
Wrapper function for mb_strrpos().
Definition: mb_wrapper.php:120
$suffix
Definition: excerpt.php:13
$string_length
Definition: excerpt.php:15
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:547
elgg_substr()
Wrapper function for mb_substr().
Definition: mb_wrapper.php:219
$text
Output view for elgg_get_excerpt.
Definition: excerpt.php:10
elgg echo
Translates a string.
Definition: deprecated.js:530
$vars['head']
Definition: html.php:24
if($string_length<=$num_chars) $excerpt
Definition: excerpt.php:24