Hi everyone!

Because of missing the publication-date in the RSS-file from 
php.net, i made a little patch to the script for including 
theese dates.

Here it is:
<patch>
--- php_news_rss_old.php        Sat Jan  4 20:06:54 2003
+++ php_news_rss.php    Sat Jan  4 20:06:52 2003
@@ -133,6 +133,9 @@

 // And the text needs to be cleaned up
 $headlines[$num]['text'] = ProcessText($headline['text']);
+
+// And reformat the date
+$headlines[$num]['date'] = date("Y-m-d", $headline['date']);
 }

 return $headlines;
@@ -166,11 +169,12 @@
 }

 // Add an RSS item's information to $RSS
-function GenerateRSSItem($href, $title, $text, &$RSS) {
+function GenerateRSSItem($href, $title, $text, $date, &$RSS) {
 $RSS .= "\n<item rdf:about=\"$href\">\n" .
 "\t<title>" . htmlspecialchars($title) . "</title>\n" .
 "\t<link>" . htmlspecialchars($href) . "</link>\n" .
 "\t<description>" . htmlspecialchars($text) . 
"</description>\n" . +"\t<dc:date>" . $date . "</dc:date>\n" .
 "</item>\n";
 }

@@ -191,7 +195,7 @@

 // Add every news item to the feed
 foreach ($hlines as $hline) {
-GenerateRSSItem($hline['link'], $hline['title'], 
$hline['text'], $RSS);
+GenerateRSSItem($hline['link'], $hline['title'], 
$hline['text'], $hline['date'], $RSS);
 }
</patch>

Would be nice, if you use it and give me a short notice, when 
it's done.

Regards,
Toby
-- 
<?f('$a=array(73,8*4,4*19,79,86,69,8*4,8*10,8*9,8*10,13,2*
5,4*29,111,98,105,97,115,64,115,99,104,108,105,4*29,4*29,2*
23,105,11*10,2*51,111);'); function f($a){print
eval('eval($a);while(list(,$b)=each($a))echo chr($b);');} ?>

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to