3 require_once( "QueryPage.php" );
5 class NewPagesPage
extends QueryPage
{
11 function isExpensive() {
12 # Indexed on RC, and will *not* work with querycache yet.
14 #return parent::isExpensive();
18 $dbr =& wfGetDB( DB_SLAVE
);
19 extract( $dbr->tableNames( 'recentchanges', 'cur' ) );
22 "SELECT 'Newpages' as type,
23 rc_namespace AS namespace,
28 rc_user_text AS user_text,
29 rc_comment as comment,
30 rc_timestamp AS timestamp,
31 length(cur_text) as length,
33 FROM $recentchanges,$cur
34 WHERE rc_cur_id=cur_id AND rc_new=1
35 AND rc_namespace=0 AND cur_is_redirect=0";
38 function formatResult( $skin, $result ) {
41 $ut = $result->user_text
;
43 $length = wfMsg( "nbytes", $wgLang->formatNum( $result->length
) );
44 $c = $skin->formatComment($result->comment
);
46 if ( 0 == $u ) { # not by a logged-in user
50 $ul = $skin->makeLink( $wgLang->getNsText(NS_USER
) . ":{$ut}", $ut );
53 $d = $wgLang->timeanddate( $result->timestamp
, true );
54 $link = $skin->makeKnownLink( $result->title
, "" );
55 $s = "{$d} {$link} ({$length}) . . {$ul}";
57 if ( "" != $c && "*" != $c ) {
58 $s .= " <em>({$c})</em>";
65 function wfSpecialNewpages()
68 list( $limit, $offset ) = wfCheckLimits();
70 $npp = new NewPagesPage();
72 if( !$npp->doFeed( $wgRequest->getVal( 'feed' ) ) ) {
73 $npp->doQuery( $offset, $limit );