announces.user_id -> announces.uid
[platal.git] / modules / gadgets.php
index b02b686..d769a9d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -45,9 +45,9 @@ class GadgetsModule extends PLModule
         $events = XDB::iterator('SELECT  SQL_CALC_FOUND_ROWS
                                          e.id, e.titre, UNIX_TIMESTAMP(e.creation_date) AS creation_date,
                                          IF(u.nom_usage = "", u.nom, u.nom_usage) AS nom, u.prenom, u.promo,
-                                         ev.user_id IS NULL AS nonlu, e.user_id
-                                   FROM  evenements AS e
-                              LEFT JOIN  evenements_vus AS ev ON (e.id = ev.evt_id AND ev.user_id = {?})
+                                         ev.user_id IS NULL AS nonlu, e.uid
+                                   FROM  announces AS e
+                              LEFT JOIN  announce_read AS ev ON (e.id = ev.evt_id AND ev.uid = {?})
                                   WHERE  FIND_IN_SET("valide", e.flags) AND peremption >= NOW()
                                ORDER BY  e.creation_date DESC', S::i('uid'));
         $page->assign('event_count', XDB::query("SELECT FOUND_ROWS()")->fetchOneCell());