Extension:LinkFilter

From Linux Web Expert

MediaWiki extensions manual
LinkFilter
Release status: stable
Implementation Special page
Description Adds some new special pages and a parser hook for link submitting/approval/reject
Author(s)
Latest version 3.5.0 (2017-07-11)
MediaWiki 1.39+
Database changes Yes
Tables link
License GNU General Public License 2.0 or later
Download
Quarterly downloads Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Public wikis using Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Translate the LinkFilter extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

LinkFilter is an extension to allow users to submit news (etc.) links and wiki admins/other privileged users to approve them.

In addition to the new special pages, LinkFilter also provides ‎<linkfilter> parser hook tag.

New special pages

  • Special:LinkSubmit
  • Special:LinkApprove (available to users with linkadmin right)
  • Special:LinkEdit (redirects to LinkSubmit form, allowing to edit the link details, target etc.)
  • Special:LinksHome
  • Special:LinkRedirect

Install

  • <translate> [[<tvar name=2>Special:ExtensionDistributor/LinkFilter</tvar>|Download]] and move the extracted <tvar name=name>LinkFilter</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/LinkFilter
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'LinkFilter' );
    
  • <translate> Run the [[<tvar name=update>Special:MyLanguage/Manual:Update.php</tvar>|update script]] which will automatically create the necessary database tables that this extension needs.</translate>
    • If a pre-r90829 version of SocialProfile extension is installed on the wiki, you'll need to patch the existing user_stats table by running patch-columns_for_user_stats.sql against it (try php maintenance/sql.php extensions/LinkFilter/patch-columns_for_user_stats.sql from command line)
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Configuration

  • $wgLinkFilterTypes — an array of link types that will be available in the dropdown menu on Special:LinkSubmit. If this is not defined, LinkFilter will use the defaults in Link::$link_types. The defaults are the same as Link::$link_types currently:
$wgLinkFilterTypes = array(
	1 => 'Arrest Report',
	2 => 'Awesome',
	3 => 'Cool',
	4 => 'Funny',
	6 => 'Interesting',
	7 => 'Obvious',
	8 => 'OMG WTF?!?',
	9 => 'Rumor',
	10 => 'Scary',
	11 => 'Stupid',
);
  • $wgLinkPageDisplay — not really a configuration variable per se. Used to display different stuff on LinkFilter pages. For example, setting $wgLinkPageDisplay['in_the_news'] = true; will display "In the News" section on Special:LinksHome.

Customization

You can edit the general instructions displayed to everyone on Special:LinkSubmit by editing MediaWiki:Linkfilter-instructions.

Admins instructions can be edited through MediaWiki:Linkfilter-admin-instructions.

User rights

The extension adds one new user right, linkadmin. Users with this right are able to use LinkFilter's administrative functions, such as approve/reject links. By default, linkadmin, staff and sysop groups have this right.