SimplePie 1.5 is now available!

SimplePie Documentation.  Learn how to use this thing.  It's way better than going to school.

You are here: Documentation » SimplePie Plugins and Integration » Mediawiki » SimplePie Plugin for Mediawiki

SimplePie Plugin for Mediawiki

The Basics

Main page SimplePie Plugin for Mediawiki
Author Ryan Parman (Original)
Plugin Version 1.2.1 (Discontinued)
Compatible Mediawiki version 1.7.x and newer
Download Download
Required SimplePie version 1.0.x
Optional Helpers None
Plugin Support http://simplepie.org/support/viewforum.php?id=17

:!: Because I don't use Mediawiki anymore, I'm discontinuing development on this plugin. If you are interested in taking over development, please let me know at the forums. Alternatively, there are other Mediawiki plugins that you can use instead of this one.

About the Plugin

This plugin adds a <feed> tag to Mediawiki that allows you to display feeds in your wiki.

Installation

Upgrading from an older version?

Replace the old simplepie_mediawiki.php with the new one.

Fresh Installation

For the purposes of these instructions, we're going to make a few assumptions. We're going to assume that you have installed MediaWiki to http://wiki.example.com, which would mean that the MediaWiki extensions folder lives at http://wiki.example.com/extensions/, and that your MediaWiki settings file lives at http://wiki.example.com/LocalSettings.php.

Step 1: Download both the required files above

When you download them, make sure you know where you've downloaded them to. Once you've done that, unzip them. The full SimplePie library is what powers everything, and the Mediawiki plugin simply makes it available to your wiki pages.

Step 2: Upload both simplepie.inc and simplepie_mediawiki.php to your MediaWiki extensions folder

This means that these two files will be uploaded to http://wiki.example.com/extensions/.

Step 3: Create a cache folder inside MediaWiki's extensions folder

This means that after you create the cache folder, it will live at http://wiki.example.com/extensions/cache/.

Step 4: Change the file permissions for the cache directory to be server-writable

This setting varies from webhost to webhost. In the past, I've used iPowerWeb, and they required file permissions of 777 in order to be server-writable. Currently, I use Dreamhost, and they need permissions to be set to 755 to be server-writable. Again, if you're not sure, either go ask your host or you can try various settings yourself. The three to try are 755, 775, or 777.

The specific process of how you change your file permissions differs from FTP application to FTP application. On Windows I use FlashFXP, where you find the remote file or folder that you want to change the permissions of, you right-click on it, and choose Attributes (CHMOD). On Mac OS X I use Transmit, where you find the remote file or folder that you want to change the permissions of, you right-click (or ctrl-click for you one-button-mousers) on it, and choose Get Info. Your specific FTP application will most likely be something similar.

Step 5: Add the extension to your MediaWiki settings file

Open up your LocalSettings.php file which lives at http://wiki.example.com/LocalSettings.php. At the very bottom of the file, but above the closing PHP tag (?>), add this line:

include("./extensions/simplepie_mediawiki.php");

SimplePie and the SimplePie Plugin for Mediawiki are now installed.

Usage

How to use it

SimplePie Plugin for MediaWiki adds one tag to your MediaWiki installation: the <feed> tag. Here's how you use it:

  1. <feed>http://example.com/feed.xml</feed>
    To load a feed on your MediaWiki pages, simply wrap the feed URL with <feed> tags. Doing this with no attributes will display the default way:
    • An <h3> containing the feed's title, linked back to the originating site.
    • An ordered list, containing all of the news items in the feed.
    • The news item's title, linked back to the originating post.
    • The full HTML description for each news item.
  2. items attribute
    Limits the number of items returned. If you set this value to 5, then you'll get back the 5 most recent posts. If there's a feed with fewer than 5 posts, SimplePie will return all of them. Defaults to all.
  3. showdesc attribute
    Determines whether the description should be shown or not. If set to false, descriptions are omitted, and the ordered list will display only the linked item titles with no special formatting. Defaults to true.
  4. showdate attribute
    Displays the date of the news item. Accepts anything that's allowed in PHP's date() function. Defaults to blank.
  5. shortdesc attribute
    Strips all tags from the item's description and limits the number of characters that are displayed. Accepts any numeric value. If more characters are allowed than are in the description, the entire description will be displayed. If the text wasn't cut at the end of a sentence (ending with a period, exclamation point, or question mark), an ellipsis will be added to the end of the text. Defaults to all characters.
  6. showtitle attribute
    Determines whether the built-in feed title is displayed or not. Defaults to true.
  7. alttitle attribute
    Displays a custom title in place of the feed's built-in title. Defaults to blank.
  8. error attribute
    Displays a custom error message for when there is a problem retrieving the feed. Defaults to the standard error messages.

If you want to apply special CSS styles to the feed display, here's some basic markup that represents what is generated.

<div class="simplepie">
	<h3><a href="http://example.com">Example Site</a></h3>
	<ol>
		<li><strong><a href="...">Item Title 1</a> <span class="date">29 May 2006</span></strong><br />
		The description for the item.</li>
 
		<li><strong><a href="...">Item Title 2</a> <span class="date">28 May 2006</span></strong><br />
		The description for the item.</li>
 
		<li><strong><a href="...">Item Title 3</a> <span class="date">27 May 2006</span></strong><br />
		The description for the item.</li>
	</ol>
</div>

plugins/mediawiki/simplepie_plugin_for_mediawiki.txt · Last modified: 2011/03/06 03:56 (external edit)