-// {{{ function getNbNotifs
-
-function getNbNotifs() {
- if (!S::has('uid')) {
- return 0;
- }
- $uid = S::v('uid', -1);
- $watchlast = S::v('watch_last');
-
- // selectionne les notifs de uid, sans detail sur le watcher, depuis
- // $watchlast, meme ceux sans surveillance, non ordonnés
- $res = select_notifs(false, $uid, $watchlast, false);
- $n = $res->numRows();
- $res->free();
- if ($n == 0) {
- return;
+// {{{
+
+global $prf_desc;
+$prf_desc = array('nom' => 'Son patronyme',
+ 'freetext' => 'Le texte libre',
+ 'mobile' => 'Son numéro de téléphone portable',
+ 'nationalite' => 'Sa nationalité',
+ 'nick' => 'Son surnom',
+ 'web' => 'L\'adresse de son site web',
+ 'appli1' => 'Son école d\'application',
+ 'appli2' => 'Son école de post-application',
+ 'addresses' => 'Ses adresses',
+ 'section' => 'Sa section sportive',
+ 'binets' => 'La liste de ses binets',
+ 'medals' => 'Ses décorations',
+ 'cv' => 'Son Curriculum Vitae',
+ 'jobs' => 'Ses informations professionnelles',
+ 'photo' => 'Sa photographie');
+
+function get_profile_change_details($event, $limit) {
+ global $prf_desc;
+ $res = XDB::iterRow("SELECT field
+ FROM watch_profile
+ WHERE uid = {?} AND ts > {?}
+ ORDER BY ts DESC",
+ $event['uid'], $limit);
+ if ($res->total() > 0) {
+ $data = array();
+ while (list($field) = $res->next()) {
+ $data[] .= $prf_desc[$field];
+ }
+ return '<ul><li>' . implode('</li><li>', $data) . '</li></ul>';