Not sure if this is the right place, but since original truncate_content() function don't doing all necessary "truncate" and often outputs html meta description tag in wrong way i consider this a bug and would like to share my fix with the community:
Found truncate_content() function in /libs/link.php
and replace it with this new one:PHP Code:function truncate_content(){
$TruncatedContent = substr($this->content, 0, StorySummary_ContentTruncate);
if(strlen($this->content) > StorySummary_ContentTruncate){$TruncatedContent .= "...";}
return $TruncatedContent;
}
After this the meta description tag will be generated in right way.PHP Code:function truncate_content(){
$TruncatedContent = htmlspecialchars($this->content);
$TruncatedContent = preg_replace('/\s+/', ' ', trim($TruncatedContent));
if(strlen($TruncatedContent) > StorySummary_ContentTruncate) {
// Set the replacement for the "string break" in the wordwrap function
$cutmarker = "**cut_here**";
// Using wordwrap() to set the cutmarker
// NOTE: wordwrap (PHP 4 >= 4.0.2, PHP 5)
$TruncatedContent = wordwrap($TruncatedContent, StorySummary_ContentTruncate, $cutmarker);
$TruncatedContent = explode($cutmarker, $TruncatedContent);
$TruncatedContent = $TruncatedContent[0] . "...";
}
return $TruncatedContent;
}
Enjoy!![]()



Reply With Quote



