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();
17 function getSQL( $offset, $limit ) {
19 "SELECT 'Newpages' as type,
20 rc_namespace AS namespace,
25 rc_user_text AS user_text,
26 rc_comment as comment,
27 rc_timestamp AS timestamp,
28 length(cur_text) as length,
30 FROM recentchanges,cur
31 WHERE rc_cur_id=cur_id AND rc_new=1
32 AND rc_namespace=0 AND cur_is_redirect=0";
35 function formatResult( $skin, $result ) {
38 $ut = $result->user_text
;
40 $length = wfMsg( "nbytes", $wgLang->formatNum( $result->length
) );
41 $c = $skin->formatComment($result->comment
);
43 if ( 0 == $u ) { # not by a logged-in user
47 $ul = $skin->makeLink( $wgLang->getNsText(NS_USER
) . ":{$ut}", $ut );
50 $d = $wgLang->timeanddate( $result->timestamp
, true );
51 $link = $skin->makeKnownLink( $result->title
, "" );
52 $s = "{$d} {$link} ({$length}) . . {$ul}";
54 if ( "" != $c && "*" != $c ) {
55 $s .= " <em>({$c})</em>";
62 function wfSpecialNewpages()
65 list( $limit, $offset ) = wfCheckLimits();
67 $npp = new NewPagesPage();
69 if( !$npp->doFeed( $wgRequest->getVal( 'feed' ) ) ) {
70 $npp->doQuery( $offset, $limit );