<?php
/**
- *
- * @addtogroup SpecialPage
+ * @file
+ * @ingroup SpecialPage
*/
/**
global $wgUser, $wgOut, $wgRequest, $wgUseRCPatrol;
global $wgRCShowWatchingUsers, $wgShowUpdatedMarker;
global $wgAllowCategorizedRecentChanges ;
- $fname = 'wfSpecialRecentchanges';
# Get query parameters
$feedFormat = $wgRequest->getVal( 'feed' );
# As a feed, use limited settings only
if( $feedFormat ) {
global $wgFeedLimit;
- if( $limit > $wgFeedLimit ) {
- $limit = $wgFeedLimit;
- }
-
+ $limit = min( $wgFeedLimit, $limit );
} else {
$namespace = $wgRequest->getIntOrNull( 'namespace' );
# 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
- $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, $fname );
+ $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, __FUNCTION__ );
if ( $feedFormat || !$wgUseRCPatrol ) {
if( $lastmod && $wgOut->checkLastModified( $lastmod ) ){
# Client cache fresh and headers sent, nothing more to do.
$hidem .= $forcebot ? ' AND rc_bot = 1' : '';
if( $hidemyself ) {
- if( $wgUser->getID() ) {
- $hidem .= ' AND rc_user != ' . $wgUser->getID();
+ if( $wgUser->getId() ) {
+ $hidem .= ' AND rc_user != ' . $wgUser->getId();
} else {
$hidem .= ' AND rc_user_text != ' . $dbr->addQuotes( $wgUser->getName() );
}
}
// JOIN on watchlist for users
- $uid = $wgUser->getID();
+ $uid = $wgUser->getId();
if( $uid ) {
$tables = array( 'recentchanges', 'watchlist' );
$join_conds = array( 'watchlist' => array('LEFT JOIN',"wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace") );
if ($more != '') $more .= '&';
# Sort data for display and make sure it's unique after we've added user data.
+ # FIXME: why does this piss around with globals like this? Why is $limit added on globally?
$wgRCLinkLimits[] = $limit;
$wgRCLinkDays[] = $days;
sort($wgRCLinkLimits);
function rcFormatDiffRow( $title, $oldid, $newid, $timestamp, $comment, $actiontext='' ) {
global $wgFeedDiffCutoff, $wgContLang, $wgUser;
- $fname = 'rcFormatDiff';
- wfProfileIn( $fname );
+ wfProfileIn( __FUNCTION__ );
$skin = $wgUser->getSkin();
# log enties
if( $title->getNamespace() >= 0 && !$accErrors ) {
if( $oldid ) {
- wfProfileIn( "$fname-dodiff" );
+ wfProfileIn( __FUNCTION__."-dodiff" );
$de = new DifferenceEngine( $title, $oldid, $newid );
#$diffText = $de->getDiff( wfMsg( 'revisionasof',
$diffText = UtfNormal::cleanUp( $diffText );
$diffText = rcApplyDiffStyle( $diffText );
}
- wfProfileOut( "$fname-dodiff" );
+ wfProfileOut( __FUNCTION__."-dodiff" );
} else {
$rev = Revision::newFromId( $newid );
if( is_null( $rev ) ) {
$completeText .= $diffText;
}
- wfProfileOut( $fname );
+ wfProfileOut( __FUNCTION__ );
return $completeText;
}