Extension:News Channel

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
News Channel

Release status: stable

NewsChannel ScreenShot.PNG
Implementation Notify, Special page, Data extraction
Description Extension allows to set up a custom RSS 2.0/Atom 1.0 news channel on your wiki in a minute. If you include a page into some specified category (e. g. [[Category:News]]), this page instantly appears on the site's channel. Channel is implemented as a special page [[Special:NewsChannel]] and is automatically linked from every page of the wiki.
Author(s) Iaroslav Vassiliev
(CodeMonkTalk)
Last version 1.65
 (2012-01-17)
MediaWiki 1.8 or higher
License GPL
Download 1.65
1.63
1.61
1.52
1.33
1.31

SVN:
(special version for WikiMedia projects, do not use on other sites)
Download snapshot
Subversion [Help]
Browse source code
View code changes

Example ICT for education wiki

Check usage (experimental)

[edit] Purpose and usage

If you would like to make a custom RSS 2.0 and/or Atom 1.0 news channel on your wiki, you can simply install this extension, create some category (e. g. [[Category:News]]) and set it as a news category. Then, if you want to publish a news item on your channel, you should create an article in your wiki, include it into that news category and save it. The article will be instantly published on the channel: it's title will be the headline and it's text will be the description of news item. Wikimarkup is automatically converted into HTML.

[edit] Installation

  1. Download the extension.
  2. Unzip and save the files in your wiki's extensions directory in a subdirectory NewsChannel.
  3. Change your wiki's LocalSettings.php file to include the line:
require_once("$IP/extensions/NewsChannel/NewsChannel.php");

[edit] Configuration

Since version 1.6, all configuration settings are specified in global variables in LocalSettings.php file. These variables must be set after "require_once(...)" directives. Here are the sample settings and description.

Channel title:

$wgNewsChannelTitle = 'MyWikiSite.com IT News';

Channel description, preferably just one sentence:

$wgNewsChannelDescription = 'Most hot IT news on MyWikiSite.';

Channel's language code and optional country subcode, e. g. 'en-US'. By default it's a language, specified in $wgLanguageCode variable in LocalSettings.php file.

$wgNewsChannelLanguage = 'en-US';

Channel copyright note:

$wgNewsChannelCopyright =
    'Copyright (c) MyWikiSite.com. All rights reserved.';

Channel logo. In RSS 2.0 specification only JPG, GIF or PNG formats are allowed; recommended default size is 88x31. In Atom 1.0 format an image should have 1:1 aspect ratio. The image should be suitable for presentation at a small size.

$wgNewsChannelLogoImage =
    'http://www.mywikisite.com/rssicon.png';

Time in minutes before channel cache invalidation occurs (in other words, update interval):

$wgNewsChannelUpdateInterval = '60';

Default number of recent (most fresh) news to list on the channel:

$wgNewsChannelDefaultItems = 10;

Absolute limit of news items to list on the channel. Protects site from overload.

$wgNewsChannelMaxItems = 50;

Name or alias of channel's editor-in-chief:

$wgNewsChannelEditorName = 'John Doe';

E-mail of channel's editor-in-chief:

$wgNewsChannelEditorAddress = 'newseditor@mywikisite.com';

Name or alias of channel webmaster:

$wgNewsChannelWebMasterName = 'Jane Doe';

E-mail of channel webmaster:

$wgNewsChannelWebMasterAddress = 'webmaster@mywikisite.com';

Title of category, containing news articles:

$wgNewsChannelCategory = 'News';

Title of category, that must be excluded from export:

$wgNewsChannelExcludeCategory = 'Delayed publications';

Optional prefix to remove from news article titles to clean channel headlines (don't include namespace prefix here, it will be removed automatically):

$wgNewsChannelRemoveArticlePrefix = 'News/';

Names (wiki accounts) of users, allowed to publish news on the channel. Remove names inside braces and leave just array() to allow everyone.

$wgNewsChannelAuthorizedEditors = array( 'John Doe', 'Jane Doe', 'Alex' );

Option to export text only. If set to "true", links to images and media files are removed from feed.

$wgNewsChannelExportTextOnly = false;

[edit] Feed access and subscription

When configuration is done, feed subscription option will automatically appear in browsers of your site visitors. The feed can also be manually accessed by pressing "Create feed" button on "Special:NewsChannel" page on your wiki. Some additional optional parameters can be specified on that page too. When the feed with custom parameters is created on that page, you can get it's URL address from your browser and post it to FeedBurner or wherever you like.

Please, note, that when you specify additional news category on "Special:NewsChannel" page and press "Create feed" button, then only the articles that are included in both news categories at once are exported to that created feed. Logical AND is used here, not logical OR. That is done so to enable several different feeds on one site. For example, one feed about IT news contains articles in categories "News" and "IT", another feed about politics contains articles in categories "News" and "Politics", etc.

[edit] Version history

  • 1.65 — MediaWiki 1.18 support was added.
  • 1.64 — "author" field was added to individual news items.
  • 1.63 — Minor bugfix.
  • 1.62 — Many translations were added; two minor bugs were fixed.
  • 1.61 — Several translations were added; minor bug was fixed.
  • 1.6 — Configuration was switched to global variables completely. Many internal improvements.
  • 1.52 — Minor internal improvements.
  • 1.51 — Code documentation was reformatted.
  • 1.5 — MySQL 4.0 support was added; configuration by global variables allowed; French translation was added; several minor improvements.
  • 1.41 — atom:link was changed.
  • 1.4 — An option was added to combine multiple news categories and to exclude unwanted categories.
  • 1.33 — News item's timestamp is now set to time, when corresponding article was added to news category (in previous versions it was the time of article creation or last edit).
  • 1.31 — RSS/Atom HTTP content headers were added.
  • 1.3 — An option to convert wikimarkup to HTML was added; German interface translation was added.
  • 1.21 — A minor bug was fixed.
  • 1.2 — Atom 1.0 format was added; authorization for news publication was added; compliance to W3C Best Practice Guide was improved.

[edit] Contacts

If you would like to report a bug, request a feature, or could help with localization (extension messages translation), please, send me a letter to codedriller@gmail.com. Please, feel free to notify me about any problems. By the way, if you need advanced bot functionality for your wiki, take a look at free DotNetWikiBot Framework, that I maintain.

Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox