<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>RSS Feeds are broken in sNews, fix it with this hack</title>
<link>http://www.mdj.us/</link>
<description>Fix the broken rss feeds in sNews CMS with this quick and easy hack.</description>
<language>en</language>
<item>
<title>Matt</title>
<description></description>
<link>http://www.mdj.us/snews-cms/hacks-mods/rss-feeds-are-broken-in-snews-fix-it-with-this-hack/#comment-797</link>
<pubDate>Mon, 25 Jan 2010 00:58:01 +0000</pubDate>
<content:encoded><![CDATA[Sven, not breaking words is fairly easy, but if you're not stripping tags, you'll need to incorporate an awareness of HTML tags within the text.<br />
<br />
Did you have a look at this one;<br />
<a href="http://www.php.net/manual/en/function.substr.php#92063" rel="nofollow">http://www.php.net/manual/en/function.substr.php#92063</a>]]></content:encoded>
</item>
<item>
<title>SvenPhilippe</title>
<description></description>
<link>http://www.mdj.us/snews-cms/hacks-mods/rss-feeds-are-broken-in-snews-fix-it-with-this-hack/#comment-796</link>
<pubDate>Sun, 24 Jan 2010 15:54:20 +0000</pubDate>
<content:encoded><![CDATA[Yeah! It works almost fine but there's an issue:<br />
Cutting the text works but if it's in a link there's no more link at all.<br />
<br />
I tried to fix by cutting the text without words breaking but as you know PHP is not my cup of tea (anyway I don't care, I only drink alcohol, even for breakfast) so I didn't get any results using this:<br />
<br />
[code]&lt;?php<br />
//substring without words breaking<br />
<br />
$str = &quot;aa bb ccc ddd ee fff gg hhh iii&quot;;<br />
<br />
echo substr(($str=wordwrap($str,$,'$$')),0,strpos($str,'$$'));<br />
?&gt;[/code]<br />
<br />
That nice piece of code was found there: <a href="http://www.php.net/manual/en/function.substr.php" rel="nofollow">http://www.php.net/manual/en/function.substr.php</a>]]></content:encoded>
</item>
<item>
<title>Matt</title>
<description></description>
<link>http://www.mdj.us/snews-cms/hacks-mods/rss-feeds-are-broken-in-snews-fix-it-with-this-hack/#comment-794</link>
<pubDate>Sun, 24 Jan 2010 12:54:08 +0000</pubDate>
<content:encoded><![CDATA[Shouldn't be too hard Sven, we'd just need to extract the break title from the text if it exists. Use this bit for the first part. (not tested, but should work)<br />
<br />
<br />
[code]if ($rss_item == &quot;rss-articles&quot;) {<br />
    if (preg_match(&quot;/\[break title=\&quot;(.*)\&quot;\]/i&quot;,$r['text'],$matches)) {<br />
        $readmore = $matches[1];<br />
    } else {<br />
        $readmore = l('read_more');<br />
    }<br />
    $jump = '&lt;br /&gt;&lt;a href=&quot;'.$link.'#jump&quot;&gt;'.$readmore.'&lt;/a&gt;';<br />
}[/code]]]></content:encoded>
</item>
<item>
<title>SvenPhilippe</title>
<description></description>
<link>http://www.mdj.us/snews-cms/hacks-mods/rss-feeds-are-broken-in-snews-fix-it-with-this-hack/#comment-791</link>
<pubDate>Sat, 23 Jan 2010 12:59:21 +0000</pubDate>
<content:encoded><![CDATA[Oh! Thinking...<br />
I don't know if you have your feed published in other sites but there might be a strong SEO improvement:<br />
The idea is to replaced in the feed break the read more text anchor created by the one from &quot;An easy mod to create custom break titles for your sNews articles&quot;.<br />
What do you think of it?]]></content:encoded>
</item>
<item>
<title>SvenPhilippe</title>
<description></description>
<link>http://www.mdj.us/snews-cms/hacks-mods/rss-feeds-are-broken-in-snews-fix-it-with-this-hack/#comment-790</link>
<pubDate>Sat, 23 Jan 2010 08:41:41 +0000</pubDate>
<content:encoded><![CDATA[Splendid! Bravo! Thanks a lot Matt.]]></content:encoded>
</item>
<item>
<title>Matt</title>
<description></description>
<link>http://www.mdj.us/snews-cms/hacks-mods/rss-feeds-are-broken-in-snews-fix-it-with-this-hack/#comment-789</link>
<pubDate>Fri, 22 Jan 2010 18:36:02 +0000</pubDate>
<content:encoded><![CDATA[Sven,<br />
<br />
Inside the function rss_contents, find the following and add the bits I've added ([b]bolded[/b]);<br />
    [code][b]if ($rss_item == &quot;rss-articles&quot;) {<br />
        $jump = '&lt;br /&gt;&lt;a href=&quot;'.$link.'#jump&quot;&gt;read more&lt;/a&gt;';<br />
    }[/b]<br />
    $item  =<br />
    '&lt;item&gt;<br />
    &lt;title&gt;&lt;![CDATA['.strip(htmlspecialchars_decode($title,ENT_QUOTES)).']]&gt;&lt;/title&gt;<br />
    &lt;description&gt;<br />
        &lt;![CDATA[<br />
        '.strip($text).[b]$jump.[/b]'<br />
        ]]&gt;<br />
    &lt;/description&gt;<br />
    &lt;pubDate&gt;'.$date.'&lt;/pubDate&gt;<br />
    &lt;link&gt;'.$link.'&lt;/link&gt;<br />
    &lt;guid&gt;'.$link.'&lt;/guid&gt;<br />
    &lt;/item&gt;';<br />
    echo $item;[/code]<br />
<br />
That should add a &quot;read more&quot; link to rss-articles RSS feeds.]]></content:encoded>
</item>
<item>
<title>SvenPhilippe</title>
<description></description>
<link>http://www.mdj.us/snews-cms/hacks-mods/rss-feeds-are-broken-in-snews-fix-it-with-this-hack/#comment-787</link>
<pubDate>Fri, 22 Jan 2010 17:30:30 +0000</pubDate>
<content:encoded><![CDATA[Sure.<br />
I'll be waiting.]]></content:encoded>
</item>
<item>
<title>Matt</title>
<description></description>
<link>http://www.mdj.us/snews-cms/hacks-mods/rss-feeds-are-broken-in-snews-fix-it-with-this-hack/#comment-786</link>
<pubDate>Wed, 20 Jan 2010 15:57:13 +0000</pubDate>
<content:encoded><![CDATA[That shouldn't be too difficult to add Sven, I'll have a look when I get a free moment.]]></content:encoded>
</item>
<item>
<title>SvenPhilippe</title>
<description></description>
<link>http://www.mdj.us/snews-cms/hacks-mods/rss-feeds-are-broken-in-snews-fix-it-with-this-hack/#comment-785</link>
<pubDate>Wed, 20 Jan 2010 12:03:39 +0000</pubDate>
<content:encoded><![CDATA[Added!<br />
You know what Matt?<br />
I think one thing is missing: a read on link to a #jump anchor (remember <a href="http://snewscms.com/forum/index.php?topic=8177)" rel="nofollow">http://snewscms.com/forum/index.php?topic=8177)</a>]]></content:encoded>
</item>
<item>
<title>Matt</title>
<description></description>
<link>http://www.mdj.us/snews-cms/hacks-mods/rss-feeds-are-broken-in-snews-fix-it-with-this-hack/#comment-537</link>
<pubDate>Fri, 28 Aug 2009 11:45:46 +0000</pubDate>
<content:encoded><![CDATA[That shouldn't be too difficult toolman, I will see if I can explain it later today.]]></content:encoded>
</item>
</channel>
</rss>

