-
Notifications
You must be signed in to change notification settings - Fork 7
/
sitemap.php
74 lines (59 loc) · 1.47 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
define( 'PMR', true );
$page = 'sitemap';
include 'config.php';
include PATH . '/defaults.php';
$title = $conf['website_name_short'];
include PATH . '/templates/' . $cookie_template . '/header.php';
$tpl = PATH . '/templates/' . $cookie_template . '/tpl/sitemap_header.tpl';
$template = new Template;
$template->load ( $tpl );
$template->set( 'header', $lang['Menu_Site_Map'] );
$template->publish();
$title = str_replace( 'name', 'title', $language_in );
$description = str_replace( 'name', 'description', $language_in );
// Get all listings
$sql = '
SELECT
' . $title . ',
' . $description . ',
' . PROPERTIES_TABLE . '.*
FROM ' . PROPERTIES_TABLE . '
ORDER BY title ASC
';
$q = $db->query( $sql );
if ( $db->numrows( $q ) > 0 )
{
while( $f = $db->fetcharray( $q ) )
{
$tpl = PATH . '/templates/' . $cookie_template . '/tpl/sitemap.tpl';
$template = new Template;
$template->load ( $tpl );
// Default
if ( $f[0] == '' )
{
$f['title'] = $f['title'];
}
else
{
$f['title'] = $f[0];
}
if ( $f[1] == '' )
{
$f['description'] = $f['description'];
}
else
{
$f['description'] = $f[1];
}
$template->set( 'link', generate_link( 'listing', $f ) );
$template->set( 'name', $f['title'] );
$template->publish();
}
}
$tpl = PATH . '/templates/' . $cookie_template . '/tpl/sitemap_footer.tpl';
$template = new Template;
$template->load ( $tpl );
$template->publish();
include PATH . '/templates/' . $cookie_template . '/footer.php';
?>