r25128 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25127‎ | r25128 | r25129 >
Date:23:29, 24 August 2007
Author:aaron
Status:old
Tags:
Comment:
*Remove godamn 'all' selector
*Force join order
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php
@@ -724,11 +724,6 @@
725725 }
726726 $s = "\n<select id='namespace' name='namespace' class='namespaceselector'>\n";
727727 $arr = $wgContLang->getFormattedNamespaces();
728 - if( !is_null($allnamespaces) ) {
729 - $arr = array($allnamespaces => wfMsg('namespacesall')) + $arr;
730 - }
731 -
732 - $s .= "\t" . Xml::element("option", array("value" => ''), wfMsg('namespacesall')) . "\n";
733728
734729 foreach($arr as $index => $name) {
735730 # Content only
@@ -756,8 +751,7 @@
757752 class UnreviewedPagesPage extends PageQueryPage {
758753
759754 function __construct( $namespace, $showOutdated=false, $category=NULL ) {
760 - $this->namespace = is_null($namespace) ? null : intval($namespace);
761 - print($namespace==='');
 755+ $this->namespace = intval($namespace);
762756 $this->category = $category;
763757 $this->showOutdated = $showOutdated;
764758 }
@@ -791,15 +785,19 @@
792786 } else {
793787 $where .= "AND page_ext_reviewed = 0";
794788 }
795 - $sql = "SELECT page_namespace AS ns,page_title AS title,page_len,page_ext_stable
796 - FROM $page";
797789 # Filter by category
798790 if( $category ) {
799 - $sql .= ",$categorylinks ";
800791 $category = str_replace( ' ', '_', $dbr->strencode($category) );
801 - $where .= " AND cl_from = page_id AND cl_to = '{$category}' ";
 792+ $sql = "SELECT page_namespace AS ns,page_title AS title,page_len,page_ext_stable
 793+ FROM $page FORCE INDEX(ext_namespace_reviewed)
 794+ RIGHT JOIN $categorylinks ON(cl_from = page_id AND cl_to = '{$category}')";
 795+ #$where .= " AND cl_from IS NOT NULL ";
 796+ } else {
 797+ $sql = "SELECT page_namespace AS ns,page_title AS title,page_len,page_ext_stable
 798+ FROM $page FORCE INDEX(ext_namespace_reviewed)";
802799 }
803800 $sql .= " WHERE ($where) ";
 801+
804802 return $sql;
805803 }
806804
@@ -809,8 +807,12 @@
810808 }
811809
812810 function getOrder() {
813 - return 'ORDER BY page_namespace,page_id DESC';
 811+ return 'ORDER BY page_id DESC';
814812 }
 813+
 814+ function linkParameters() {
 815+ return array( 'category' => $this->category,'showoutdated' => $this->showOutdated );
 816+ }
815817
816818 function formatResult( $skin, $result ) {
817819 global $wgLang;

Status & tagging log