Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php |
— | — | @@ -122,7 +122,7 @@ |
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
126 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 126 | + foreach ( $res as $row ) { |
127 | 127 | $title = Title::makeTitle( $row->page_namespace, $row->page_title ); |
128 | 128 | |
129 | 129 | if ( !$title ) { |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | return; |
132 | 132 | } |
133 | 133 | |
134 | | - $titleText = ( true == $this->params['nameSpace'] ) ? $title->getPrefixedText() : $title->getText(); |
| 134 | + //$titleText = ( $this->params['nameSpace'] ) ? $title->getPrefixedText() : $title->getText(); |
135 | 135 | |
136 | 136 | if ( 'sitemap' == $this->params['feed'] ) { |
137 | 137 | |
— | — | @@ -200,7 +200,7 @@ |
201 | 201 | } |
202 | 202 | switch( $this->params['quality'] ) { |
203 | 203 | case 'only': |
204 | | - $sqlWhere .= ' AND fp_quality >= 1'; |
| 204 | + $sqlWhere .= ' AND fp_quality >= 1'; |
205 | 205 | break; |
206 | 206 | case 'exclude': |
207 | 207 | $sqlWhere .= ' AND fp_quality = 0'; |
— | — | @@ -211,17 +211,17 @@ |
212 | 212 | switch ( $this->params['redirects'] ) { |
213 | 213 | case 'only': |
214 | 214 | $sqlWhere .= ' AND page_is_redirect = 1 '; |
215 | | - break; |
| 215 | + break; |
216 | 216 | case 'exclude': |
217 | 217 | $sqlWhere .= ' AND page_is_redirect = 0 '; |
218 | | - break; |
| 218 | + break; |
219 | 219 | } |
220 | 220 | |
221 | 221 | $currentTableNumber = 0; |
222 | 222 | |
223 | 223 | for ( $i = 0; $i < $this->params['catCount']; $i++ ) { |
224 | 224 | $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'; |
226 | 226 | $sqlSelectFrom .= ( $currentTableNumber + 1 ) . '.cl_from AND c' . ( $currentTableNumber + 1 ); |
227 | 227 | |
228 | 228 | $sqlSelectFrom .= '.cl_to=' . $this->params['dbr']->addQuotes( $this->categories[$i]->getDBkey() ); |
— | — | @@ -269,13 +269,12 @@ |
270 | 270 | * Parse parameters, populates $this->params |
271 | 271 | **/ |
272 | 272 | public function unload_params() { |
273 | | - global $wgContLang; |
274 | | - global $wgRequest; |
| 273 | + global $wgContLang, $wgRequest; |
275 | 274 | |
276 | 275 | $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' ); |
280 | 279 | // $title = Title::newFromText( $parser->transformMsg( $category, $poptions ) ); |
281 | 280 | // if ( is_object( $title ) ){ |
282 | 281 | // $this->categories[] = $title; |
— | — | @@ -342,8 +341,8 @@ |
343 | 342 | $cats = $title->getParentCategories(); |
344 | 343 | $str = ''; |
345 | 344 | # the following code is based (stolen) from r56954 of flagged revs. |
346 | | - $catMap = Array(); |
347 | | - $catMask = Array(); |
| 345 | + $catMap = array(); |
| 346 | + $catMask = array(); |
348 | 347 | $msg = wfMsg( 'googlenewssitemap_categorymap' ); |
349 | 348 | if ( !wfEmptyMsg( 'googlenewssitemap_categorymap', $msg ) ) { |
350 | 349 | $list = explode( "\n*", "\n$msg" ); |