r93582 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93581‎ | r93582 | r93583 >
Date:10:27, 31 July 2011
Author:yuvipanda
Status:deferred
Tags:
Comment:
Fix to make filtering work
Modified paths:
  • /trunk/extensions/GPoC/models/Rating.php (modified) (history)
  • /trunk/extensions/GPoC/templates/FilterRatingsTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GPoC/templates/FilterRatingsTemplate.php
@@ -31,15 +31,17 @@
3232 <h3>Results</h3>
3333 <table>
3434 <tr>
 35+ <th>Project</th>
3536 <th>Article</th>
3637 <th>Importance</th>
37 - <th>Quality</th>
 38+ <th>Quality</th>
3839 </tr>
3940 <?php foreach( $articles as $article ) { ?>
4041 <tr>
41 - <td><?php echo $article['r_article']; ?></td>
 42+ <td><?php echo $article['r_project'] ?></td>
 43+ <td><a href="<?php echo $article['title']->getLinkURL(); ?>"><?php echo $article['r_article']; ?></a></td>
4244 <td><?php echo $article['r_importance']; ?></td>
43 - <td><?php echo $article['r_quality']; ?></td>
 45+ <td><?php echo $article['r_quality']; ?></td>
4446 </tr>
4547 <?php } ?>
4648 </table>
Index: trunk/extensions/GPoC/models/Rating.php
@@ -173,12 +173,11 @@
174174 $dbr = wfGetDB( DB_SLAVE );
175175 $database_filters = array();
176176
177 - foreach($filters as $column => $value) {
178 - if( ! ( !isset($value) or $value == null or $value == "" ) && in_array( $value, $database_filters_columns ) ) {
 177+ foreach($filters as $column => $value) {
 178+ if( ! ( !isset($value) or $value == null or $value == "" ) && in_array( $column, $database_filters_columns ) ) {
179179 $database_filters[$column] = $value;
180180 }
181181 }
182 -
183182 $category_filters = explode( ',', trim( $filters['categories'] ) );
184183 $query = $dbr->select(
185184 'ratings',

Status & tagging log