FENORAM http://www.microtel.fr.eu.org/Clubs/FENORAM.FDR/flux.php Site web de la Federation Normande Ademir Microtel. Mise à disposition des comptes-rendus de réunion. fr-fr END_OF_HEADER; // Output items foreach ($array_of_item as $itm) { $lnk = "http://www.microtel.fr.eu.org/Clubs/FENORAM.FDR/".$itm[4]; echo "\n"; echo "Compte-rendu de la réunion du ", 1*$itm[0], " ", $french_month[($itm[1]-1)], " ", $itm[2], "\n"; echo "", $lnk, "\n"; echo "Suivez le lien pour accéder au compte-rendu.\n"; $pubdate = format_date_rfc822($itm[3]); echo "", $pubdate, "\n"; echo "", uuid($lnk), "\n"; echo "\n"; } // foreach // Closing tags echo "\n"; echo "\n"; } // output_rss() function output_atom($array_of_item) { global $french_month; // Sending XML header("Content-type: text/xml"); // Output header echo << FENORAM Site web de la Federation Normande Ademir Microtel. Mise à disposition des comptes-rendus de réunion. Fenoram END_OF_HEADER; // id of feed echo "urn:uuid:", uuid("http://www.microtel.fr.eu.org/Clubs/FENORAM.FDR/flux.php?format=atom"), "\n"; // Look for newest item $newest = 0; // a long integer containing the number of seconds // since the Unix Epoch (January 1 1970) foreach ($array_of_item as $itm) { if ($itm[3] > $newest) { $newest = $itm[3]; } } echo "", format_date_rfc3339($newest), "\n"; // Output items foreach ($array_of_item as $itm) { $lnk = "http://www.microtel.fr.eu.org/Clubs/FENORAM.FDR/".$itm[4]; echo "\n"; echo "Compte-rendu de la réunion du ", 1*$itm[0], " ", $french_month[($itm[1]-1)], " ", $itm[2], "\n"; echo "\n"; echo "Suivez le lien pour accéder au compte-rendu.\n"; $pubdate = format_date_rfc3339($itm[3]); echo "", $pubdate, "\n"; echo "urn:uuid:", uuid($lnk), "\n"; echo "\n"; } // foreach // Closing tags echo "\n"; } // output_atom() // Look for meeting minute pages of the form rddmmyyyy.php or .pdf $ary_item = array(); $dir_hndl = opendir("."); if ($dir_hndl) { while(($filename = readdir($dir_hndl)) != false) { if (preg_match("/r(\d\d)(\d\d)(\d\d\d\d).p[hd][pf]/", $filename, $matches)) { // Create a new item $yr = $matches[3]; if ($yr >= START_YEAR) { array_push($ary_item, array($matches[1], $matches[2], $matches[3], filemtime($filename), $filename)); } } } closedir($dir_hndl); } // Output flux if (count($ary_item) > 0) { if (array_key_exists("format", $_GET) and $_GET["format"] == "atom") { // Atom if required output_atom($ary_item); } else { // RSS by default output_rss($ary_item); } } // if (count(... ?>