2021-09-07 12:33:18 +00:00
|
|
|
<?php
|
2021-09-07 13:21:38 +00:00
|
|
|
/**
|
|
|
|
* @brief cinecturlink2, a plugin for Dotclear 2
|
2021-11-02 22:55:41 +00:00
|
|
|
*
|
2021-09-07 13:21:38 +00:00
|
|
|
* @package Dotclear
|
|
|
|
* @subpackage Plugin
|
2021-11-02 22:55:41 +00:00
|
|
|
*
|
2021-09-07 13:21:38 +00:00
|
|
|
* @author Jean-Christian Denis and Contributors
|
2021-11-02 22:55:41 +00:00
|
|
|
*
|
2021-09-07 13:21:38 +00:00
|
|
|
* @copyright Jean-Christian Denis
|
|
|
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
*/
|
2021-09-07 12:33:18 +00:00
|
|
|
class sitemapsCinecturlink2
|
|
|
|
{
|
2021-09-07 13:21:38 +00:00
|
|
|
public static function sitemapsDefineParts($map_parts)
|
|
|
|
{
|
|
|
|
$map_parts->offsetSet(__('Cinecturlink'), 'cinecturlink2');
|
|
|
|
}
|
2021-09-07 12:33:18 +00:00
|
|
|
|
2021-09-07 13:21:38 +00:00
|
|
|
public static function sitemapsURLsCollect($sitemaps)
|
|
|
|
{
|
|
|
|
global $core;
|
|
|
|
$core->blog->settings->addNamespace('sitemaps');
|
2021-09-07 12:33:18 +00:00
|
|
|
|
2021-11-02 22:55:41 +00:00
|
|
|
if ($core->plugins->moduleExists('cinecturlink2')
|
2021-09-07 23:47:45 +00:00
|
|
|
&& $core->blog->settings->sitemaps->sitemaps_cinecturlink2_url
|
|
|
|
) {
|
2021-09-07 13:21:38 +00:00
|
|
|
$freq = $sitemaps->getFrequency($core->blog->settings->sitemaps->sitemaps_cinecturlink2_fq);
|
|
|
|
$prio = $sitemaps->getPriority($core->blog->settings->sitemaps->sitemaps_cinecturlink2_pr);
|
2021-09-07 23:47:45 +00:00
|
|
|
$base = $core->blog->url . $core->url->getBase('cinecturlink2');
|
2021-09-07 13:21:38 +00:00
|
|
|
|
|
|
|
$sitemaps->addEntry($base, $prio, $freq);
|
|
|
|
|
|
|
|
$core->blog->settings->addNamespace('cinecturlink2');
|
2021-11-02 22:55:41 +00:00
|
|
|
$C2 = new cinecturlink2($core);
|
2021-09-07 13:21:38 +00:00
|
|
|
$cats = $C2->getCategories();
|
|
|
|
while ($cats->fetch()) {
|
2021-11-02 22:55:41 +00:00
|
|
|
$sitemaps->addEntry($base . '/' . $core->blog->settings->cinecturlink2->cinecturlink2_public_caturl . '/' . urlencode($cats->cat_title), $prio, $freq);
|
2021-09-07 13:21:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-11-02 22:55:41 +00:00
|
|
|
}
|