Extension SidebarDonateBox
From User talk:Dantman
Hallo Dantman. Ich habe bei mir das Extension SidebarDonateBox (siehe thrunk) installiert und ein bisschen aufgepeppt. Es unterstützt nun nach Wahl WikiText und holt die Einstellungen (z.B. Navigation nur für ein Wiki in einer Farm) aus Mediawiki:DonateBox (auch konfigurierbar).
<?php /** * SidebarDonateBox * @package SidebarDonateBox * @author Daniel Friesen (http://mediawiki.org/wiki/User:Dantman) <mediawiki@danielfriesen.name> * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ if ( !defined( 'MEDIAWIKI' ) ) die( "This is an extension to the MediaWiki package and cannot be run standalone." ); $wgExtensionCredits['parserhook'][] = array ( 'name' => 'SidebarDonateBox', 'url' => 'http://mediawiki.org/wiki/Extension:SidebarDonateBox', 'version' => '1.1a', 'author' => "[http://mediawiki.org/wiki/User:Dantman Daniel Friesen]", 'description' => "Adds a custom donate box to the sidebar" ); $wgHooks['SkinBuildSidebar'][] = 'efSidebarDonateBox'; ///! Edit Mediawiki:Sidebar to include. (e.g. * Navigation if $efSidebarDonateBoxTitle is 'Navigation') $efSidebarDonateBoxParse=true;//Whether to parse the page or not. $egSidebarDonateBoxTitle='Donate';//The Title of the Box like those "Search", "Toolbox", etc... $egSidebarDonateBoxPage='DonateBox'; //The page Mediawiki:___ contains the contents for the Box. function efSidebarDonateBox( $skin, &$bar ) { global $wgParser, $egSidebarDonateBoxPage, $egSidebarDonateBoxTitle, $efSidebarDonateBoxParse; if($efSidebarDonateBoxParse==true) { $title = Title::newFromText( $egSidebarDonateBoxPage, NS_MEDIAWIKI ); $article = new Article($title); $text = $article->getContent(); $options = new ParserOptions; $out=$wgParser->parse($text,$title,$options); $bar[$egSidebarDonateBoxTitle]=$out->mText; } else { $bar[$egSidebarDonateBoxTitle] = $egSidebarDonateBoxContent; } return true; }
--Wersonst