r51541 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51540‎ | r51541 | r51542 >
Date:16:43, 6 June 2009
Author:robin
Status:resolved
Tags:
Comment:
Add function addExtraSQL() to RandomPage as an alternative to $wgExtraRandompageSQL for extensions
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRandompage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRandompage.php
@@ -94,10 +94,17 @@
9595 AND page_is_redirect = $redirect
9696 AND page_random >= $randstr
9797 $extra
 98+ AND (".$this->addExtraSQL().")
9899 ORDER BY page_random";
99100
100101 $sql = $dbr->limitResult( $sql, 1, 0 );
101102 $res = $dbr->query( $sql, __METHOD__ );
102103 return $dbr->fetchObject( $res );
103104 }
 105+
 106+ // an alternative to $wgExtraRandompageSQL so extensions
 107+ // can add their own SQL by overriding this function
 108+ public function addExtraSQL() {
 109+ return '';
 110+ }
104111 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r51544fix r51541robin17:01, 6 June 2009

Status & tagging log