if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$r .= ' ';
} else {
- # M & N (minor & new)
+ # M, N and !
$M = wfMsg( 'minoreditletter' );
$N = wfMsg( 'newpageletter' );
} else {
$r .= ' ' ;
}
+ if ( $rcObj->unpatrolled ) {
+ $r .= '!';
+ } else {
+ $r .= ' ';
+ }
}
# Timestamp
# Collate list of users
$isnew = false ;
+ $unpatrolled = false;
$userlinks = array () ;
foreach ( $block AS $rcObj ) {
$oldid = $rcObj->mAttribs['rc_last_oldid'];
- if ( $rcObj->mAttribs['rc_new'] ) $isnew = true ;
+ if ( $rcObj->mAttribs['rc_new'] ) {
+ $isnew = true ;
+ }
$u = $rcObj->userlink ;
- if ( !isset ( $userlinks[$u] ) ) $userlinks[$u] = 0 ;
+ if ( !isset ( $userlinks[$u] ) ) {
+ $userlinks[$u] = 0 ;
+ }
+ if ( $rcObj->unpatrolled ) {
+ $unpatrolled = true;
+ }
$userlinks[$u]++ ;
}
if ( $isnew ) $r .= $N ;
else $r .= ' ' ;
$r .= ' ' ; # Minor
+ if ( $unpatrolled ) {
+ $r .= "!";
+ } else {
+ $r .= " ";
+ }
# Timestamp
$r .= ' '.$block[0]->timestamp.' ' ;
$r .= '<img src="'.$wgStylePath.'/common/images/Arr_.png" width="12" height="12" />';
$r .= '<tt> ' ;
- if ( $rc_new ) $r .= $N ;
- else $r .= ' ' ;
- if ( $rc_minor ) $r .= $M ;
- else $r .= ' ' ;
- $r .= '</tt>' ;
+ if ( $rc_new ) {
+ $r .= $N ;
+ } else {
+ $r .= ' ' ;
+ }
+
+ if ( $rc_minor ) {
+ $r .= $M ;
+ } else {
+ $r .= ' ' ;
+ }
+
+ if ( $rcObj->unpatrolled ) {
+ $r .= "!";
+ } else {
+ $r .= " ";
+ }
+
+ $r .= ' </tt>' ;
$o = '' ;
if ( $rc_last_oldid != 0 ) {
extract( $rc->mAttribs );
$curIdEq = 'curid=' . $rc_cur_id;
+ # Should patrol-related stuff be shown?
+ $unpatrolled = $wgUseRCPatrol && $wgUser->getID() != 0 &&
+ ( !$wgOnlySysopsCanPatrol || $wgUser->isAllowed('patrol') ) && $rc_patrolled == 0;
+
# Make date header if necessary
$date = $wgContLang->date( $rc_timestamp, true);
$uidate = $wgLang->date( $rc_timestamp, true);
$this->rclistOpen = true;
}
- # If this edit has not yet been patrolled, make it stick out
- if ( !$wgUseRCPatrol || $rc_patrolled ) {
- $s .= '<table border="0"><tr><td><li>';
- } else {
- $s .= '<table border="0" width="96%"><tr><td class="not_patrolled"><li>';
- }
+ $s .= '<li>';
if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
# Diff
if ( $rc_type == RC_NEW || $rc_type == RC_LOG ) {
$diffLink = wfMsg( 'diff' );
} else {
- if ( $wgUseRCPatrol && $rc_patrolled == 0 && $wgUser->getID() != 0 &&
- ( $wgUser->isAllowed('protect') || !$wgOnlySysopsCanPatrol ) )
+ if ( $unpatrolled )
$rcidparam = "&rcid={$rc_id}";
else
$rcidparam = "";
$s .= $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' );
$s .= ') . . ';
- # M and N (minor and new)
+ # M, N and ! (minor, new and unpatrolled)
if ( $rc_minor ) { $s .= ' <span class="minor">'.wfMsg( "minoreditletter" ).'</span>'; }
if ( $rc_type == RC_NEW ) { $s .= '<span class="newpage">'.wfMsg( "newpageletter" ).'</span>'; }
+ if ( !$rc_patrolled ) { $s .= ' <span class="unpatrolled">!</span>'; }
# Article link
# If it's a new article, there is no diff link, but if it hasn't been
# patrolled yet, we need to give users a way to do so
- if ( $wgUseRCPatrol && $rc_type == RC_NEW && $rc_patrolled == 0 &&
- $wgUser->getID() != 0 && ( $wgUser->isAllowed('patrol') || !$wgOnlySysopsCanPatrol ) )
+ if ( $unpatrolled && $rc_type == RC_NEW )
$articleLink = $this->makeKnownLinkObj( $rc->getTitle(), '', "rcid={$rc_id}" );
else
$articleLink = $this->makeKnownLinkObj( $rc->getTitle(), '' );
$rc_comment=$this->formatComment($rc_comment,$rc->getTitle());
$s .= $wgContLang->emphasize(' (' . $rc_comment . ')');
}
- $s .= "</li></td></tr></table>\n";
+ $s .= "</li>\n";
return $s;
}
function recentChangesLineNew( &$baseRC, $watched = false ) {
global $wgTitle, $wgLang, $wgContLang, $wgUser, $wgRCSeconds;
-
+ global $wgUseRCPatrol, $wgOnlySysopsCanPatrol;
+
# Create a specialised object
$rc = RCCacheEntry::newFromParent( $baseRC ) ;
$ret .= "<h4>{$uidate}</h4>\n";
$this->lastdate = $date;
}
-
+
+ # Should patrol-related stuff be shown?
+ if ( $wgUseRCPatrol && $wgUser->getID() != 0 &&
+ ( !$wgOnlySysopsCanPatrol || $wgUser->isAllowed('patrol') )) {
+ $rc->unpatrolled = !$rc_patrolled;
+ } else {
+ $rc->unpatrolled = false;
+ }
+
# Make article link
if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$msg = ( $rc_type == RC_MOVE ) ? "1movedto2" : "1movedto2_redir";
$logtype = $matches[1];
$logname = LogPage::logName( $logtype );
$clink = '(' . $this->makeKnownLinkObj( $rc->getTitle(), $logname ) . ')';
+ } elseif ( $rc->unpatrolled && $rc_type == RC_NEW ) {
+ # Unpatrolled new page, give rc_id in query
+ $clink = $this->makeKnownLinkObj( $rc->getTitle(), '', "rcid={$rc_id}" );
} else {
$clink = $this->makeKnownLinkObj( $rc->getTitle(), '' ) ;
}
# Make "last" link
$titleObj = $rc->getTitle();
+ if ( $rc->unpatrolled ) {
+ $rcIdQuery = "&rcid={$rc_id}";
+ } else {
+ $rcIdQuery = '';
+ }
if ( $rc_last_oldid == 0 || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$lastLink = wfMsg( 'last' );
} else {
$lastLink = $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'last' ),
- $curIdEq.'&diff='.$rc_this_oldid.'&oldid='.$rc_last_oldid );
+ $curIdEq.'&diff='.$rc_this_oldid.'&oldid='.$rc_last_oldid . $rcIdQuery );
}
# Make user link (or user contributions for unregistered users)
function wfSpecialRecentchanges( $par ) {
global $wgUser, $wgOut, $wgLang, $wgContLang, $wgTitle, $wgMemc, $wgDBname;
global $wgRequest, $wgSitename, $wgLanguageCode, $wgContLanguageCode;
- global $wgFeedClasses;
+ global $wgFeedClasses, $wgUseRCPatrol;
$fname = 'wfSpecialRecentchanges';
# Get query parameters
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'recentchanges', 'watchlist' ) );
- $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, $fname );
+
# 10 seconds server-side caching max
$wgOut->setSquidMaxage( 10 );
- if( $lastmod && $wgOut->checkLastModified( $lastmod ) ){
- # Client cache fresh and headers sent, nothing more to do.
- return;
+
+ # Get last modified date, for client caching
+ # Don't use this if we are using the patrol feature, patrol changes don't update the timestamp
+ if ( !$wgUseRCPatrol ) {
+ $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, $fname );
+ if( $lastmod && $wgOut->checkLastModified( $lastmod ) ){
+ # Client cache fresh and headers sent, nothing more to do.
+ return;
+ }
}
# Output header