8 Jun 09:28
Re: [php] sitemap google
BMR <bmr <at> ediweb.org>
2005-06-08 07:28:02 GMT
2005-06-08 07:28:02 GMT
Je me permets de transférer ma réponse sur la liste des utilisateurs SPIP. AMHA c'est l'endroit le plus concerné. Néanmoins je peux déjà montrer mon fichier sitemap.html. C'est assez basique, mais c'est à chacun d'adapter en fonction de son site, en particulier les pages à ne pas afficher. Il fonctionne avec un fichier sitemap.php3, ce qui génère un fichier XML. Reste plus qu'à automatiser la compression en .gz... <?php echo '<' . '?xml version="1.0" encoding="UTF-8"?' . '>'; ?> <urlset xmlns="http://www.google.com/schemas/sitemap/0.84"> <url> <loc>#URL_SITE_SPIP/</loc> <changefreq>daily</changefreq> </url> <BOUCLE_secteurs(RUBRIQUES) {id_parent=0}> <url> <loc>#URL_RUBRIQUE</loc> <lastmod>[(#DATE|affdate{'Y-m-d'})]</lastmod> <changefreq>daily</changefreq> </url> <B_rubriques> <BOUCLE_rubriques(RUBRIQUES) {id_parent}> <url> <loc>#URL_RUBRIQUE</loc> <lastmod>[(#DATE|affdate{'Y-m-d'})]</lastmod> <changefreq>daily</changefreq> </url> <B_articles_rubriques> <BOUCLE_articles_rubriques(ARTICLES) {id_rubrique}> <url> <loc>#URL_ARTICLE</loc> <lastmod>[(#DATE_MODIF|affdate{'Y-m-d'})]</lastmod> <changefreq>weekly</changefreq> <priority>[(#POPULARITE|pourcent)]</priority> </url> </BOUCLE_articles_rubriques> </B_articles_rubriques> <BOUCLE_recursive(boucle_rubriques)></BOUCLE_recursive> </BOUCLE_rubriques> </B_rubriques> <B_breves> <BOUCLE_breves(ARTICLES) {id_rubrique}> <url> <loc>#URL_BREVE</loc> <lastmod>[(#DATE|affdate{'Y-m-d'})]</lastmod> <changefreq>weekly</changefreq> </url> </BOUCLE_breves> </B_breves> <B_articles> <BOUCLE_articles(ARTICLES) {id_rubrique}> <url> <loc>#URL_ARTICLE</loc> <lastmod>[(#DATE_MODIF|affdate{'Y-m-d'})]</lastmod> <changefreq>weekly</changefreq> <priority>[(#POPULARITE|pourcent)]</priority> </url> </BOUCLE_articles> </B_articles> </BOUCLE_secteurs> </urlset> Tina a écrit : >>Tu dois pouvoir générer le sitemap à l'aide de boucles SPIP, comme on le >>fait pour les fichiers RSS. > > > Oui c'est exactement ce que j'aimerai faire, quitte à leur doner ensuite une > contrib pour en faire bénéficier les autres, mais je ne vois pas comment > faire si mon fichier doit impérativement s'appeler sitemap.XML > > Faut dire que je suis pas informaticienne non plus hein ;( > > Tina > >
RSS Feed