core->sitename . ' :: News', $globals->baseurl, 'Informations et Activités polytechniciennes', $globals->baseurl . '/images/logo.png', 'events/rss.tpl'); } public static function nextEvent(PlIterator &$it, PlUser &$user) { while ($body = $it->next()) { $uf = UserFilter::getLegacy($body['promo_min'], $body['promo_max']); if ($uf->checkUser($user)) { return $body; } } return null; } protected function fetch(PlUser &$user) { global $globals; $events = XDB::iterator('SELECT e.id, e.titre AS title, e.texte, e.creation_date AS publication, e.post_id, p.attachmime IS NOT NULL AS photo, FIND_IN_SET(\'wiki\', e.flags) AS wiki, e.uid, e.promo_min, e.promo_max FROM announces AS e LEFT JOIN announce_photos AS p ON (p.eid = e.id) WHERE FIND_IN_SET("valide", e.flags) AND expiration >= NOW()'); $data = array(); while ($e = self::nextEvent($events, $user)) { $author = User::getWithUID($e['user_id']); $promo = $author->promo(); $e['author'] = $author->fullName() . ($promo ? ' (' . $promo . ')' : ''); $e['link'] = $globals->baseurl . '/events#newsid' . $e['id']; $data[] = $e; } return PlIteratorUtils::fromArray($data, 1, true); } } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>