forked from lane711/excida
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrss.php
87 lines (78 loc) · 2.48 KB
/
rss.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
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
header( 'Content-type: text/xml ');
define( 'PMR', true );
include 'config.php';
include PATH . '/defaults.php';
// RSS header information
echo '<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
<title>' . unsafehtml($conf['website_name_short']) . '</title>
<link>' . URL . '/rss.php</link>
<description>' . unsafehtml($conf['website_name']) . '</description>
<pubDate>' . date("D, j M Y G:i:s O") . '</pubDate>
<generator>RealtyScript.com built-in RSS/XML Feed, v.1.1</generator>
<copyright>RealtyScript.com</copyright>
<managingEditor>' . $conf['general_e_mail'] . ' (' .unsafehtml($conf['general_e_mail_name']) . ') </managingEditor>
<webmaster>' . $conf['general_e_mail'] . ' (' .unsafehtml($conf['general_e_mail_name']) . ') </webmaster>
';
// Fetch 10 latest / new listings
$sql = "
SELECT *
FROM " . PROPERTIES_TABLE . "
WHERE
approved = 1
ORDER BY listing_id DESC
LIMIT 10
";
$q = $db->query ( $sql ) or die( mysql_error() );
if ( $db->numrows( $q ) > 0 )
{
while ( $f = $db->fetcharray( $q ) )
{
echo '
<item>
<title><![CDATA[' . unsafehtml($f['title']) . ' (' . unsafehtml($conf['currency']) . ' ' . pmr_number_format($f['price']) .')]]></title>
<link>' . unsafehtml(URL . '/viewlisting.php?id=' . $f['id']) . '</link>
<description><![CDATA[' . removehtml(unsafehtml($f['description'])) . ']]></description>
<pubDate>' . date("D, j M Y G:i:s O") . '</pubDate>
<author>' . $conf['general_e_mail'] . '</author>
<category>Latest Property Listings</category>
<guid isPermaLink="true">' . unsafehtml(URL . '/viewlisting.php?id=' . $f['id']) . '</guid>
</item>
';
}
}
// Fetch 10 latest / new agents
$sql = "
SELECT *
FROM " . USERS_TABLE . "
WHERE
approved = 1
ORDER BY u_id DESC
LIMIT 10
";
$q = $db->query( $sql ) or die( mysql_error() );
if ( $db->numrows( $q ) > 0 )
{
while ( $f = $db->fetcharray( $q ) )
{
echo '
<item>
<title><![CDATA[' . unsafehtml($f['first_name']) . ' ' . unsafehtml($f['last_name']) . ' (' . unsafehtml($f['company_name']) . ')]]></title>
<link>' . unsafehtml(URL . '/viewuser.php?id=' . $f['u_id']) . '</link>
<description><![CDATA[' . removehtml(unsafehtml($f['description'])) . ']]></description>
<pubDate>' . date("D, j M Y G:i:s O") . '</pubDate>
<author>' . $conf['general_e_mail'] . '</author>
<category>Latest Sellers</category>
<guid isPermaLink="true">' . unsafehtml(URL . '/viewuser.php?id=' . $f['u_id']) . '</guid>
</item>
';
}
}
echo '
</channel>
</rss>
';
$db->close();
?>