From: x2000habouzit Date: Sat, 13 Nov 2004 08:48:26 +0000 (+0000) Subject: closes FS#213 X-Git-Tag: xorg/old~975 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=e7fb2d6df627237528d23188e71bde3f852e193e;p=platal.git closes FS#213 --- diff --git a/include/notifs.inc.php b/include/notifs.inc.php index 00b06fd..547b47d 100644 --- a/include/notifs.inc.php +++ b/include/notifs.inc.php @@ -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); diff --git a/templates/carnet/index.tpl b/templates/carnet/index.tpl index 5ec4d50..96f839b 100644 --- a/templates/carnet/index.tpl +++ b/templates/carnet/index.tpl @@ -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 $ ***************************************************************************}

Carnet polytechnicien

@@ -59,7 +59,7 @@
- Bilan de tes notifications + Tous les évenements de la semaine
Affichage de tous les évenements de camarades/promos