New feature (special page): Ancient pages: list oldest articles first
authorErik Moeller <erik@users.mediawiki.org>
Tue, 20 May 2003 00:53:04 +0000 (00:53 +0000)
committerErik Moeller <erik@users.mediawiki.org>
Tue, 20 May 2003 00:53:04 +0000 (00:53 +0000)
includes/SpecialAncientpages.php [new file with mode: 0644]
languages/Language.php

diff --git a/includes/SpecialAncientpages.php b/includes/SpecialAncientpages.php
new file mode 100644 (file)
index 0000000..33323aa
--- /dev/null
@@ -0,0 +1,50 @@
+<?
+
+function wfSpecialAncientpages()
+{
+       global $wgUser, $wgOut, $wgLang, $wgTitle;
+       global $limit, $offset; # From query string
+       $fname = "wfSpecialAncientpages";
+
+       if ( ! $limit ) {
+               $limit = $wgUser->getOption( "rclimit" );
+               if ( ! $limit ) { $limit = 50; }
+       }
+       if ( ! $offset ) { $offset = 0; }
+
+       $sql = "SELECT cur_title,cur_user,cur_user_text,cur_comment," .
+         "cur_timestamp FROM cur " .
+         "WHERE cur_namespace=0 AND cur_is_redirect=0 " .
+         " ORDER BY cur_timestamp LIMIT {$offset}, {$limit}";
+       $res = wfQuery( $sql, $fname );
+
+       $top = wfShowingResults( $offset, $limit );
+       $wgOut->addHTML( "<p>{$top}\n" );
+
+       $sl = wfViewPrevNext( $offset, $limit,
+         $wgLang->specialPage( "Ancientpages" ) );
+       $wgOut->addHTML( "<br>{$sl}\n" );
+
+       $sk = $wgUser->getSkin();
+       $s = "<ol start=" . ( $offset + 1 ) . ">";
+       while ( $obj = wfFetchObject( $res ) ) {
+               $u = $obj->cur_user;
+               $ut = $obj->cur_user_text;
+               $c = wfEscapeHTML( $obj->cur_comment );
+               if ( 0 == $u ) { $ul = $ut; }
+               else { $ul = $sk->makeLink( $wgLang->getNsText(2).":{$ut}", $ut ); }
+
+               $d = $wgLang->timeanddate( $obj->cur_timestamp, true );
+               $link = $sk->makeKnownLink( $obj->cur_title, "" );
+               $s .= "<li>{$d} {$link} . . {$ul}";
+
+               if ( "" != $c && "*" != $c ) { $s .= " <em>({$c})</em>"; }
+               $s .= "</li>\n";
+       }
+       wfFreeResult( $res );
+       $s .= "</ol>";
+       $wgOut->addHTML( $s );
+       $wgOut->addHTML( "<p>{$sl}\n" );
+}
+
+?>
index 8bbbf5b..05184d7 100644 (file)
@@ -250,6 +250,7 @@ this</a> (alternative: like this<a href=\"\" class=\"internal\">?</a>).",
        "Shortpages"    => "Short articles",
        "Longpages"             => "Long articles",
        "Newpages"              => "Newly created articles",
+       "Ancientpages"  => "Oldest articles",
        "Intl"          => "Interlanguage links",
        "Allpages"              => "All pages by title",
 
@@ -817,6 +818,7 @@ That comes to <b>$5</b> average edits per page, and <b>$6</b> views per edit.",
 "rclsub"               => "(to pages linked from \"$1\")",
 "debug"                        => "Debug",
 "newpages"             => "New pages",
+"ancientpages"         => "Oldest articles",
 "intl"         => "Interlanguage links",
 "movethispage" => "Move this page",
 "unusedimagestext" => "<p>Please note that other web sites