Uncommitted stuff from last week, close #636 and #638
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Wed, 21 Feb 2007 21:55:30 +0000 (21:55 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Wed, 21 Feb 2007 21:55:30 +0000 (21:55 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1508 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
modules/lists.php

index 46b06bc..4619a52 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,10 @@ Bug/Wish:
     * Profile:
         - Better checks on image type for photos                           -FRU
 
+    * Lists:
+        - #636: Remove non-X from trombi                                   -FRU
+        - #638: Sort trombi by promo then name                             -FRU
+
     * Xnet:
         - #639: Fix the number of pages                                    -FRU
 
index cc6461f..6846729 100644 (file)
@@ -283,13 +283,17 @@ class ListsModule extends PLModule
                                                  promo, a.alias AS forlife
                                            FROM  auth_user_md5 AS u
                                      INNER JOIN  aliases AS a ON u.user_id = a.id
+                                     INNER JOIN  photo AS p ON p.uid = u.user_id
                                           WHERE  a.alias = {?}", $m);
             if ($tmp = $res->fetchOneAssoc()) {
                 $membres[$tmp['nom']] = $tmp;
             } else {
-                $membres[$member[0]] = array('addr' => $member[0]);
+                $total--;
             }
         }
+        uasort($membres, create_function('$a,$b', 'return $a["promo"] > $b["promo"] || '
+                                                . '($a["promo"] == $b["promo"] && (strcmp($a["nom"], $b["nom"]) > 0 || '
+                                                . '($a["nom"] == $b["nom"] && strcmp($a["prenom"], $b["prenom"]) > 0)));'));
         return array($total, $membres);
     }