2013-08-17, 07:04:25
Now we're cooking. I also bumped the number of characters in $RSSBody. It was only taking 200 and I wanted my full posts in the RSS. My whole section starting around line 807 looks like this now:
I may end up adding more tags to the strip exceptions, but for now this is covering me.
Thank you so much for your help, Bigin.
If this plugin is still being maintained, I'd recommend these changes. Perhaps make a setting in the RSS configuration to specify the maximum number of characters to go to the RSS body instead of hard coding 200.
Code:
foreach ($posts as $post)
{
$blog_post = simplexml_load_file($post['filename']);
$RSSDate = $blog_post->date;
$RSSTitle = $blog_post->title;
$RSSBody = html_entity_decode(substr($blog_post->content, 0, 10000));
/* $RSSBody = html_entity_decode(str_replace(" ", " ", substr(htmlspecialchars(strip_tags($blog_post->content)),0,200))); */
$ID = $blog_post->slug;
$RSSString .= "<item>\n";
$RSSString .= "\t <title>".$RSSTitle."</title>\n";
$RSSString .= "\t <link>".$this->get_blog_url('post').$ID."</link>\n";
$RSSString .= "\t <guid>".$this->get_blog_url('post').$ID."</guid>\n";
/* $RSSString .= "\t <description>".htmlspecialchars($RSSBody)."</description>\n"; */
$RSSString .= "\t <description>".strip_tags($RSSBody,'<strong><a>')."</description>\n";
if(isset($blog_post->category) and !empty($blog_post->category) and $blog_post->category!='')
{
$RSSString .= "\t <category>".$blog_post->category."</category>\n";
}
$RSSString .= "</item>\n";
}
I may end up adding more tags to the strip exceptions, but for now this is covering me.
Thank you so much for your help, Bigin.
If this plugin is still being maintained, I'd recommend these changes. Perhaps make a setting in the RSS configuration to specify the maximum number of characters to go to the RSS body instead of hard coding 200.