Sitemap improves
This commit is contained in:
parent
4eb51ee37e
commit
999bfabcfc
|
@ -43,21 +43,27 @@ class pluginSitemap extends Plugin {
|
||||||
$pages = $dbPages->getDB();
|
$pages = $dbPages->getDB();
|
||||||
unset($pages['error']);
|
unset($pages['error']);
|
||||||
foreach($pages as $key=>$db)
|
foreach($pages as $key=>$db)
|
||||||
|
{
|
||||||
|
if($db['status']=='published')
|
||||||
{
|
{
|
||||||
$permalink = empty($filter) ? $url.'/'.$key : $url.'/'.$filter.'/'.$key;
|
$permalink = empty($filter) ? $url.'/'.$key : $url.'/'.$filter.'/'.$key;
|
||||||
$date = Date::format($db['date'], DB_DATE_FORMAT, SITEMAP_DATE_FORMAT);
|
$date = Date::format($db['date'], DB_DATE_FORMAT, SITEMAP_DATE_FORMAT);
|
||||||
array_push($all, array('permalink'=>$permalink, 'date'=>$date));
|
array_push($all, array('permalink'=>$permalink, 'date'=>$date));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// --- Posts ---
|
// --- Posts ---
|
||||||
$filter = rtrim($Url->filters('post'),'/');
|
$filter = rtrim($Url->filters('post'),'/');
|
||||||
$posts = $dbPosts->getDB();
|
$posts = $dbPosts->getDB();
|
||||||
foreach($posts as $key=>$db)
|
foreach($posts as $key=>$db)
|
||||||
|
{
|
||||||
|
if($db['status']=='published')
|
||||||
{
|
{
|
||||||
$permalink = empty($filter) ? $url.'/'.$key : $url.'/'.$filter.'/'.$key;
|
$permalink = empty($filter) ? $url.'/'.$key : $url.'/'.$filter.'/'.$key;
|
||||||
$date = Date::format($db['date'], DB_DATE_FORMAT, SITEMAP_DATE_FORMAT);
|
$date = Date::format($db['date'], DB_DATE_FORMAT, SITEMAP_DATE_FORMAT);
|
||||||
array_push($all, array('permalink'=>$permalink, 'date'=>$date));
|
array_push($all, array('permalink'=>$permalink, 'date'=>$date));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Generate the XML for posts and pages
|
// Generate the XML for posts and pages
|
||||||
foreach($all as $db)
|
foreach($all as $db)
|
||||||
|
|
Loading…
Reference in New Issue