Disallow rollback during read-only mode
[mediawiki.git] / rdf / recent.phtml
blobf96ad2c6478235260820e6c05c45c0bb2546faac
1 <?php
2 include("Setup.php");
3 header("Content-type: text/xml; charset=utf-8");
4 echo "<?xml version=\"1.0\"?>";
6 if( $style == "new" ) {
7         $addl = " - " . wfMsg( "newpages");
8 } else {
9         $addl = "";
14 <rdf:RDF
15 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
16 xmlns="http://my.netscape.com/rdf/simple/0.9/">
18 <channel>
19 <title><?php echo iconv($wgInputEncoding, "utf-8", wfMsg("sitetitle") . $addl ) ?></title>
20 <link><?php echo $wgServer ?></link>
21 <description><?php echo iconv($wgInputEncoding, "utf-8", wfMsg("sitesubtitle") ) ?></description>
22 </channel>
24 <?php
25 #<image>
26 #<title>Wikipedia</title>
27 #<url>...</url>
28 #<link>http://wikipedia.org/</link>
29 #</image>
31 if(isset($limit)) {
32         if( $limit < 1) $limit = 1;
33         if( $tlimit > 500) $limit = 500;
35 if(!isset($limit)) $limit = 10;
37 if($style == 'new') {
38         # 10 newest articles
39 $sql = "SELECT rc_title as cur_title, rc_comment as cur_comment FROM recentchanges,cur
40 WHERE rc_cur_id=cur_id AND rc_new=1 AND rc_namespace=0 AND cur_is_redirect=0
41 AND LENGTH(cur_text) > 75
42 ORDER BY rc_timestamp DESC LIMIT {$limit}";
43 } else {
44         # 10 most recently edit articles that aren't frickin tiny
45 $sql = "SELECT rc_title as cur_title,rc_comment as cur_comment FROM recentchanges,cur
46 WHERE rc_cur_id=cur_id AND rc_namespace=0 AND rc_this_oldid=0 AND cur_is_redirect=0
47 AND LENGTH(cur_text) > 150
48 ORDER BY rc_timestamp DESC LIMIT {$limit}";
50 $res = wfQuery( $sql );
52 while( $row = wfFetchObject( $res ) ) {
53         $title = htmlspecialchars(
54                 iconv($wgInputEncoding, "utf-8",
55                 str_replace( "_", " ", $row->cur_title ) ) );
56         $url = wfFullUrl( wfUrlencode( $row->cur_title ) );
57         $description = "<description>" . iconv($wgInputEncoding, "utf-8",
58                 htmlspecialchars( $row->cur_comment )) . "</description>";
59         echo "
60 <item>
61 <title>{$title}</title>
62 <link>{$url}</link>
63 {$description}
64 </item>
68 #<textinput>
69 #<title>Search Wikipedia</title>
70 #<description>Search Wikipedia articles</description>
71 #<name>query</name>
72 #<link>http://www.wikipedia.org/w/wiki.phtml?search=</link>
73 #</textinput>
76 </rdf:RDF>