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
|
<?php require_once('webadmin/basic_info.php');
header("Content-Type: application/xml; charset=ISO-8859-1");
$sql = "select * from news where typeid = ? and status = ? and deleted = ? order by posted_date DESC"; $parameters = array("INDUSTRY_NEWS", 1, 0); $news_info = bind_pdo($sql, $parameters, "selectall");
$rss = "";
if (!empty($news_info)) {
$rss .= '<?xml version="1.0" encoding="ISO-8859-1" ?> <rss version="2.0"> <channel> <title>' . $site_info["companyname_en"] . '</title> <link>' . $site_info["url"] . '</link> <description>Industry News Provided by ' . $site_info["companyname_en"] . '</description> <language>en</language> <image> <title>' . $site_info["companyname_en"] . '</title> <url>' . $site_info["url"] . 'rss_logo.png</url> <width>406</width> <height>61</height> </image>';
foreach ($news_info as $news) { $rss .= '<item> <title><![CDATA[' . $news["title_" . $langcode] . ']]></title> <link>' . $site_info["url"] . 'news_detail.php?id=' . $news["id"] . '</link> <description><![CDATA[' . $news["desc_" . $langcode] . ']]></description> <pubDate>' . $news["posted_date"] . '</pubDate> </item>'; }
$rss .= '</channel></rss>'; }
echo $rss;
|