Recent Topics

1 Jul 19, 2006 12:05    

Um, I just want to get latest 3 post from a blog.. I got the code from summary.php and make it get content only from one blog. But now I want to get only 20 words from each post but the following code does not work..

<?php $Item->content('#','#',$Item->get('title'),'#','Read full text of ','...','htmlbody',20); ?>

Any ideas?

2 Jul 19, 2006 13:36

Always give the info of what version of b2evo you are running.

3 Jul 19, 2006 15:41

b2evolution 1.6-Alpha

4 Jul 19, 2006 23:38

The cut-word-limit only gets respected/used for XML. I've found this out sometime and documented it in the code, but never actually fixed it. It's also not that easy, because it should not mess tags up (remove a closing P tag for example).

A solution for you might be to get the whole content, use strip_tags() on it, explode it by whitespace (e.g. with preg_split('~\s+~', $text, -1, PREG_SPLIT_NO_EMPTY) and then use the 20 first entries/words of the resulting array.


Form is loading...