1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-04 04:07:59 +02:00

Sitemap Plugin: small updates

This commit is contained in:
Awilum
2012-09-25 23:18:25 +03:00
parent 9bfe67ee0e
commit 26f0c189ca
3 changed files with 8 additions and 7 deletions

View File

@@ -7,5 +7,5 @@
<plugin_description>Show sitemap</plugin_description>
<plugin_version>1.0.0</plugin_version>
<plugin_author>Awilum</plugin_author>
<plugin_author_uri>http://awilum.webdevart.ru/</plugin_author_uri>
<plugin_author_uri>http://monstra.org/</plugin_author_uri>
</root>

View File

@@ -53,16 +53,17 @@
* Get sitemap content
*/
public static function content() {
// Init vars
$pages_array = array();
$count = 0;
// Get pages table
$pages = new Table('pages');
// Get Pages List
$pages_list = $pages->select('[slug!="error404" and status="published"]');
$pages_array = array();
$count = 0;
foreach ($pages_list as $page) {
$pages_array[$count]['title'] = Html::toText($page['title']);
@@ -116,7 +117,7 @@
$pages_list = $pages->select('[slug!="error404" and status="published"]');
// Create sitemap content
$map = '<?xml version="1.0" encoding="UTF-8"?>'."\n";
$map = '<?xml version="1.0" encoding="UTF-8"?>'."\n";
$map .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'."\n";
foreach ($pages_list as $page) {
if ($page['parent'] != '') { $parent = $page['parent'].'/'; } else { $parent = ''; }

View File

@@ -1,5 +1,5 @@
<h3><?php echo __('Sitemap', 'sitemap'); ?></h3>
<br />
<hr>
<ul>
<?php