r25122 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25121‎ | r25122 | r25123 >
Date:21:55, 24 August 2007
Author:aaron
Status:old
Tags:
Comment:
*More query tweaking
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php
@@ -755,8 +755,9 @@
756756 */
757757 class UnreviewedPagesPage extends PageQueryPage {
758758
759 - function __construct( $namespace, $showOutdated=NULL, $category=NULL ) {
760 - $this->namespace = $namespace=='' ? null : intval($namespace);
 759+ function __construct( $namespace, $showOutdated=false, $category=NULL ) {
 760+ $this->namespace = is_null($namespace) ? null : intval($namespace);
 761+ print($namespace==='');
761762 $this->category = $category;
762763 $this->showOutdated = $showOutdated;
763764 }
@@ -790,14 +791,16 @@
791792 } else {
792793 $where .= "AND page_ext_reviewed = 0";
793794 }
794 - $sql = "SELECT page_namespace AS ns,page_title AS title,page_len,page_ext_stable FROM $page ";
 795+ $sql = "SELECT page_namespace AS ns,page_title AS title,page_len,page_ext_stable
 796+ FROM $page";
795797 # Filter by category
796798 if( $category ) {
 799+ $sql .= ",$categorylinks ";
797800 $category = str_replace( ' ', '_', $dbr->strencode($category) );
798 - $where .= " AND cl_from IS NOT NULL";
799 - $sql .= "LEFT JOIN $categorylinks ON (cl_from = page_id AND cl_to = '{$category}') ";
 801+ $where .= " AND cl_from = page_id AND cl_to = '{$category}' ";
800802 }
801 - $sql .= "WHERE ($where) ";
 803+ $sql .= " WHERE ($where) ";
 804+ echo( $sql );
802805 return $sql;
803806 }
804807
@@ -807,7 +810,7 @@
808811 }
809812
810813 function getOrder() {
811 - return 'ORDER BY page_id DESC';
 814+ return 'ORDER BY page_namespace,page_id DESC';
812815 }
813816
814817 function formatResult( $skin, $result ) {

Status & tagging log