svn: /web/php-bugs/trunk/include/ query.php
| From: | Felipe Pena | Date: | Sat, 14 Aug 2010 18:15:31 +0000 |
| Subject: | svn: /web/php-bugs/trunk/include/ query.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-8743@lists.php.net to get a copy of this message | ||
felipe Sat, 14 Aug 2010 18:15:31 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=302230
Log:
- Fix code, cannot change $order_by because it used in the pagination :P
Changed paths:
U web/php-bugs/trunk/include/query.php
Modified: web/php-bugs/trunk/include/query.php
===================================================================
--- web/php-bugs/trunk/include/query.php 2010-08-14 17:03:23 UTC (rev 302229)
+++ web/php-bugs/trunk/include/query.php 2010-08-14 18:15:31 UTC (rev 302230)
@@ -194,13 +194,12 @@
switch ($order_by) {
case 'avg_score':
- $order_by = "IFNULL(AVG(v.score), 0)+3 $direction, COUNT(v.bug) DESC";
+ $query .= " ORDER BY IFNULL(AVG(v.score), 0)+3 $direction, COUNT(v.bug) DESC";
break;
case 'votes_count':
- $order_by = "COUNT(v.bug) $direction";
+ $query .= " ORDER BY COUNT(v.bug) $direction";
break;
}
- $query .= " ORDER BY $order_by";
} else {
$query .= " ORDER BY $order_by $direction";
}