* td background set to White to avoid header border shining through
[mediawiki.git] / includes / SpecialNewpages.php
blob4368d28829e0fa339762dd75c1c955e7bd3754ad
1 <?php
3 include_once( "QueryPage.php" );
5 class NewPagesPage extends QueryPage {
7 function getName() {
8 return "Newpages";
11 function isExpensive() {
12 return parent::isExpensive();
15 function getSQL( $offset, $limit ) {
16 return "SELECT rc_namespace AS cur_namespace, rc_title AS cur_title,rc_user AS cur_user,rc_user_text AS cur_user_text,rc_comment as cur_comment," .
17 "rc_timestamp AS cur_timestamp,length(cur_text) as cur_length,cur_text FROM recentchanges,cur " .
18 "WHERE rc_cur_id=cur_id AND rc_new=1 AND rc_namespace=0 AND cur_is_redirect=0 " .
19 "ORDER BY rc_timestamp DESC LIMIT {$offset}, {$limit}";
22 function formatResult( $skin, $result ) {
23 global $wgLang;
24 $u = $result->cur_user;
25 $ut = $result->cur_user_text;
27 $length = wfmsg( "nbytes", $wgLang->formatNum( $result->cur_length ) );
28 $c = $skin->formatComment($result->cur_comment );
30 if ( 0 == $u ) { # not by a logged-in user
31 $ul = $ut;
33 else {
34 $ul = $skin->makeLink( $wgLang->getNsText(2) . ":{$ut}", $ut );
37 $d = $wgLang->timeanddate( $result->cur_timestamp, true );
38 $link = $skin->makeKnownLink( $result->cur_title, "" );
39 $s = "{$d} {$link} ({$length}) . . {$ul}";
41 if ( "" != $c && "*" != $c ) {
42 $s .= " <em>({$c})</em>";
45 return $s;
49 function wfSpecialNewpages()
51 global $wgRequest;
52 list( $limit, $offset ) = wfCheckLimits();
54 $npp = new NewPagesPage();
56 if( !$npp->doFeed( $wgRequest->getVal( 'feed' ) ) ) {
57 $npp->doQuery( $offset, $limit );