X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fgadgets.php;h=5ed8d007a61ce1d8746f4c0d3f91f151e9da6d2a;hb=a1c554a92888e0b017ba362817a67cc2849a9154;hp=ede101f7ccfec2f8cbace0d0b573b309e3e99d6c;hpb=a6391000e89c59f3c26d1a62bb06857df706bf50;p=platal.git diff --git a/modules/gadgets.php b/modules/gadgets.php index ede101f..5ed8d00 100644 --- a/modules/gadgets.php +++ b/modules/gadgets.php @@ -1,6 +1,6 @@ $this->make_hook('ig_events_xml', AUTH_PUBLIC, 'user', NO_HTTPS), - 'gadgets/ig-events' => $this->make_hook('ig_events', AUTH_PUBLIC), + 'gadgets/ig-events' => $this->make_hook('ig_events', AUTH_PUBLIC), 'gadgets/ig-search.xml' => $this->make_hook('ig_search_xml', AUTH_PUBLIC, 'user', NO_HTTPS), - 'gadgets/ig-search' => $this->make_hook('ig_search', AUTH_PUBLIC), + 'gadgets/ig-search' => $this->make_hook('ig_search', AUTH_PUBLIC), ); } @@ -42,14 +42,13 @@ class GadgetsModule extends PLModule require_once 'gadgets/gadgets.inc.php'; init_igoogle_html('gadgets/ig-events.tpl', AUTH_COOKIE); - $events = XDB::iterator('SELECT SQL_CALC_FOUND_ROWS + $events = XDB::iterator("SELECT SQL_CALC_FOUND_ROWS e.id, e.titre, UNIX_TIMESTAMP(e.creation_date) AS creation_date, - IF(u.nom_usage = "", u.nom, u.nom_usage) AS nom, u.prenom, u.promo, - ev.user_id IS NULL AS nonlu, e.user_id - FROM evenements AS e - LEFT JOIN evenements_vus AS ev ON (e.id = ev.evt_id AND ev.user_id = {?}) - WHERE FIND_IN_SET("valide", e.flags) AND peremption >= NOW() - ORDER BY e.creation_date DESC', S::i('uid')); + ev.uid IS NULL AS nonlu, e.uid + FROM announces AS e + LEFT JOIN announce_read AS ev ON (e.id = ev.evt_id AND ev.uid = {?}) + WHERE FIND_IN_SET('valide', e.flags) AND expiration >= NOW() + ORDER BY e.creation_date DESC", S::i('uid')); $page->assign('event_count', XDB::query("SELECT FOUND_ROWS()")->fetchOneCell()); Platal::load('events', 'feed.inc.php'); @@ -72,8 +71,10 @@ class GadgetsModule extends PLModule function handler_ig_search(&$page) { if (Env::has('quick') && Env::s('quick') != '') { + global $globals; require_once 'userset.inc.php'; - $view = new SearchSet(true); + + $view = new QuickSearchSet(); $view->addMod('gadget', 'Gadget', true); $view->apply(null, $page); @@ -86,6 +87,8 @@ class GadgetsModule extends PLModule $page->assign('error', 'Recherche trop générale.'); } elseif (empty($nb_tot)) { $page->assign('error', 'Il n\'existe personne correspondant à ces critères dans la base !'); + } else { + $page->assign('error', false); } }