Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php |
— | — | @@ -46,7 +46,6 @@ |
47 | 47 | **/ |
48 | 48 | var $wgDPlminCategories = 1; // Minimum number of categories to look for |
49 | 49 | var $wgDPlmaxCategories = 6; // Maximum number of categories to look for |
50 | | - var $wgDPLminResultCount = 1; // Minimum number of results to allow |
51 | 50 | var $wgDPLmaxResultCount = 50; // Maximum number of results to allow |
52 | 51 | |
53 | 52 | /** |
— | — | @@ -153,7 +152,7 @@ |
154 | 153 | |
155 | 154 | $dbr = wfGetDB( DB_SLAVE ); |
156 | 155 | |
157 | | - $tables[]=$dbr->tableName( 'page' ); |
| 156 | + $tables[] = $dbr->tableName( 'page' ); |
158 | 157 | |
159 | 158 | //this is a little hacky, c1 is dynamically defined as the first category |
160 | 159 | //so this can't ever work with uncategorized articles |
— | — | @@ -218,10 +217,10 @@ |
219 | 218 | /* |
220 | 219 | for ( $i = 0; $i < $this->params['notCatCount']; $i++ ) { |
221 | 220 | // echo "notCategory parameter $i<br />\n"; |
222 | | - $sqlSelectFrom .= ' LEFT OUTER JOIN ' . $this->params['dbr']->tableName( 'categorylinks' ); |
| 221 | + $sqlSelectFrom .= ' LEFT OUTER JOIN ' . $dbr->tableName( 'categorylinks' ); |
223 | 222 | $sqlSelectFrom .= ' AS c' . ( $currentTableNumber + 1 ) . ' ON page_id = c' . ( $currentTableNumber + 1 ); |
224 | 223 | $sqlSelectFrom .= '.cl_from AND c' . ( $currentTableNumber + 1 ); |
225 | | - $sqlSelectFrom .= '.cl_to=' . $this->params['dbr']->addQuotes( $this->notCategories[$i]->getDBkey() ); |
| 224 | + $sqlSelectFrom .= '.cl_to=' . $dbr->addQuotes( $this->notCategories[$i]->getDBkey() ); |
226 | 225 | |
227 | 226 | $conditions .= ' AND c' . ( $currentTableNumber + 1 ) . '.cl_to IS NULL'; |
228 | 227 | |
— | — | @@ -269,21 +268,22 @@ |
270 | 269 | |
271 | 270 | // FIXME:notcats |
272 | 271 | // $this->notCategories[] = $wgRequest->getArray('notcategory'); |
273 | | - $this->params['nameSpace'] = $wgContLang->getNsIndex( $wgRequest->getVal( 'namespace', 0 ) ); |
274 | | - $this->params['count'] = $wgRequest->getInt( 'count', $this->wgDPLmaxResultCount ); |
| 272 | + $this->params['nameSpace'] = $wgContLang->getNsIndex( $wgRequest->getVal( 'namespace', 0 ) ); |
| 273 | + $this->params['count'] = $wgRequest->getInt( 'count', $this->wgDPLmaxResultCount ); |
| 274 | + |
275 | 275 | if ( ( $this->params['count'] > $this->wgDPLmaxResultCount ) |
276 | | - || ( $this->params['count'] < $this->wgDPLminResultCount ) ) { |
| 276 | + || ( $this->params['count'] < 1 ) ) { |
277 | 277 | $this->params['count'] = $this->wgDPLmaxResultCount; |
278 | 278 | } |
279 | 279 | |
280 | | - $this->params['order'] = $wgRequest->getVal( 'order', 'descending' ); |
| 280 | + $this->params['order'] = $wgRequest->getVal( 'order', 'descending' ); |
281 | 281 | $this->params['orderMethod'] = $wgRequest->getVal( 'ordermethod', 'categoryadd' ); |
282 | | - $this->params['redirects'] = $wgRequest->getVal( 'redirects', 'exclude' ); |
283 | | - $this->params['stable'] = $wgRequest->getVal( 'stable', 'only' ); |
284 | | - $this->params['quality'] = $wgRequest->getVal( 'qualitypages', 'only' ); |
| 282 | + $this->params['redirects'] = $wgRequest->getVal( 'redirects', 'exclude' ); |
| 283 | + $this->params['stable'] = $wgRequest->getVal( 'stable', 'only' ); |
| 284 | + $this->params['quality'] = $wgRequest->getVal( 'qualitypages', 'only' ); |
285 | 285 | $this->params['suppressErrors'] = $wgRequest->getBool( 'supresserrors', false ); |
286 | 286 | $this->params['useNameSpace'] = $wgRequest->getBool( 'usenamespace', false ); |
287 | | - $this->params['useCurId'] = $wgRequest->getBool( 'usecurid', false ); |
| 287 | + $this->params['useCurId'] = $wgRequest->getBool( 'usecurid', false ); |
288 | 288 | $this->params['feed'] = $wgRequest->getVal( 'feed', 'sitemap' ); |
289 | 289 | |
290 | 290 | $this->params['catCount'] = count( $this->categories ); |
— | — | @@ -311,7 +311,6 @@ |
312 | 312 | $this->params['addFirstCategoryDate'] = false; |
313 | 313 | } |
314 | 314 | |
315 | | - $this->params['dbr'] =& wfGetDB( DB_SLAVE ); |
316 | 315 | } |
317 | 316 | |
318 | 317 | function feedItemAuthor( $row ) { |