return 0;
}
}
-
+
/**
* Returns true if this article exists in the database.
* @return bool
isset( $this->mRevision ) &&
$this->mRevision->isCurrent();
}
-
+
/**
* Loads everything except the text
* This isn't necessary for all uses, so it's only done if needed.
$wgOut->addPrimaryWikiText( $text, $this );
} else {
# Display content, don't attempt to save to parser cache
-
+
# Don't show section-edit links on old revisions... this way lies madness.
if( !$this->isCurrent() ) {
$oldEditSectionSetting = $wgOut->mParserOptions->setEditSection( false );
}
$wgOut->addWikiText( $text );
-
+
if( !$this->isCurrent() ) {
$wgOut->mParserOptions->setEditSection( $oldEditSectionSetting );
}
Article::onArticleCreate( $this->mTitle );
if(!$suppressRC) {
- RecentChange::notifyNew( $now, $this->mTitle, $isminor, $wgUser, $summary, 'default',
- '', strlen( $text ) );
+ RecentChange::notifyNew( $now, $this->mTitle, $isminor, $wgUser, $summary, 'default',
+ '', strlen( $text ), $revisionId );
}
if ($watchthis) {
# Update recentchanges and purge cache and whatnot
$bot = (int)($wgUser->isBot() || $forceBot);
RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $wgUser, $summary,
- $lastRevision, $this->getTimestamp(), $bot, '', $oldsize, $newsize );
+ $lastRevision, $this->getTimestamp(), $bot, '', $oldsize, $newsize,
+ $revisionId );
Article::onArticleEdit( $this->mTitle );
}
}
function ChangesList( &$skin ) {
$this->skin =& $skin;
}
-
+
/**
* Returns the appropiate flags for new page, minor change and patrolling
*/
}
- /**
+ /**
* Returns text for the start of the tabular part of RC
*/
function beginRecentChangesList() {
$message[$msg] = wfMsg( $msg );
}
}
-
+
# Extract DB fields into local scope
extract( $rc->mAttribs );
$curIdEq = 'curid=' . $rc_cur_id;
# Should patrol-related stuff be shown?
- $unpatrolled = $wgUseRCPatrol && $wgUser->isLoggedIn() &&
+ $unpatrolled = $wgUseRCPatrol && $wgUser->isLoggedIn() &&
( !$wgOnlySysopsCanPatrol || $wgUser->isAllowed('patrol') ) && $rc_patrolled == 0;
-
+
# Make date header if necessary
$date = $wgLang->date( $rc_timestamp, true, true );
$s = '';
function recentChangesLineNew( &$baseRC, $watched = false ) {
global $wgTitle, $wgLang, $wgContLang, $wgUser,
$wgUseRCPatrol, $wgOnlySysopsCanPatrol, $wgSysopUserBans;
-
+
static $message;
if( !isset( $message ) ) {
foreach( explode(' ', 'cur diff hist minoreditletter newpageletter last blocklink' ) as $msg ) {
$message[$msg] = wfMsg( $msg );
}
}
-
+
# Create a specialised object
$rc = RCCacheEntry::newFromParent( $baseRC ) ;
$ret .= "<h4>{$date}</h4>\n";
$this->lastdate = $date;
}
-
+
# Should patrol-related stuff be shown?
- if ( $wgUseRCPatrol && $wgUser->isLoggedIn() &&
+ if ( $wgUseRCPatrol && $wgUser->isLoggedIn() &&
( !$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";
# been purged, it just locks up the indexes needlessly.
global $wgRCMaxAge;
$age = time() - wfTimestamp( TS_UNIX, $lastTime );
- if( $age < $wgRCMaxAge ) {
- # Update rc_this_oldid for the entries which were current
- $dbw->update( 'recentchanges',
- array( /* SET */
- 'rc_this_oldid' => $oldid
- ), array( /* WHERE */
- 'rc_namespace' => $ns,
- 'rc_title' => $title,
- 'rc_timestamp' => $dbw->timestamp( $lastTime )
- ), $fname
- );
- }
+# if( $age < $wgRCMaxAge ) {
+# # Update rc_this_oldid for the entries which were current
+# $dbw->update( 'recentchanges',
+# array( /* SET */
+# 'rc_this_oldid' => $oldid
+# ), array( /* WHERE */
+# 'rc_namespace' => $ns,
+# 'rc_title' => $title,
+# 'rc_timestamp' => $dbw->timestamp( $lastTime )
+# ), $fname
+# );
+# }
# Update rc_cur_time
$dbw->update( 'recentchanges', array( 'rc_cur_time' => $now ),
# Makes an entry in the database corresponding to an edit
/*static*/ function notifyEdit( $timestamp, &$title, $minor, &$user, $comment,
- $oldId, $lastTimestamp, $bot = "default", $ip = '', $oldSize = 0, $newSize = 0 )
+ $oldId, $lastTimestamp, $bot = "default", $ip = '', $oldSize = 0, $newSize = 0,
+ $newId = 0)
{
if ( $bot == 'default ' ) {
$bot = $user->isBot();
'rc_user' => $user->getID(),
'rc_user_text' => $user->getName(),
'rc_comment' => $comment,
- 'rc_this_oldid' => $title->getLatestRevID(),
+ 'rc_this_oldid' => $newId,
'rc_last_oldid' => $oldId,
'rc_bot' => $bot ? 1 : 0,
'rc_moved_to_ns' => 0,
# Makes an entry in the database corresponding to page creation
# Note: the title object must be loaded with the new id using resetArticleID()
/*static*/ function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot = "default",
- $ip='', $size = 0 )
+ $ip='', $size = 0, $newId = 0 )
{
if ( !$ip ) {
global $wgIP;
'rc_user' => $user->getID(),
'rc_user_text' => $user->getName(),
'rc_comment' => $comment,
- 'rc_this_oldid' => 0,
+ 'rc_this_oldid' => $newId,
'rc_last_oldid' => 0,
'rc_bot' => $bot ? 1 : 0,
'rc_moved_to_ns' => 0,