Blog code problems

By TonySW

Whenever I add a blog entry this happens on the activity page;

 

  • $object = $vars['item']->getObjectEntity(); $comment = $vars['item']->getAnnotation(); $num_chars = 250; $excerpt = $comment->value; $string_length = elgg_strlen($excerpt); if ($string_length >= $num_chars) { $text = trim(elgg_strip_tags($excerpt)); if ($string_length == elgg_strlen($text)) { $excerpt = elgg_substr($text, 0, $num_chars); $space = elgg_strrpos($excerpt, ' ', 0); if ($space === FALSE) { $space = $num_chars; } $excerpt = trim(elgg_substr($excerpt, 0, $space)); if ($string_length != elgg_strlen($excerpt)) { $excerpt .= '...'; } } } echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'message' => $excerpt, ));

Anyone know how to fix it?

Thanks:)

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking