1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| $resultat_requete=mysql_query("SELECT * FROM flux_rss ORDER BY date_publication DESC limit 0, 5") or die (mysql_error());
// extraction des 10 dernières nouvelles
while($lig=mysql_fetch_assoc($resultat_requete)){
$titre=$lig["titre_flux"];
$adresse=$lig["lien_flux"];
$contenu=$lig["contenu_flux"];
$image .= $lig["lien_image_flux"];
$date=$lig["date_publication"];
$datephp=date("D, d M Y H:i:s +0100", $date);
$xml .= '<item>';
$xml .= '<title>'.$titre.'</title>';
$xml .= '<link>'.$adresse.'</link>';
$xml .= '<guid>'.$adresse.'</guid>';
$xml .= '<pubDate>'.$datephp.'</pubDate>';
$xml .= '<description>'.$contenu.'</description>';
$xml .= '<image>';
$xml .= ' <url>'.$image.'</url>';
$xml .= ' <link>http://www.chicdressing.com</link>';
$xml .= '</image>';
$xml .= '</item>';
}//fin du while |
Partager