Sitemap de marama
dans Modifications
Yop
Cela s'adresse tout particulièrement à Marama.
Est-ce que le sitemap dynamique que tu as fait dans ce topic : http://forum.pluxml.org/viewtopic.php?id=542
est valable pour la dernière version de Pluxml ?
TCho, Hamtaro.
Cela s'adresse tout particulièrement à Marama.
Est-ce que le sitemap dynamique que tu as fait dans ce topic : http://forum.pluxml.org/viewtopic.php?id=542
est valable pour la dernière version de Pluxml ?
TCho, Hamtaro.
0
Connectez-vous ou Inscrivez-vous pour répondre.
Réponses
Je vais répondre pour marama.
Non. Ce fichier sitemap.php ne fonctionne pas avec la beta 4.
Le source demande a être adapté
Stéphane
Consultant PluXml
Ancien responsable et développeur de PluXml (2010 à 2018)
Marama si tu passes dans le coin, ou alors Stephane, si tu es motiv ^^
Merci d'avance.
TCho, Hamtaro.
Ca ce passe ici : http://www.memiks.com/sitemap_pluxml_41.zip
et vous pouvez le voir dans la sidebar de mon blog : http://www.memiks.com/
@++ Mémîks.
je vais tout de suite l'utiliser pour le blog de ma future femme!
http://www.miaoublog.fr
@++ Mémîks.
Tu aurais un exemple ??
Ce qu'il faudrait en fait c'est la liste complète des articles + pages statiques, mais sans les commentaires.
Je vais regarder à ca
Fréd.
Je vous donne les sources pour un sitemap.php
<?php define('PLX_ROOT', './'); define('PLX_CORE', PLX_ROOT.'core/'); define('PLX_CONF', PLX_ROOT.'data/configuration/parametres.xml'); # On inclut les librairies nécessaires include_once(PLX_ROOT.'config.php'); include_once(PLX_CORE.'lib/class.plx.utils.php'); include_once(PLX_CORE.'lib/class.plx.capcha.php'); include_once(PLX_CORE.'lib/class.plx.erreur.php'); include_once(PLX_CORE.'lib/class.plx.glob.php'); include_once(PLX_CORE.'lib/class.plx.record.php'); include_once(PLX_CORE.'lib/class.plx.motor.php'); header('Content-Type: text/xml; charset='.PLX_CHARSET); # Creation de l'objet principal et lancement du traitement $plxMotor = & new plxMotor(PLX_CONF); $plxMotor->prechauffage(); $plxMotor->demarrage(); echo '<?xml version="1.0" encoding="'.strtolower(PLX_CHARSET).'" ?>'; ?> <urlset xmlns="http://www.google.com/schemas/sitemap/0.84"> <url> <loc><?php echo $plxMotor->aConf['racine']; ?></loc> <changefreq>weekly</changefreq> <priority>1.0</priority> </url> <?php //Les catégories foreach($plxMotor->aCats as $cat_num => $cat_info) { echo "\n"; echo "\t<url>\n"; echo "\t\t<loc>".$plxMotor->aConf['racine']."?categorie".intval($cat_num)."/".$cat_info['url']."</loc>\n"; echo "\t\t<changefreq>weekly</changefreq>\n"; echo "\t\t<priority>0.8</priority>\n"; echo "\t</url>\n"; } //Les articles $plxGlob_arts = & new plxGlob(PLX_ROOT.$plxMotor->aConf['racine_articles']); $aFiles = $plxGlob_arts->query('/^[0-9]{4}.([0-9]{3}|home).[0-9]{12}.[a-z0-9-]+.xml$/','syndic','rsort',0,50000); # On parse les fichiers if(is_array($aFiles)) { # On a des fichiers while(list($k,$v) = each($aFiles)) { # On parcourt tous les fichiers $array[ $k ] = $plxMotor->parseArticle(PLX_ROOT.$plxMotor->aConf['racine_articles'].$v); # On stocke les enregistrements dans un objet plxRecord $plxRecord_arts = & new plxRecord($array); } if($plxGlob_arts->count AND $plxRecord_arts->size) { # On a des articles # On boucle sur nos articles while($plxRecord_arts->loop()) { $num = intval($plxRecord_arts->f('numero')); echo "\n"; echo "\t<url>\n"; echo "\t\t<loc>".$plxMotor->aConf['racine']."?article".$num."/".htmlspecialchars($plxRecord_arts->f('url'),ENT_QUOTES,PLX_CHARSET)."</loc>\n"; echo "\t\t<lastmod>".$plxRecord_arts->f('date')."</lastmod>\n"; echo "\t\t<changefreq>monthly</changefreq>\n"; echo "\t\t<priority>0.5</priority>\n"; echo "\t</url>\n"; } } } ?> </urlset>Consultant PluXml
Ancien responsable et développeur de PluXml (2010 à 2018)
EDIT: et voila, il suffit de modifier la fonction demarrage de la classe class.plx.syndication.php comme suit :
function demarrage($changefreq="weekly",$priority='1.0') { $plxGlob_arts = & new plxGlob(PLX_ROOT.$this->aConf['racine_articles']); $this->aFiles = $plxGlob_arts->query($this->motif,'syndic','rsort'); $this->getArticles(); # Recuperation de l'article cible (on le parse) $this->getCommentaires('/^[0-9]{4}.[0-9]{10}-[0-9]+.xml$/','rsort'); header('Content-Type: text/xml; charset='.PLX_CHARSET); echo '<?xml version="1.0" encoding="'.PLX_CHARSET.'" ?>'."\n"; echo "\n".'<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">'."\n"; $this->createGoogleUrlSyndication($this->racine,$changefreq,$priority); $this->getSyndicationCategories("weekly",'0.9'); $this->getSyndicationArticles("weekly",'0.7'); $this->getSyndicationCommentaires("weekly",'0.5'); echo '</urlset>'."\n"; }et le tour est jouéMerci pour le retour de bug et le code.
Fréd.