xdb->query('SELECT date, naissance FROM auth_user_md5 WHERE user_id={?}', Session::getInt('uid')); list($date, $naissance) = $res->fetchOneRow(); // incitation à mettre à jour la fiche $d2 = mktime(0, 0, 0, substr($date, 5, 2), substr($date, 8, 2), substr($date, 0, 4)); if( (time() - $d2) > 60 * 60 * 24 * 400 ) { // si fiche date de + de 400j; $page->assign('fiche_incitation', $date); } // Souhaite bon anniversaire if (substr($naissance, 5) == date("m-d")) { $page->assign('birthday', date("Y") - substr($naissance, 0, 4)); } // incitation à mettre une photo $res = $globals->xdb->query('SELECT COUNT(*) FROM photo WHERE uid={?}', Session::getInt('uid')); $page->assign('photo_incitation', $res->fetchOneCell() == 0); // Incitation à se géolocaliser require_once('geoloc.inc.php'); $res = localize_addresses(Session::getInt('uid', -1)); $page->assign('geoloc_incitation', count($res)); // affichage de la boîte avec quelques liens require_once('login.conf.php') ; $pub_nbElem = $pub_nbLig * $pub_nbCol ; if (count($pub_tjs) <= $pub_nbElem) $publicite = array_slice ($pub_tjs,0,$pub_nbElem) ; else $publicite = $pub_tjs ; $nbAlea = $pub_nbElem - count($publicite) ; if ($nbAlea > 0) { $choix = array_rand($pub_rnd,$nbAlea) ; foreach ($choix as $url) $publicite[$url] = $pub_rnd[$url] ; } $publicite = array_chunk( $publicite , $pub_nbLig , true ) ; $page->assign_by_ref('publicite', $publicite); // ajout du lien RSS if (Session::has('core_rss_hash')) { $page->assign('xorg_rss', Array("title" => "Polytechnique.org :: News", "href" => "/rss.php/".Session::get('forlife')."/".Session::get('core_rss_hash').".xml")); } // affichage des evenements // annonces promos triées par présence d'une limite sur les promos // puis par dates croissantes d'expiration $promo = Session::getInt('promo'); $sql = "SELECT e.id,e.titre,e.texte,a.user_id,a.nom,a.prenom,a.promo,l.alias AS forlife FROM evenements AS e INNER JOIN auth_user_md5 AS a ON e.user_id=a.user_id INNER JOIN aliases AS l ON ( a.user_id=l.id AND l.type='a_vie' ) WHERE FIND_IN_SET(e.flags, 'valide') AND peremption >= NOW() AND (e.promo_min = 0 || e.promo_min <= {?}) AND (e.promo_max = 0 || e.promo_max >= {?}) ORDER BY (e.promo_min != 0 AND e.promo_max != 0) DESC, e.peremption"; $page->assign('evenement', $globals->xdb->iterator($sql, $promo, $promo)); $page->run(); // vim:set et sws=4 sw=4 sts=4: ?>