-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsitemap.php
More file actions
55 lines (46 loc) · 1.38 KB
/
sitemap.php
File metadata and controls
55 lines (46 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<? /* Dynamic Sitemap Build
------------------------------
** Title: Kleurvision Elements
** Version: 1.0
** Authoring Date: April 2013
** Description: Elements is a dynamic CMS for small business websites
------------------------------
** Here we go */
error_reporting(E_ALL);
ini_set('display_errors', '1');
// Load the primary
require('./bootstrap-light.php');
global $db;
$pages = $db->get_results("SELECT pagename, pagetitle, pagedate, pagepriority, pagechangefreq FROM app_pages");
header("Content-type: text/xml");
echo '<?xml version="1.0" encoding="UTF-8" ?>';
?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
<? if($pages){
foreach($pages as $page){ ?>
<url>
<loc><? if($page->pagename != 'home-page'){
echo URL.'/'.$page->pagename;
} else {
echo URL;
} ?></loc>
<lastmod><? if($page->pagedate != ''){
echo $page->pagedate;
} else {
echo date('Y-m-d');
} ?></lastmod>
<changefreq><? if($page->pagechangefreq != ''){
echo $page->pagechangefreq;
} else {
echo 'yearly';
} ?></changefreq>
<priority><? if($page->pagepriority != ''){
echo $page->pagepriority;
} else {
echo '1.0';
} ?></priority>
</url>
<? }
}
?>
</urlset>