From 2d863b7b790b53ca9bf01b437c156e48f3e8e7cf Mon Sep 17 00:00:00 2001 From: Robin Pepermans Date: Sat, 6 Jun 2009 16:43:08 +0000 Subject: [PATCH] Add function addExtraSQL() to RandomPage as an alternative to $wgExtraRandompageSQL for extensions --- includes/specials/SpecialRandompage.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/specials/SpecialRandompage.php b/includes/specials/SpecialRandompage.php index 3ad29fce5f..80b4f7995f 100644 --- a/includes/specials/SpecialRandompage.php +++ b/includes/specials/SpecialRandompage.php @@ -94,10 +94,17 @@ class RandomPage extends SpecialPage { AND page_is_redirect = $redirect AND page_random >= $randstr $extra + AND (".$this->addExtraSQL().") ORDER BY page_random"; $sql = $dbr->limitResult( $sql, 1, 0 ); $res = $dbr->query( $sql, __METHOD__ ); return $dbr->fetchObject( $res ); } + + // an alternative to $wgExtraRandompageSQL so extensions + // can add their own SQL by overriding this function + public function addExtraSQL() { + return ''; + } } -- 2.20.1