From 999bfabcfc53879cc93eeee0d9408e4901980441 Mon Sep 17 00:00:00 2001 From: dignajar Date: Sat, 30 Jan 2016 01:24:47 -0300 Subject: [PATCH] Sitemap improves --- bl-plugins/sitemap/plugin.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/bl-plugins/sitemap/plugin.php b/bl-plugins/sitemap/plugin.php index 48af4b94..3669f67f 100644 --- a/bl-plugins/sitemap/plugin.php +++ b/bl-plugins/sitemap/plugin.php @@ -44,9 +44,12 @@ class pluginSitemap extends Plugin { unset($pages['error']); foreach($pages as $key=>$db) { - $permalink = empty($filter) ? $url.'/'.$key : $url.'/'.$filter.'/'.$key; - $date = Date::format($db['date'], DB_DATE_FORMAT, SITEMAP_DATE_FORMAT); - array_push($all, array('permalink'=>$permalink, 'date'=>$date)); + if($db['status']=='published') + { + $permalink = empty($filter) ? $url.'/'.$key : $url.'/'.$filter.'/'.$key; + $date = Date::format($db['date'], DB_DATE_FORMAT, SITEMAP_DATE_FORMAT); + array_push($all, array('permalink'=>$permalink, 'date'=>$date)); + } } // --- Posts --- @@ -54,9 +57,12 @@ class pluginSitemap extends Plugin { $posts = $dbPosts->getDB(); foreach($posts as $key=>$db) { - $permalink = empty($filter) ? $url.'/'.$key : $url.'/'.$filter.'/'.$key; - $date = Date::format($db['date'], DB_DATE_FORMAT, SITEMAP_DATE_FORMAT); - array_push($all, array('permalink'=>$permalink, 'date'=>$date)); + if($db['status']=='published') + { + $permalink = empty($filter) ? $url.'/'.$key : $url.'/'.$filter.'/'.$key; + $date = Date::format($db['date'], DB_DATE_FORMAT, SITEMAP_DATE_FORMAT); + array_push($all, array('permalink'=>$permalink, 'date'=>$date)); + } } // Generate the XML for posts and pages