Re: [PATCH] RSS-News-Generation from php.net
| From: | Gabor Hojtsy | Date: | Sat, 04 Jan 2003 19:23:28 +0000 |
| Subject: | Re: [PATCH] RSS-News-Generation from php.net | ||
| References: | 1 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-14707@lists.php.net to get a copy of this message | ||
Well, only one thing is missing from here as I can see.
What should be the namespace URL for dc? I have found some
on dublincore.org, but don't know what is really used / what
should be there...
Thanks,
Goba
----- Original Message -----
From: "Tobias Schlitt" <toby@php.net>
To: <webmaster@php.net>
Sent: Saturday, January 04, 2003 8:15 PM
Subject: [PATCH] RSS-News-Generation from php.net
> 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);');} ?>
>