|
@@ -12,54 +12,46 @@ if(!defined('entry')) define('entry',true);
|
12
|
12
|
=========================== */
|
13
|
13
|
?>
|
14
|
14
|
<?php
|
|
15
|
+ require('entry.php');
|
|
16
|
+ global $conf, $tumble, $db;
|
|
17
|
+
|
15
|
18
|
// Code modified from the one at http://paste.ubuntu-nl.org/44548/
|
16
|
|
- header("Content-type: text/xml; charset=utf-8");
|
17
|
|
-
|
18
|
|
- require(dirname(__FILE__)."/config.php");
|
19
|
|
- include("classes/configuration.class.php");
|
20
|
|
- include("classes/gelato.class.php");
|
21
|
|
- $tumble = new gelato();
|
22
|
|
- $conf = new configuration();
|
|
19
|
+ header("Content-type: text/xml; charset=utf-8");
|
23
|
20
|
$isFeed = true;
|
24
|
21
|
|
25
|
22
|
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
|
|
23
|
+ echo "<?xml-stylesheet type=\"text/xsl\" href=\"".$conf->urlGelato."/sitemap.xsl\"?>\n";
|
26
|
24
|
|
27
|
25
|
$rs = $tumble->getPosts(1);
|
28
|
26
|
?>
|
29
|
27
|
<!-- generator="gelato CMS" -->
|
30
|
|
-
|
31
|
|
-<urlset
|
32
|
|
- xmlns="http://www.google.com/schemas/sitemap/0.84"
|
33
|
|
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
34
|
|
- xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
|
35
|
|
- http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
|
36
|
|
-
|
|
28
|
+<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
37
|
29
|
<url>
|
38
|
|
- <loc><?php echo $conf->urlGelato;?></loc>
|
39
|
|
- <priority>0.9</priority>
|
|
30
|
+ <loc><?php echo $conf->urlGelato;?></loc>
|
40
|
31
|
<?php
|
41
|
|
- if ($tumble->contarRegistros()>0) {
|
|
32
|
+ if ($db->contarRegistros()>0) {
|
42
|
33
|
$register = mysql_fetch_array($rs);
|
43
|
34
|
$formatedDate = gmdate("Y-m-d", strtotime($register["date"]));
|
44
|
|
- echo "<lastmod>".$formatedDate."</lastmod>";
|
|
35
|
+ echo "\n\t<lastmod>".$formatedDate."</lastmod>";
|
45
|
36
|
}
|
46
|
37
|
?>
|
47
|
|
- <changefreq>hourly</changefreq>
|
|
38
|
+ <changefreq>hourly</changefreq>
|
|
39
|
+ <priority>0.9</priority>
|
48
|
40
|
</url>
|
49
|
41
|
|
50
|
42
|
|
51
|
43
|
<?php
|
52
|
44
|
$rs = $tumble->getPosts($tumble->getPostsNumber());
|
53
|
|
- if ($tumble->contarRegistros()>0) {
|
54
|
|
- while($register = mysql_fetch_array($rs)) {
|
55
|
|
- $url = htmlspecialchars($conf->urlGelato."/index.php?post=".$register["id_post"]);
|
|
45
|
+ if ($db->contarRegistros()>0) {
|
|
46
|
+ while($register = mysql_fetch_array($rs)) {
|
|
47
|
+ $url = $tumble->getPermalink($register["id_post"]);
|
56
|
48
|
$formatedDate = gmdate("Y-m-d", strtotime($register["date"]));
|
57
|
49
|
?>
|
58
|
50
|
<url>
|
59
|
|
- <loc><?php echo $url;?></loc>
|
60
|
|
- <priority>0.7</priority>
|
|
51
|
+ <loc><?php echo $url;?></loc>
|
61
|
52
|
<lastmod><?php echo $formatedDate;?></lastmod>
|
62
|
|
- <changefreq>daily</changefreq>
|
|
53
|
+ <changefreq>daily</changefreq>
|
|
54
|
+ <priority>0.7</priority>
|
63
|
55
|
</url>
|
64
|
56
|
<?php
|
65
|
57
|
}
|