notifs are known a posteriori or a priori.
for /a priori ones/ we want the hilight to be enabled the good day (TM)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-357
require('./connect.db.inc.php');
-$date = date('Y-m-d');
+$date = date('Y-m-d', time() + 7 * 24*60*60);
$stamp = date('Ymd000000');
-$like = date('%-m-d');
+$like = date('%-m-d', time() + 7 * 24*60*60);
$globals->db->query("INSERT INTO watch_ops (uid, cid, known, date)
- SELECT user_id, 4, '$date', $stamp
+ SELECT user_id, 4, $stamp, '$date'
FROM auth_user_md5
WHERE naissance LIKE '$like'");
$page->assign('now',date('YmdHis'));
$notifs = new Notifs(Session::getInt('uid'), true);
-$page->assign_by_ref('notifs', $notifs);
+$page->assign('notifs', $notifs);
+$page->assign('today', date('Y-m-d'));
$page->run();
}
$sql .="
- INNER JOIN watch_ops AS wo ON(wo.uid = u.user_id AND wo.known > ".($mail ? 'q.watch_last' : '{?}').")
+ INNER JOIN watch_ops AS wo ON(wo.uid = u.user_id AND ".($mail ? 'wo.known > q.watch_last' : '( wo.known > {?} OR wo.date=NOW() )').")
INNER JOIN watch_sub AS ws ON(ws.cid = wo.cid AND ws.uid = w.uid)
INNER JOIN watch_cat AS wc ON(wc.id = wo.cid{$our['freq_sql']})
LEFT JOIN aliases AS a ON(a.id = u.user_id AND FIND_IN_SET('bestalias', a.flags))
<table class='tinybicol'>
{foreach from=$c key=p item=promo}
{section name=row loop=$promo}
- <tr {if $promo[row].known > $smarty.session.watch_last}style="font-weight: bold"{/if}>
+ <tr {if ( $promo[row].known > $smarty.session.watch_last ) || ( $promo[row].date eq $today ) }style="font-weight: bold"{/if}>
<td class='titre' style="width:15%">{if $smarty.section.row.first}{$p}{/if}</td>
<td>
{if $promo[row].inscrit}
alter table watch_cat add column type enum('basic', 'near', 'often') not null default 'basic';
update watch_cat set type='often' where frequent=1;
alter table watch_cat drop column frequent;
-insert into watch_cat (id, short, mail, type) values(4, 'Anniversaires', 'Ces camarades ont fêté leur anniversaire cette semaine', 'near');
-replace into watch_sub (uid, cid) select user_id, 4 from auth_user_md5 where perms in ('admin', 'user') and deces=0;
alter table watch_cat add mail_sg varchar(80) default NULL after mail;
update watch_cat set mail_sg = 'Ce camarade a mis sa fiche à jour' where id = 1;
update watch_cat set mail_sg = 'Ce camarade s\'est inscrit' where id = 2;
update watch_cat set mail_sg = 'Ce camarade nous a quitté' where id = 3;
-update watch_cat set mail_sg = 'Ce camarade a fêté son anniversaire la semaine dernère' where id = 4;
+
+insert into watch_cat (id, short, mail, mail_sg, type)
+ values(4, 'Anniversaires', 'Ces camarades fêtent leur anniversaire cette semaine', 'Ce camarade fête son anniversaire cette semaine', 'near');
+replace into watch_sub (uid, cid) select user_id, 4 from auth_user_md5 where perms in ('admin', 'user') and deces=0;