Mark unwatch button as ca-unwatch rather than ca-watch to fix the tooltip.
[mediawiki.git] / includes / SpecialNewpages.php
blob802e9f9e290bf4e03fb9f50ef6496a77205c5057
1 <?php
3 require_once( "QueryPage.php" );
5 class NewPagesPage extends QueryPage {
7 function getName() {
8 return "Newpages";
11 function isExpensive() {
12 # Indexed on RC, and will *not* work with querycache yet.
13 return false;
14 #return parent::isExpensive();
17 function getSQL() {
18 $dbr =& wfGetDB( DB_SLAVE );
19 extract( $dbr->tableNames( 'recentchanges', 'cur' ) );
21 return
22 "SELECT 'Newpages' as type,
23 rc_namespace AS namespace,
24 rc_title AS title,
25 rc_cur_id AS value,
27 rc_user AS user,
28 rc_user_text AS user_text,
29 rc_comment as comment,
30 rc_timestamp AS timestamp,
31 length(cur_text) as length,
32 cur_text as text
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 ) {
39 global $wgLang;
40 $u = $result->user;
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
47 $ul = $ut;
49 else {
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>";
61 return $s;
65 function wfSpecialNewpages()
67 global $wgRequest;
68 list( $limit, $offset ) = wfCheckLimits();
70 $npp = new NewPagesPage();
72 if( !$npp->doFeed( $wgRequest->getVal( 'feed' ) ) ) {
73 $npp->doQuery( $offset, $limit );