. */ /* */ /*************************************************************************************/ @ini_set('default_socket_timeout', 5); require_once("pre.php"); session_start(); header("Content-type: text/html; charset=utf-8"); if(isset($action)) if($action == "deconnexion") unset($_SESSION["util"]); require_once("../lib/simplepie.inc"); function couperTexte($texte, $nbcar){ if (strlen($texte) < $nbcar) return $texte; $arr = explode("\n", wordwrap ($texte, $nbcar, "\n")); return $arr[0] . "…"; } function lire_feed($url, $nb=3) { $feed = new SimplePie($url, '../client/cache/flux'); $feed->init(); $feed->handle_content_type(); $tab = $feed->get_items(); return (count($tab) > 0) ? array_slice($tab, 0, 3) : false; } function afficher_feed($url, $picto, $nb = 3) { $items = lire_feed($url, $nb); if ($items !== false) { foreach($items as $item){ $link = $item->get_permalink(); $title = strip_tags($item->get_title()); $author = strip_tags($item->get_author()); $description = $item->get_description(); $date = $item->get_date('d/m/Y'); ?>