Project

General

Profile

« Previous | Next » 

Revision 414

Added by Matthias almost 18 years ago

Fixed some bugs in rss.php

View differences:

trunk/wb/modules/news/rss.php
46 46
$wb->get_website_settings();
47 47

  
48 48
// Sending XML header
49
header("Content-type: text/xml");
49
header("Content-type: text/xml; charset=utf-8" );
50 50

  
51 51
// Header info
52 52
// Required by CSS 2.0
53
?>
54
<rss version="2.0" >
55
<channel>
56
<title><?php echo PAGE_TITLE; ?></title>
57
<link>http://<?php echo $_SERVER['SERVER_NAME']; ?></link>
58
<description> <?php echo PAGE_DESCRIPTION; ?></description>
59
<?php
60
// Optional header info 
61
?>
62
<language><?php echo DEFAULT_LANGUAGE; ?></language>
63
<copyright><?php echo WB_URL.$_SERVER['REQUEST_URI']; ?></copyright>
64
<managingEditor><?php echo SERVER_EMAIL; ?></managingEditor>
65
<webMaster><?php echo SERVER_EMAIL; ?></webMaster>
66
<category><?php echo WEBSITE_TITLE; ?></category>
67
<generator>Website Baker Content Management System</generator>
53 68

  
54
echo "<rss version='2.0'>";
55
echo "<channel>";
56
echo "<title>".PAGE_TITLE."</title>";
57
echo "<link>".WB_URL."</link>";
58
echo "<description>".PAGE_DESCRIPTION."</description>";
59

  
60
// Optional header info
61
echo "<language>".DEFAULT_LANGUAGE."</language>";
62
echo "<copyright>".WB_URL."</copyright>";
63
echo "<managingEditor>".SERVER_EMAIL."</managingEditor>";
64
echo "<webMaster>".SERVER_EMAIL."</webMaster>";
65
echo "<category>".WEBSITE_TITLE."</category>";
66
echo "<generator>Website Baker Content Management System</generator>";
67

  
69
<?php
68 70
// Get news items from database
69 71

  
70 72
//Query
......
76 78
$result = $database->query($query);
77 79

  
78 80
//Generating the news items
79
while($item = $result->fetchRow($result)){
81
while($item = $result->fetchRow($result)){ ?>
80 82

  
81
    echo "<item>";
82
    echo "<title>".$item["title"]."</title>";
83
    // Stripping HTML Tags for text-only visibility
84
    echo "<description>".strip_tags($item["content_short"])."</description>";
85
    echo "<link>".WB_URL."/pages".$item["link"].PAGE_EXTENSION."</link>";
86
    /* Add further (non required) information here like ie.
87
    echo "<author>".$item["posted_by"]."</author>");
88
    etc.
89
    */
90
    echo "</item>";
83
<item>
84
<title><![CDATA[<?php echo stripslashes($item["title"]); ?>]]></title>
85
<description><![CDATA[<?php echo stripslashes($item["content_short"]); ?>]]></description>
86
<guid><?php echo WB_URL."/pages".$item["link"].PAGE_EXTENSION; ?></guid>
87
<link><?php echo WB_URL."/pages".$item["link"].PAGE_EXTENSION; ?></link>
88
</item>
91 89

  
92
}
90
<?php } ?>
93 91

  
94
// Writing footer information
95
echo "</channel>";
96
echo "</rss>";
97

  
98
?>
92
</channel>
93
</rss>

Also available in: Unified diff