Esempio n. 1
0
    echo "\t\t<loc>" . $plxMotor->urlRewrite("?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 = plxGlob::getInstance(PLX_ROOT . $plxMotor->aConf['racine_articles']);
$aFiles = $plxGlob_arts->query('/^[0-9]{4}.([0-9,|home]*).[0-9]{3}.[0-9]{12}.[a-z0-9-]+.xml$/', 'art', 'rsort', 0, false, 'before');
# On parse les fichiers
if (is_array($aFiles)) {
    # On a des fichiers
    foreach ($aFiles as $k => $v) {
        # 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->urlRewrite("?article" . $num . "/" . plxUtils::strCheck($plxRecord_arts->f('url'))) . "</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";
        }
    }
Esempio n. 2
0
        echo "\t\t<changefreq>weekly</changefreq>\n";
        echo "\t\t<priority>0.8</priority>\n";
        echo "\t</url>\n";
    }
}
eval($plxMotor->plxPlugins->callHook('SitemapCategories'));
# Les articles
if ($aFiles = $plxMotor->plxGlob_arts->query('/^[0-9]{4}.(?:[0-9]|home|,)*(?:' . $plxMotor->activeCats . '|home)(?:[0-9]|home|,)*.[0-9]{3}.[0-9]{12}.[a-z0-9-]+.xml$/', 'art', 'rsort', 0, false, 'before')) {
    $plxRecord_arts = false;
    $array = array();
    foreach ($aFiles as $k => $v) {
        # 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 ($plxRecord_arts) {
        # 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->urlRewrite("?article" . $num . "/" . plxUtils::strCheck($plxRecord_arts->f('url'))) . "</loc>\n";
            echo "\t\t<lastmod>" . plxDate::formatDate($plxRecord_arts->f('date'), '#num_year(4)-#num_month-#num_day') . "</lastmod>\n";
            echo "\t\t<changefreq>monthly</changefreq>\n";
            echo "\t\t<priority>0.5</priority>\n";
            echo "\t</url>\n";
        }
    }
}
eval($plxMotor->plxPlugins->callHook('SitemapArticles'));