From: Robin Pepermans Date: Sat, 6 Jun 2009 16:43:08 +0000 (+0000) Subject: Add function addExtraSQL() to RandomPage as an alternative to $wgExtraRandompageSQL... X-Git-Tag: 1.31.0-rc.0~41476 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=2d863b7b790b53ca9bf01b437c156e48f3e8e7cf;p=lhc%2Fweb%2Fwiklou.git Add function addExtraSQL() to RandomPage as an alternative to $wgExtraRandompageSQL for extensions --- 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 ''; + } }