Index: trunk/phpwiki/newcodebase/FeedRDF.php |
— | — | @@ -0,0 +1,60 @@ |
| 2 | +<?php |
| 3 | +include("Setup.php"); |
| 4 | +header("Content-type: text/xml; charset=utf-8"); |
| 5 | +echo "<?xml version=\"1.0\"?>" |
| 6 | +?> |
| 7 | + |
| 8 | +<rdf:RDF |
| 9 | +xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
| 10 | +xmlns="http://my.netscape.com/rdf/simple/0.9/"> |
| 11 | + |
| 12 | +<channel> |
| 13 | +<title><?php echo iconv($wgInputEncoding, "utf-8", wfMsg("sitetitle") ) ?></title> |
| 14 | +<link><?php echo $wgServer ?></link> |
| 15 | +<description><?php echo iconv($wgInputEncoding, "utf-8", wfMsg("sitesubtitle") ) ?></description> |
| 16 | +</channel> |
| 17 | + |
| 18 | +<?php |
| 19 | +#<image> |
| 20 | +#<title>Wikipedia</title> |
| 21 | +#<url>...</url> |
| 22 | +#<link>http://wikipedia.org/</link> |
| 23 | +#</image> |
| 24 | + |
| 25 | +if($style == 'new') { |
| 26 | + # 10 newest articles |
| 27 | +$sql = "SELECT cur_title FROM cur |
| 28 | +WHERE cur_is_new=1 AND cur_namespace=0 AND cur_is_redirect=0 |
| 29 | +AND LENGTH(cur_text) > 75 |
| 30 | +ORDER BY cur_timestamp DESC LIMIT 10"; |
| 31 | +} else { |
| 32 | + # 10 most recently edit articles that aren't frickin tiny |
| 33 | +$sql = "SELECT cur_title FROM cur |
| 34 | +WHERE cur_namespace=0 AND cur_is_redirect=0 |
| 35 | +AND LENGTH(cur_text) > 150 |
| 36 | +ORDER BY cur_timestamp DESC LIMIT 10"; |
| 37 | +} |
| 38 | +$res = wfQuery( $sql ); |
| 39 | + |
| 40 | +while( $row = wfFetchObject( $res ) ) { |
| 41 | + $title = htmlspecialchars( |
| 42 | + iconv($wgInputEncoding, "utf-8", |
| 43 | + str_replace( "_", " ", $row->cur_title ) ) ); |
| 44 | + $url = wfLocalUrl( wfUrlencode( $row->cur_title ) ); |
| 45 | + echo " |
| 46 | +<item> |
| 47 | +<title>{$title}</title> |
| 48 | +<link>{$url}</link> |
| 49 | +</item> |
| 50 | +"; |
| 51 | +} |
| 52 | + |
| 53 | +#<textinput> |
| 54 | +#<title>Search Wikipedia</title> |
| 55 | +#<description>Search Wikipedia articles</description> |
| 56 | +#<name>query</name> |
| 57 | +#<link>http://www.wikipedia.org/w/wiki.phtml?search=</link> |
| 58 | +#</textinput> |
| 59 | +?> |
| 60 | + |
| 61 | +</rdf:RDF> |
\ No newline at end of file |
Property changes on: trunk/phpwiki/newcodebase/FeedRDF.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 62 | + native |
Added: svn:keywords |
2 | 63 | + Author Date Id Revision |