r51542 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51541‎ | r51542 | r51543 >
Date:16:44, 6 June 2009
Author:robin
Status:ok
Tags:
Comment:
Use function addExtraSQL() for random page selection
Modified paths:
  • /trunk/extensions/WikimediaIncubator/SpecialRandomByTest.php (modified) (history)
  • /trunk/extensions/WikimediaIncubator/WikimediaIncubator.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikimediaIncubator/WikimediaIncubator.php
@@ -10,7 +10,7 @@
1111 'path' => __FILE__,
1212 'name' => 'Wikimedia Incubator',
1313 'author' => 'SPQRobin',
14 - 'version' => '2.3.0',
 14+ 'version' => '2.3.1',
1515 'url' => 'http://www.mediawiki.org/wiki/Extension:WikimediaIncubator',
1616 'description' => 'Test wiki features for Wikimedia Incubator',
1717 'descriptionmsg' => 'wminc-desc',
Index: trunk/extensions/WikimediaIncubator/SpecialRandomByTest.php
@@ -7,13 +7,15 @@
88 class SpecialRandomByTest extends RandomPage
99 {
1010 public function __construct() {
11 - global $wgExtraRandompageSQL, $wgUser, $wmincPref;
 11+ parent::__construct( 'RandomByTest' );
 12+ }
 13+
 14+ public function addExtraSQL() {
 15+ global $wgUser, $wmincPref;
1216 if(IncubatorTest::isNormalPrefix()) {
13 - $wgExtraRandompageSQL = 'page_title like "W'.$wgUser->getOption($wmincPref . '-project').'/'.$wgUser->getOption($wmincPref . '-code').'/%%"';
 17+ return 'page_title like "W'.$wgUser->getOption($wmincPref . '-project').'/'.$wgUser->getOption($wmincPref . '-code').'/%%"';
1418 } elseif($wgUser->getOption($wmincPref . '-project') == 'inc') {
15 - $wgExtraRandompageSQL = 'page_title not like "W_/%%" OR "W_/%%/%%"';
 19+ return 'page_title not like "W_/%%" OR "W_/%%/%%"';
1620 }
17 -
18 - parent::__construct( 'RandomByTest' );
1921 }
2022 }

Status & tagging log