From: Erik Moeller Date: Tue, 20 May 2003 00:53:04 +0000 (+0000) Subject: New feature (special page): Ancient pages: list oldest articles first X-Git-Tag: 1.1.0~540 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=4105137d8a03315a73f996fe9691818e0bb0d733;p=lhc%2Fweb%2Fwiklou.git New feature (special page): Ancient pages: list oldest articles first --- diff --git a/includes/SpecialAncientpages.php b/includes/SpecialAncientpages.php new file mode 100644 index 0000000000..33323aa919 --- /dev/null +++ b/includes/SpecialAncientpages.php @@ -0,0 +1,50 @@ +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( "

{$top}\n" ); + + $sl = wfViewPrevNext( $offset, $limit, + $wgLang->specialPage( "Ancientpages" ) ); + $wgOut->addHTML( "
{$sl}\n" ); + + $sk = $wgUser->getSkin(); + $s = "

    "; + 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 .= "
  1. {$d} {$link} . . {$ul}"; + + if ( "" != $c && "*" != $c ) { $s .= " ({$c})"; } + $s .= "
  2. \n"; + } + wfFreeResult( $res ); + $s .= "
"; + $wgOut->addHTML( $s ); + $wgOut->addHTML( "

{$sl}\n" ); +} + +?> diff --git a/languages/Language.php b/languages/Language.php index 8bbbf5ba44..05184d78bb 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -250,6 +250,7 @@ this (alternative: like this?).", "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 $5 average edits per page, and $6 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" => "

Please note that other web sites