NP_Random(News)Feed

As promised, the howto and code for how to add a random feed to your blog.

General Plugin info
Author: http://www.xiffy.nl/weblog/
Current Version: 0.91
Download: NP_RandomFeed.zip
Code: code
Demo: -
Forum Thread: -

Installing

First download the extra plugin involved: NP_RandomFeed.zip. Unpack and install, you know the drill. There is not much in this plugin, it's basicly an rework of Random. Look at code.

Since I wasn't planning on making this one public, there are no options for the plugin, it's all in the code. How do you get this thing rolling? You must have NP_NewsFeed installed otherwise you'll get errors

How to use the plugin

Now go to the skin where you want the random newsfeed. and put this: <%RandomFeed(incl/randomblog.txt)%> in the skin. This means read the file incl/randomblog.txt which holds URL's for newsfeeds, 1 per line example http://verbaljam.nl/xml-rss.php http://demuynck.org/xml-rss.php http://roelgroeneveld.com/[[weblog]]/xml-rss2.php http://log.komma.net/index.xml http://druppels.be/druppels/index.xml Be sure not to add a blank line before or after the feed-URLs

Now if we watch close to the code on line 50 it says

$feed = "<%Newsfeed(". trim($feed) .")%>";

here you should tweak the options for the feed how you would normaly tweak NewsFeed so:

        $feed = "<%NewsFeed(". trim($feed) .",1,15)%>"; /* Note the capital F 

Would display only the titles with max. 15 items One line below it says:

        $incfile = $DIR_MEDIA. "/cache/random.inc";

This is the file that gets written by this plugin, it will hold something like this <%NewsFeed(http://demuynck.org/xml-rss.php)%>

Now for the final step we are back in the skin again right under <%RandomFeed(incl/randomblog.txt)%> you add <%parsedinclude(../../media/cache/random.inc)%> (insert the filename you choose in the plugin!)

And there you go. You now have random RSS files on your site Questions comments tweaks? Add them! :: Plugins ::

Changes

=⇒> Changed from <%parsedinclude(media/cache/random.inc)%> parsed files are taken with respect to skin dir =⇒>

 /*  $feed = "<%Newsfeed(". trim($feed) .",1,15)%>"; */ should be NewsFeed 

=⇒>Now if we watch close to the code on line 50 it says

$feed = "<%Newsfeed(". trim($feed) .")%>";

should be

Now if we watch close to the code on line 50 it says

$feed = "<%NewsFeed(". trim($feed) .")%>";

=⇒> Note to author of plugin: Please make changes to the actual source of the plugin

Plugin review

unchecked

randomnewsfeed.txt · Last modified: 2007/10/28 16:47 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki