r79227 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79226‎ | r79227 | r79228 >
Date:02:37, 30 December 2010
Author:reedy
Status:deferred
Tags:
Comment:
Comment out some unused stuff, fixup some indenting
Modified paths:
  • /trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php
@@ -122,7 +122,7 @@
123123 }
124124 }
125125
126 - while ( $row = $dbr->fetchObject( $res ) ) {
 126+ foreach ( $res as $row ) {
127127 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
128128
129129 if ( !$title ) {
@@ -130,7 +130,7 @@
131131 return;
132132 }
133133
134 - $titleText = ( true == $this->params['nameSpace'] ) ? $title->getPrefixedText() : $title->getText();
 134+ //$titleText = ( $this->params['nameSpace'] ) ? $title->getPrefixedText() : $title->getText();
135135
136136 if ( 'sitemap' == $this->params['feed'] ) {
137137
@@ -200,7 +200,7 @@
201201 }
202202 switch( $this->params['quality'] ) {
203203 case 'only':
204 - $sqlWhere .= ' AND fp_quality >= 1';
 204+ $sqlWhere .= ' AND fp_quality >= 1';
205205 break;
206206 case 'exclude':
207207 $sqlWhere .= ' AND fp_quality = 0';
@@ -211,17 +211,17 @@
212212 switch ( $this->params['redirects'] ) {
213213 case 'only':
214214 $sqlWhere .= ' AND page_is_redirect = 1 ';
215 - break;
 215+ break;
216216 case 'exclude':
217217 $sqlWhere .= ' AND page_is_redirect = 0 ';
218 - break;
 218+ break;
219219 }
220220
221221 $currentTableNumber = 0;
222222
223223 for ( $i = 0; $i < $this->params['catCount']; $i++ ) {
224224 $sqlSelectFrom .= ' INNER JOIN ' . $this->params['dbr']->tableName( 'categorylinks' );
225 - $sqlSelectFrom .= ' AS c' . ( $currentTableNumber + 1 ) . ' ON page_id = c';
 225+ $sqlSelectFrom .= ' AS c' . ( $currentTableNumber + 1 ) . ' ON page_id = c';
226226 $sqlSelectFrom .= ( $currentTableNumber + 1 ) . '.cl_from AND c' . ( $currentTableNumber + 1 );
227227
228228 $sqlSelectFrom .= '.cl_to=' . $this->params['dbr']->addQuotes( $this->categories[$i]->getDBkey() );
@@ -269,13 +269,12 @@
270270 * Parse parameters, populates $this->params
271271 **/
272272 public function unload_params() {
273 - global $wgContLang;
274 - global $wgRequest;
 273+ global $wgContLang, $wgRequest;
275274
276275 $this->params = array();
277 - $parser = new Parser;
278 - $poptions = new ParserOptions;
279 - $category = $wgRequest->getArray( 'category', 'Published' );
 276+ //$parser = new Parser;
 277+ //$poptions = new ParserOptions;
 278+ //$category = $wgRequest->getArray( 'category', 'Published' );
280279 // $title = Title::newFromText( $parser->transformMsg( $category, $poptions ) );
281280 // if ( is_object( $title ) ){
282281 // $this->categories[] = $title;
@@ -342,8 +341,8 @@
343342 $cats = $title->getParentCategories();
344343 $str = '';
345344 # the following code is based (stolen) from r56954 of flagged revs.
346 - $catMap = Array();
347 - $catMask = Array();
 345+ $catMap = array();
 346+ $catMask = array();
348347 $msg = wfMsg( 'googlenewssitemap_categorymap' );
349348 if ( !wfEmptyMsg( 'googlenewssitemap_categorymap', $msg ) ) {
350349 $list = explode( "\n*", "\n$msg" );

Status & tagging log