r1338 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r1337‎ | r1338 | r1339 >
Date:00:53, 20 May 2003
Author:eloquence
Status:old
Tags:
Comment:
New feature (special page): Ancient pages: list oldest articles first
Modified paths:
  • /trunk/phase3/includes/SpecialAncientpages.php (added) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialAncientpages.php
@@ -0,0 +1,50 @@
 2+<?
 3+
 4+function wfSpecialAncientpages()
 5+{
 6+ global $wgUser, $wgOut, $wgLang, $wgTitle;
 7+ global $limit, $offset; # From query string
 8+ $fname = "wfSpecialAncientpages";
 9+
 10+ if ( ! $limit ) {
 11+ $limit = $wgUser->getOption( "rclimit" );
 12+ if ( ! $limit ) { $limit = 50; }
 13+ }
 14+ if ( ! $offset ) { $offset = 0; }
 15+
 16+ $sql = "SELECT cur_title,cur_user,cur_user_text,cur_comment," .
 17+ "cur_timestamp FROM cur " .
 18+ "WHERE cur_namespace=0 AND cur_is_redirect=0 " .
 19+ " ORDER BY cur_timestamp LIMIT {$offset}, {$limit}";
 20+ $res = wfQuery( $sql, $fname );
 21+
 22+ $top = wfShowingResults( $offset, $limit );
 23+ $wgOut->addHTML( "<p>{$top}\n" );
 24+
 25+ $sl = wfViewPrevNext( $offset, $limit,
 26+ $wgLang->specialPage( "Ancientpages" ) );
 27+ $wgOut->addHTML( "<br>{$sl}\n" );
 28+
 29+ $sk = $wgUser->getSkin();
 30+ $s = "<ol start=" . ( $offset + 1 ) . ">";
 31+ while ( $obj = wfFetchObject( $res ) ) {
 32+ $u = $obj->cur_user;
 33+ $ut = $obj->cur_user_text;
 34+ $c = wfEscapeHTML( $obj->cur_comment );
 35+ if ( 0 == $u ) { $ul = $ut; }
 36+ else { $ul = $sk->makeLink( $wgLang->getNsText(2).":{$ut}", $ut ); }
 37+
 38+ $d = $wgLang->timeanddate( $obj->cur_timestamp, true );
 39+ $link = $sk->makeKnownLink( $obj->cur_title, "" );
 40+ $s .= "<li>{$d} {$link} . . {$ul}";
 41+
 42+ if ( "" != $c && "*" != $c ) { $s .= " <em>({$c})</em>"; }
 43+ $s .= "</li>\n";
 44+ }
 45+ wfFreeResult( $res );
 46+ $s .= "</ol>";
 47+ $wgOut->addHTML( $s );
 48+ $wgOut->addHTML( "<p>{$sl}\n" );
 49+}
 50+
 51+?>
Property changes on: trunk/phase3/includes/SpecialAncientpages.php
___________________________________________________________________
Added: svn:eol-style
152 + native
Added: svn:keywords
253 + Author Date Id Revision
Index: trunk/phase3/languages/Language.php
@@ -250,6 +250,7 @@
251251 "Shortpages" => "Short articles",
252252 "Longpages" => "Long articles",
253253 "Newpages" => "Newly created articles",
 254+ "Ancientpages" => "Oldest articles",
254255 "Intl" => "Interlanguage links",
255256 "Allpages" => "All pages by title",
256257
@@ -817,6 +818,7 @@
818819 "rclsub" => "(to pages linked from \"$1\")",
819820 "debug" => "Debug",
820821 "newpages" => "New pages",
 822+"ancientpages" => "Oldest articles",
821823 "intl" => "Interlanguage links",
822824 "movethispage" => "Move this page",
823825 "unusedimagestext" => "<p>Please note that other web sites

Status & tagging log