xdb->query( 'SELECT a.id FROM aliases AS a INNER JOIN auth_user_quick AS q ON ( a.id = q.user_id AND q.core_rss_hash = {?} ) WHERE a.alias = {?} AND a.type != "homonyme"', $hash, $alias); $uid = $res->fetchOneCell(); } require_once('notifs.inc.php'); $notifs = new Notifs($uid, true); $annivcat = false; foreach ($notifs->_cats as $cat) if (preg_match('/anniv/i', $cat['short'])) $annivcat = $cat['id']; if ($annivcat !== false) { $annivs = array(); foreach ($notifs->_data[$annivcat] as $promo) foreach ($promo as $notif) if ($all || $notif['contact']) { $annivs[] = array( 'timestamp' => $notif['known'], 'date' => strtotime($notif['date']), 'tomorrow' => strtotime("+1 day", strtotime($notif['date'])), 'bestalias' => $notif['bestalias'], 'summary' => 'Anniversaire de '.$notif['prenom'].' '.$notif['nom'].' - x '.$notif['promo'], ); } $page->assign('events', $annivs); } header('Content-Type: text/calendar; charset=utf-8'); $page->run(); ?>