-
Notifications
You must be signed in to change notification settings - Fork 3
/
sitemap.php
46 lines (39 loc) · 1.26 KB
/
sitemap.php
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
<?php
/*******************************************************************\
* CashbackEngine v2.1
* http://www.CashbackEngine.net
*
* Copyright (c) 2010-2014 CashbackEngine Software. All rights reserved.
* ------------ CashbackEngine IS NOT FREE SOFTWARE --------------
\*******************************************************************/
session_start();
require_once("inc/config.inc.php");
header("Content-Type: text/xml;charset=UTF-8");
$query = "select * from cashbackengine_retailers WHERE (end_date='0000-00-00 00:00:00' OR end_date > NOW()) AND status='active' ORDER BY added DESC";
$result = smart_mysql_query($query);
$total = mysql_num_rows($result);
if ($total > 0)
{
echo '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
while ($row = mysql_fetch_array($result))
{
$i_url = GetRetailerLink($row['retailer_id'], $row['title']);
$year = substr($row['added'],0,4);
$month = substr($row['added'],5,2);
$day = substr($row['added'],8,2);
$i_date = ''.$year.'-'.$month.'-'.$day.'';
echo
'
<url>
<loc>'.$i_url.'</loc>
<lastmod>'.$i_date.'</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
';
}
}
echo
'</urlset>';
?>