wiki.techinc.nl/includes/specials/SpecialRandomrootpage.php
Tim Hollmann 6479706b97 Add Special:Randomrootpage (from RandomRootPage extension)
Imported RandomRootPage extension as SpecialRandomrootpage, including
its aliases and localization messages.

Bug: T109809
Change-Id: I7252ae9f4a8f1822b023cc4f0d3a732af48d84d3
2016-01-18 14:12:32 -08:00

39 lines
1.2 KiB
PHP

<?php
/**
* Implements Special:Randomrootpage
*
* Copyright © 2008 Hojjat (aka Huji)
*
* 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.
* http://www.gnu.org/copyleft/gpl.html
*
* @file
* @ingroup SpecialPage
*/
class SpecialRandomrootpage extends RandomPage {
public function __construct() {
parent::__construct( 'Randomrootpage' );
$dbr = wfGetDB( DB_SLAVE );
$this->extra[] = 'page_title NOT ' . $dbr->buildLike( $dbr->anyString(), '/', $dbr->anyString() );
}
// Don't select redirects
public function isRedirect() {
return false;
}
}