Index: trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_body.php |
— | — | @@ -379,7 +379,7 @@ |
380 | 380 | $conds['fpc_override'] = 1; |
381 | 381 | } |
382 | 382 | # Filter by category |
383 | | - if( $this->category ) { |
| 383 | + if( $this->category != '' ) { |
384 | 384 | $tables[] = 'categorylinks'; |
385 | 385 | $conds[] = 'cl_from = fpp_page_id'; |
386 | 386 | $conds['cl_to'] = $this->category; |
Index: trunk/extensions/FlaggedRevs/api/ApiQueryOldreviewedpages.php |
— | — | @@ -47,6 +47,7 @@ |
48 | 48 | // Construct SQL Query |
49 | 49 | $this->addTables( array( 'page', 'flaggedpages', 'revision' ) ); |
50 | 50 | $this->addWhereFld( 'page_namespace', $params['namespace'] ); |
| 51 | + $useIndex = array( 'flaggedpages' => 'fp_pending_since' ); |
51 | 52 | if( $params['filterredir'] == 'redirects' ) |
52 | 53 | $this->addWhereFld( 'page_is_redirect', 1 ); |
53 | 54 | if( $params['filterredir'] == 'nonredirects' ) |
— | — | @@ -65,6 +66,12 @@ |
66 | 67 | $this->addWhere( 'page_namespace = wl_namespace' ); |
67 | 68 | $this->addWhere( 'page_title = wl_title' ); |
68 | 69 | } |
| 70 | + if( $params['category'] != '' ) { |
| 71 | + $this->addTables( 'categorylinks' ); |
| 72 | + $this->addWhere( 'cl_from = fp_page_id' ); |
| 73 | + $this->addWhereFld( 'cl_to', $params['category'] ); |
| 74 | + $useIndex['categorylinks'] = 'cl_from'; |
| 75 | + } |
69 | 76 | $this->addWhereRange( |
70 | 77 | 'fp_pending_since', |
71 | 78 | $params['dir'], |
— | — | @@ -76,10 +83,7 @@ |
77 | 84 | if ( !isset( $params['start'] ) && !isset( $params['end'] ) ) |
78 | 85 | $this->addWhere( 'fp_pending_since IS NOT NULL' ); |
79 | 86 | |
80 | | - $this->addOption( |
81 | | - 'USE INDEX', |
82 | | - array( 'flaggedpages' => 'fp_pending_since' ) |
83 | | - ); |
| 87 | + $this->addOption( 'USE INDEX', $useIndex ); |
84 | 88 | |
85 | 89 | if ( is_null( $resultPageSet ) ) { |
86 | 90 | $this->addFields( array ( |
— | — | @@ -170,6 +174,9 @@ |
171 | 175 | ApiBase::PARAM_TYPE => 'namespace', |
172 | 176 | ApiBase::PARAM_ISMULTI => true, |
173 | 177 | ), |
| 178 | + 'category' => array( |
| 179 | + ApiBase::PARAM_TYPE => 'string' |
| 180 | + ), |
174 | 181 | 'filterredir' => array ( |
175 | 182 | ApiBase::PARAM_DFLT => 'all', |
176 | 183 | ApiBase::PARAM_TYPE => array( 'redirects', 'nonredirects', 'all' ) |
— | — | @@ -191,6 +198,7 @@ |
192 | 199 | 'namespace' => 'The namespaces to enumerate.', |
193 | 200 | 'filterredir' => 'How to filter for redirects.', |
194 | 201 | 'maxsize' => 'Maximum character count change size.', |
| 202 | + 'category' => 'Show pages only in the given category.', |
195 | 203 | 'filterwatched' => 'How to filter for pages on your watchlist.', |
196 | 204 | 'limit' => 'How many total pages to return.', |
197 | 205 | 'dir' => array( |
Index: trunk/extensions/FlaggedRevs/api/ApiQueryUnreviewedpages.php |
— | — | @@ -118,7 +118,7 @@ |
119 | 119 | $namespaces = FlaggedRevs::getReviewNamespaces(); |
120 | 120 | return array ( |
121 | 121 | 'start' => array ( |
122 | | - ApiBase::PARAM_TYPE => 'sring' |
| 122 | + ApiBase::PARAM_TYPE => 'string' |
123 | 123 | ), |
124 | 124 | 'end' => array ( |
125 | 125 | ApiBase::PARAM_TYPE => 'string' |