function GetExcerpt() { # get an excerpt of the message -- strip formatting tags $s_text = ""; if ($this->GetFilteredBody()) { $s_text = XhtmlMarkup::ApplyCharacterEntities($this->GetFilteredBody()); $s_text = XhtmlMarkup::ApplyLinks($s_text, true); $s_text = XhtmlMarkup::ApplyLists($s_text, true); $s_text = XhtmlMarkup::ApplySimpleTags($s_text, true); $s_text = XhtmlMarkup::ApplySimpleXhtmlTags($s_text, true); $s_text = XhtmlMarkup::CloseUnmatchedTags($s_text, true); $s_text = str_replace("\n", '', $s_text); # collapse new lines if (strlen($s_text) > 200) { $s_text = substr($s_text, 0, 200); $pos = strrpos($s_text, " "); if ($pos > 0) { $s_text = substr($s_text, 0, $pos); } # cut off any half-words $s_text .= '...'; # plain text - don't use real ellipsis } $s_text = strip_tags(html_entity_decode($s_text, ENT_QUOTES)); # plain text } return $s_text; }
function ApplyInterestsMarkup($text, $b_strip_tags = 0) { if ($text) { $text = HTML::Encode($text); $text = XhtmlMarkup::ApplyCharacterEntities($text); require_once 'email/email-address-protector.class.php'; $protector = new EmailAddressProtector($this->GetSettings()); $text = $protector->ApplyEmailProtection($text, AuthenticationManager::GetUser()->IsSignedIn()); $text = XhtmlMarkup::ApplyParagraphs($text, $b_strip_tags); $text = XhtmlMarkup::ApplyLists($text, $b_strip_tags); $text = XhtmlMarkup::ApplyLinks($text, $b_strip_tags); $text = XhtmlMarkup::ApplySimpleTags($text, $b_strip_tags); $text = XhtmlMarkup::ApplySimpleXhtmlTags($text, $b_strip_tags); $text = XhtmlMarkup::CloseUnmatchedTags($text); } return $text; }