closes FS#213
authorx2000habouzit <x2000habouzit>
Sat, 13 Nov 2004 08:48:26 +0000 (08:48 +0000)
committerx2000habouzit <x2000habouzit>
Sat, 13 Nov 2004 08:48:26 +0000 (08:48 +0000)
include/notifs.inc.php
templates/carnet/index.tpl

index 00b06fd..547b47d 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: notifs.inc.php,v 1.16 2004-11-08 06:09:03 x2000habouzit Exp $
+        $Id: notifs.inc.php,v 1.17 2004-11-13 08:48:26 x2000habouzit Exp $
  ***************************************************************************/
 
 define("WATCH_FICHE", 1);
@@ -52,6 +52,8 @@ function getNbNotifs() {
     if(!isset($_SESSION['uid'])) return 0;
     $uid = $_SESSION['uid'];
 
+    $watchlast = $_SESSION['watch_last'];
+
     $res = $globals->db->query("
     (
            SELECT  u.promo, u.prenom, IF(u.epouse='',u.nom,u.epouse) AS nom, a.alias AS forlife,
@@ -62,7 +64,7 @@ function getNbNotifs() {
        INNER JOIN  watch_sub       AS ws ON(wo.cid=ws.cid AND ws.uid=c.uid)
        INNER JOIN  auth_user_md5   AS u  ON(u.user_id = wo.uid)
         LEFT JOIN  aliases         AS a  ON(u.user_id = a.id AND a.type='a_vie')
-            WHERE  q.user_id = '$uid' AND FIND_IN_SET('contacts',q.watch_flags) AND wo.known > q.watch_last
+            WHERE  q.user_id = '$uid' AND FIND_IN_SET('contacts',q.watch_flags) AND wo.known > $watchlast
     ) UNION DISTINCT (
            SELECT  u.promo, u.prenom, IF(u.epouse='',u.nom,u.epouse) AS nom, a.alias AS forlife,
                    wo.*, NOT (c.contact IS NULL) AS contact, (u.perms='admin' OR u.perms='user') AS inscrit
@@ -74,7 +76,7 @@ function getNbNotifs() {
        INNER JOIN  watch_sub       AS ws ON(wo.cid=ws.cid AND ws.uid=w.uid)
        INNER JOIN  watch_cat       AS wc ON(wc.id=wo.cid AND wc.frequent=0)
         LEFT JOIN  aliases         AS a  ON(u.user_id = a.id AND a.type='a_vie')
-            WHERE  w.uid = '$uid' AND wo.known > q.watch_last
+            WHERE  w.uid = '$uid' AND wo.known > $watchlast
     ) UNION DISTINCT (
            SELECT  u.promo, u.prenom, IF(u.epouse='',u.nom,u.epouse) AS nom, a.alias AS forlife,
                    wo.*, 0 AS contact, (u.perms='admin' OR u.perms='user') AS inscrit
@@ -85,7 +87,7 @@ function getNbNotifs() {
        INNER JOIN  watch_sub       AS ws ON(wo.cid=ws.cid AND ws.uid=w.uid)
        INNER JOIN  watch_cat       AS wc ON(wc.id=wo.cid)
         LEFT JOIN  aliases         AS a  ON(u.user_id = a.id AND a.type='a_vie')
-            WHERE  w.uid = '$uid' AND wo.known > q.watch_last
+            WHERE  w.uid = '$uid' AND wo.known > $watchlast
     )");
     $n = mysql_num_rows($res);
     mysql_free_result($res);
index 5ec4d50..96f839b 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: index.tpl,v 1.3 2004-11-06 18:18:44 x2000habouzit Exp $
+        $Id: index.tpl,v 1.4 2004-11-13 08:48:27 x2000habouzit Exp $
  ***************************************************************************}
 
 <h1>Carnet polytechnicien</h1>
@@ -59,7 +59,7 @@
   <tr class="pair">
     <td class='half'>
       <div class="question">
-        <a href="{"carnet/panel.php"|url}">Bilan de tes notifications</a>
+        <a href="{"carnet/panel.php"|url}">Tous les évenements de la semaine</a>
       </div>
       <div class="explication">
         Affichage de tous les évenements de camarades/promos