2004-02-18 02:15:00 +00:00
|
|
|
<?php
|
2004-01-17 05:49:39 +00:00
|
|
|
# Utility class for creating new RC entries
|
|
|
|
|
|
|
|
|
|
define( "RC_EDIT", 0);
|
|
|
|
|
define( "RC_NEW", 1);
|
|
|
|
|
define( "RC_MOVE", 2);
|
|
|
|
|
define( "RC_LOG", 3);
|
2004-06-20 11:55:24 +00:00
|
|
|
define( "RC_MOVE_OVER_REDIRECT", 4);
|
|
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
mAttributes:
|
2004-08-09 05:38:11 +00:00
|
|
|
rc_id id of the row in the recentchanges table
|
2004-01-17 05:49:39 +00:00
|
|
|
rc_timestamp time the entry was made
|
|
|
|
|
rc_cur_time timestamp on the cur row
|
|
|
|
|
rc_namespace namespace #
|
|
|
|
|
rc_title non-prefixed db key
|
2004-08-09 05:38:11 +00:00
|
|
|
rc_type is new entry, used to determine whether updating is necessary
|
2004-01-17 05:49:39 +00:00
|
|
|
rc_minor is minor
|
|
|
|
|
rc_cur_id id of associated cur entry
|
|
|
|
|
rc_user user id who made the entry
|
|
|
|
|
rc_user_text user name who made the entry
|
|
|
|
|
rc_comment edit summary
|
|
|
|
|
rc_this_oldid old_id associated with this entry (or zero)
|
|
|
|
|
rc_last_oldid old_id associated with the entry before this one (or zero)
|
|
|
|
|
rc_bot is bot, hidden
|
2004-06-14 10:40:24 +00:00
|
|
|
rc_ip IP address of the user in dotted quad notation
|
2004-01-18 02:24:12 +00:00
|
|
|
rc_new obsolete, use rc_type==RC_NEW
|
2004-08-09 05:38:11 +00:00
|
|
|
rc_patrolled boolean whether or not someone has marked this edit as patrolled
|
2004-01-17 05:49:39 +00:00
|
|
|
|
|
|
|
|
mExtra:
|
|
|
|
|
prefixedDBkey prefixed db key, used by external app via msg queue
|
|
|
|
|
lastTimestamp timestamp of previous entry, used in WHERE clause during update
|
|
|
|
|
lang the interwiki prefix, automatically set in save()
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class RecentChange
|
|
|
|
|
{
|
|
|
|
|
var $mAttribs = array(), $mExtra = array();
|
|
|
|
|
var $mTitle = false, $mMovedToTitle = false;
|
|
|
|
|
|
|
|
|
|
# Factory methods
|
2004-08-09 05:38:11 +00:00
|
|
|
|
|
|
|
|
/* static */ function newFromRow( $row )
|
2004-01-17 05:49:39 +00:00
|
|
|
{
|
|
|
|
|
$rc = new RecentChange;
|
|
|
|
|
$rc->loadFromRow( $row );
|
|
|
|
|
return $rc;
|
|
|
|
|
}
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-01-17 09:49:43 +00:00
|
|
|
/* static */ function newFromCurRow( $row )
|
|
|
|
|
{
|
|
|
|
|
$rc = new RecentChange;
|
|
|
|
|
$rc->loadFromCurRow( $row );
|
|
|
|
|
return $rc;
|
|
|
|
|
}
|
|
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
# Accessors
|
2004-08-09 05:38:11 +00:00
|
|
|
|
|
|
|
|
function setAttribs( $attribs )
|
2004-01-17 05:49:39 +00:00
|
|
|
{
|
|
|
|
|
$this->mAttribs = $attribs;
|
|
|
|
|
}
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
function setExtra( $extra )
|
|
|
|
|
{
|
|
|
|
|
$this->mExtra = $extra;
|
|
|
|
|
}
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
function getTitle()
|
|
|
|
|
{
|
|
|
|
|
if ( $this->mTitle === false ) {
|
|
|
|
|
$this->mTitle = Title::makeTitle( $this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] );
|
|
|
|
|
}
|
|
|
|
|
return $this->mTitle;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getMovedToTitle()
|
|
|
|
|
{
|
|
|
|
|
if ( $this->mMovedToTitle === false ) {
|
2004-08-09 05:38:11 +00:00
|
|
|
$this->mMovedToTitle = Title::makeTitle( $this->mAttribs['rc_moved_to_ns'],
|
2004-01-17 05:49:39 +00:00
|
|
|
$this->mAttribs['rc_moved_to_title'] );
|
|
|
|
|
}
|
|
|
|
|
return $this->mMovedToTitle;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Writes the data in this object to the database
|
2004-08-09 05:38:11 +00:00
|
|
|
function save()
|
2004-01-17 05:49:39 +00:00
|
|
|
{
|
2004-06-14 10:40:24 +00:00
|
|
|
global $wgUseRCQueue, $wgRCQueueID, $wgLocalInterwiki, $wgPutIPinRC;
|
2004-01-17 05:49:39 +00:00
|
|
|
$fname = "RecentChange::save";
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-07-18 08:48:43 +00:00
|
|
|
$dbw =& wfGetDB( DB_MASTER );
|
2004-01-17 05:49:39 +00:00
|
|
|
if ( !is_array($this->mExtra) ) {
|
|
|
|
|
$this->mExtra = array();
|
|
|
|
|
}
|
|
|
|
|
$this->mExtra['lang'] = $wgLocalInterwiki;
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-06-14 10:40:24 +00:00
|
|
|
if ( !$wgPutIPinRC ) {
|
|
|
|
|
$this->mAttribs['rc_ip'] = '';
|
|
|
|
|
}
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-08-19 12:59:57 +00:00
|
|
|
# Fixup database timestamps
|
|
|
|
|
$this->mAttribs['rc_timestamp']=$dbw->timestamp($this->mAttribs['rc_timestamp']);
|
|
|
|
|
$this->mAttribs['rc_cur_time']=$dbw->timestamp($this->mAttribs['rc_cur_time']);
|
|
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
# Insert new row
|
2004-07-18 08:48:43 +00:00
|
|
|
$dbw->insertArray( "recentchanges", $this->mAttribs, $fname );
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
# Update old rows, if necessary
|
|
|
|
|
if ( $this->mAttribs['rc_type'] == RC_EDIT ) {
|
|
|
|
|
$oldid = $this->mAttribs['rc_last_oldid'];
|
|
|
|
|
$ns = $this->mAttribs['rc_namespace'];
|
2004-07-18 08:48:43 +00:00
|
|
|
$title = $this->mAttribs['rc_title'];
|
2004-01-17 05:49:39 +00:00
|
|
|
$lastTime = $this->mExtra['lastTimestamp'];
|
|
|
|
|
$now = $this->mAttribs['rc_timestamp'];
|
|
|
|
|
$curId = $this->mAttribs['rc_cur_id'];
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
# Update rc_this_oldid for the entries which were current
|
2004-08-09 05:38:11 +00:00
|
|
|
$dbw->updateArray( 'recentchanges',
|
2004-07-18 08:48:43 +00:00
|
|
|
array( /* SET */
|
|
|
|
|
'rc_this_oldid' => $oldid
|
2004-08-09 05:38:11 +00:00
|
|
|
), array( /* WHERE */
|
2004-07-18 08:48:43 +00:00
|
|
|
'rc_namespace' => $ns,
|
|
|
|
|
'rc_title' => $title,
|
2004-08-19 12:59:57 +00:00
|
|
|
'rc_timestamp' => $dbw->timestamp($lastTime)
|
2004-07-18 08:48:43 +00:00
|
|
|
), $fname
|
|
|
|
|
);
|
2004-01-17 05:49:39 +00:00
|
|
|
|
|
|
|
|
# Update rc_cur_time
|
2004-08-09 05:38:11 +00:00
|
|
|
$dbw->updateArray( 'recentchanges', array( 'rc_cur_time' => $now ),
|
2004-07-18 08:48:43 +00:00
|
|
|
array( 'rc_cur_id' => $curId ), $fname );
|
2004-01-17 05:49:39 +00:00
|
|
|
}
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
# Notify external application
|
|
|
|
|
if ( $wgUseRCQueue ) {
|
|
|
|
|
$queue = msg_get_queue( $wgRCQueueID );
|
2004-08-09 05:38:11 +00:00
|
|
|
if (!msg_send( $queue, array_merge( $this->mAttribs, 1, $this->mExtra ),
|
|
|
|
|
true, false, $error ))
|
2004-01-17 05:49:39 +00:00
|
|
|
{
|
|
|
|
|
wfDebug( "Error sending message to RC queue, code $error\n" );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-08-09 05:38:11 +00:00
|
|
|
|
|
|
|
|
# Marks a certain row as patrolled
|
|
|
|
|
function markPatrolled( $rcid )
|
|
|
|
|
{
|
|
|
|
|
$fname = "RecentChange::markPatrolled";
|
|
|
|
|
|
|
|
|
|
$dbw =& wfGetDB( DB_MASTER );
|
|
|
|
|
|
|
|
|
|
$dbw->updateArray( 'recentchanges',
|
|
|
|
|
array( /* SET */
|
|
|
|
|
'rc_patrolled' => 1
|
|
|
|
|
), array( /* WHERE */
|
|
|
|
|
'rc_id' => $rcid
|
|
|
|
|
), $fname
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
# Makes an entry in the database corresponding to an edit
|
2004-08-09 05:38:11 +00:00
|
|
|
/*static*/ function notifyEdit( $timestamp, &$title, $minor, &$user, $comment,
|
|
|
|
|
$oldId, $lastTimestamp, $bot = "default", $ip = '' )
|
2004-01-17 05:49:39 +00:00
|
|
|
{
|
2004-01-31 02:22:15 +00:00
|
|
|
if ( $bot == "default " ) {
|
|
|
|
|
$bot = $user->isBot();
|
|
|
|
|
}
|
|
|
|
|
|
2004-06-14 10:40:24 +00:00
|
|
|
if ( !$ip ) {
|
|
|
|
|
global $wgIP;
|
|
|
|
|
$ip = empty( $wgIP ) ? '' : $wgIP;
|
|
|
|
|
}
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
$rc = new RecentChange;
|
|
|
|
|
$rc->mAttribs = array(
|
|
|
|
|
'rc_timestamp' => $timestamp,
|
|
|
|
|
'rc_cur_time' => $timestamp,
|
|
|
|
|
'rc_namespace' => $title->getNamespace(),
|
|
|
|
|
'rc_title' => $title->getDBkey(),
|
|
|
|
|
'rc_type' => RC_EDIT,
|
|
|
|
|
'rc_minor' => $minor ? 1 : 0,
|
|
|
|
|
'rc_cur_id' => $title->getArticleID(),
|
|
|
|
|
'rc_user' => $user->getID(),
|
|
|
|
|
'rc_user_text' => $user->getName(),
|
|
|
|
|
'rc_comment' => $comment,
|
|
|
|
|
'rc_this_oldid' => 0,
|
|
|
|
|
'rc_last_oldid' => $oldId,
|
2004-01-31 02:22:15 +00:00
|
|
|
'rc_bot' => $bot ? 1 : 0,
|
2004-01-17 05:49:39 +00:00
|
|
|
'rc_moved_to_ns' => 0,
|
2004-01-18 02:24:12 +00:00
|
|
|
'rc_moved_to_title' => '',
|
2004-06-14 10:40:24 +00:00
|
|
|
'rc_ip' => $ip,
|
2004-01-18 02:24:12 +00:00
|
|
|
'rc_new' => 0 # obsolete
|
2004-01-17 05:49:39 +00:00
|
|
|
);
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
$rc->mExtra = array(
|
|
|
|
|
'prefixedDBkey' => $title->getPrefixedDBkey(),
|
|
|
|
|
'lastTimestamp' => $lastTimestamp
|
|
|
|
|
);
|
|
|
|
|
$rc->save();
|
|
|
|
|
}
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
# Makes an entry in the database corresponding to page creation
|
|
|
|
|
# Note: the title object must be loaded with the new id using resetArticleID()
|
2004-06-14 10:40:24 +00:00
|
|
|
/*static*/ function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot = "default", $ip='' )
|
2004-01-17 05:49:39 +00:00
|
|
|
{
|
2004-06-14 10:40:24 +00:00
|
|
|
if ( !$ip ) {
|
|
|
|
|
global $wgIP;
|
|
|
|
|
$ip = empty( $wgIP ) ? '' : $wgIP;
|
|
|
|
|
}
|
2004-01-31 07:31:07 +00:00
|
|
|
if ( $bot == "default" ) {
|
2004-01-31 02:22:15 +00:00
|
|
|
$bot = $user->isBot();
|
|
|
|
|
}
|
2004-06-14 10:40:24 +00:00
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
$rc = new RecentChange;
|
|
|
|
|
$rc->mAttribs = array(
|
2004-06-14 10:40:24 +00:00
|
|
|
'rc_timestamp' => $timestamp,
|
|
|
|
|
'rc_cur_time' => $timestamp,
|
|
|
|
|
'rc_namespace' => $title->getNamespace(),
|
|
|
|
|
'rc_title' => $title->getDBkey(),
|
|
|
|
|
'rc_type' => RC_NEW,
|
|
|
|
|
'rc_minor' => $minor ? 1 : 0,
|
|
|
|
|
'rc_cur_id' => $title->getArticleID(),
|
|
|
|
|
'rc_user' => $user->getID(),
|
|
|
|
|
'rc_user_text' => $user->getName(),
|
|
|
|
|
'rc_comment' => $comment,
|
|
|
|
|
'rc_this_oldid' => 0,
|
|
|
|
|
'rc_last_oldid' => 0,
|
|
|
|
|
'rc_bot' => $bot ? 1 : 0,
|
|
|
|
|
'rc_moved_to_ns' => 0,
|
|
|
|
|
'rc_moved_to_title' => '',
|
|
|
|
|
'rc_ip' => $ip,
|
2004-01-18 02:24:12 +00:00
|
|
|
'rc_new' => 1 # obsolete
|
2004-01-17 05:49:39 +00:00
|
|
|
);
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
$rc->mExtra = array(
|
|
|
|
|
'prefixedDBkey' => $title->getPrefixedDBkey(),
|
|
|
|
|
'lastTimestamp' => 0
|
|
|
|
|
);
|
|
|
|
|
$rc->save();
|
|
|
|
|
}
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
# Makes an entry in the database corresponding to a rename
|
2004-06-20 11:55:24 +00:00
|
|
|
/*static*/ function notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='', $overRedir = false )
|
2004-01-17 05:49:39 +00:00
|
|
|
{
|
2004-06-14 10:40:24 +00:00
|
|
|
if ( !$ip ) {
|
|
|
|
|
global $wgIP;
|
|
|
|
|
$ip = empty( $wgIP ) ? '' : $wgIP;
|
|
|
|
|
}
|
2004-01-17 05:49:39 +00:00
|
|
|
$rc = new RecentChange;
|
|
|
|
|
$rc->mAttribs = array(
|
|
|
|
|
'rc_timestamp' => $timestamp,
|
|
|
|
|
'rc_cur_time' => $timestamp,
|
|
|
|
|
'rc_namespace' => $oldTitle->getNamespace(),
|
|
|
|
|
'rc_title' => $oldTitle->getDBkey(),
|
2004-06-20 11:55:24 +00:00
|
|
|
'rc_type' => $overRedir ? RC_MOVE_OVER_REDIRECT : RC_MOVE,
|
2004-01-17 05:49:39 +00:00
|
|
|
'rc_minor' => 0,
|
|
|
|
|
'rc_cur_id' => $oldTitle->getArticleID(),
|
|
|
|
|
'rc_user' => $user->getID(),
|
|
|
|
|
'rc_user_text' => $user->getName(),
|
|
|
|
|
'rc_comment' => $comment,
|
|
|
|
|
'rc_this_oldid' => 0,
|
|
|
|
|
'rc_last_oldid' => 0,
|
|
|
|
|
'rc_bot' => $user->isBot() ? 1 : 0,
|
|
|
|
|
'rc_moved_to_ns' => $newTitle->getNamespace(),
|
2004-01-18 02:24:12 +00:00
|
|
|
'rc_moved_to_title' => $newTitle->getDBkey(),
|
2004-06-14 10:40:24 +00:00
|
|
|
'rc_ip' => $ip,
|
2004-08-09 05:38:11 +00:00
|
|
|
'rc_new' => 0, # obsolete
|
|
|
|
|
'rc_patrolled' => 1
|
2004-01-17 05:49:39 +00:00
|
|
|
);
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
$rc->mExtra = array(
|
|
|
|
|
'prefixedDBkey' => $oldTitle->getPrefixedDBkey(),
|
|
|
|
|
'lastTimestamp' => 0,
|
|
|
|
|
'prefixedMoveTo' => $newTitle->getPrefixedDBkey()
|
|
|
|
|
);
|
|
|
|
|
$rc->save();
|
|
|
|
|
}
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-06-20 11:55:24 +00:00
|
|
|
/* static */ function notifyMoveToNew( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) {
|
2004-06-20 23:47:57 +00:00
|
|
|
RecentChange::notifyMove( $timestamp, $oldTitle, $newTitle, $user, $comment, $ip, false );
|
2004-06-20 11:55:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* static */ function notifyMoveOverRedirect( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) {
|
2004-06-20 23:47:57 +00:00
|
|
|
RecentChange::notifyMove( $timestamp, $oldTitle, $newTitle, $user, $comment, $ip='', true );
|
2004-06-20 11:55:24 +00:00
|
|
|
}
|
|
|
|
|
|
2004-08-09 05:38:11 +00:00
|
|
|
# A log entry is different to an edit in that previous revisions are
|
2004-01-17 05:49:39 +00:00
|
|
|
# not kept
|
2004-06-14 10:40:24 +00:00
|
|
|
/*static*/ function notifyLog( $timestamp, &$title, &$user, $comment, $ip='' )
|
2004-01-17 05:49:39 +00:00
|
|
|
{
|
2004-06-14 10:40:24 +00:00
|
|
|
if ( !$ip ) {
|
|
|
|
|
global $wgIP;
|
|
|
|
|
$ip = empty( $wgIP ) ? '' : $wgIP;
|
|
|
|
|
}
|
2004-01-17 05:49:39 +00:00
|
|
|
$rc = new RecentChange;
|
|
|
|
|
$rc->mAttribs = array(
|
|
|
|
|
'rc_timestamp' => $timestamp,
|
|
|
|
|
'rc_cur_time' => $timestamp,
|
|
|
|
|
'rc_namespace' => $title->getNamespace(),
|
|
|
|
|
'rc_title' => $title->getDBkey(),
|
|
|
|
|
'rc_type' => RC_LOG,
|
|
|
|
|
'rc_minor' => 0,
|
|
|
|
|
'rc_cur_id' => $title->getArticleID(),
|
|
|
|
|
'rc_user' => $user->getID(),
|
|
|
|
|
'rc_user_text' => $user->getName(),
|
|
|
|
|
'rc_comment' => $comment,
|
|
|
|
|
'rc_this_oldid' => 0,
|
|
|
|
|
'rc_last_oldid' => 0,
|
|
|
|
|
'rc_bot' => 0,
|
|
|
|
|
'rc_moved_to_ns' => 0,
|
2004-01-18 02:24:12 +00:00
|
|
|
'rc_moved_to_title' => '',
|
2004-06-14 10:40:24 +00:00
|
|
|
'rc_ip' => $ip,
|
2004-08-09 05:38:11 +00:00
|
|
|
'rc_patrolled' => 1,
|
2004-01-18 02:24:12 +00:00
|
|
|
'rc_new' => 0 # obsolete
|
2004-01-17 05:49:39 +00:00
|
|
|
);
|
|
|
|
|
$rc->mExtra = array(
|
|
|
|
|
'prefixedDBkey' => $title->getPrefixedDBkey(),
|
|
|
|
|
'lastTimestamp' => 0
|
|
|
|
|
);
|
|
|
|
|
$rc->save();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Initialises the members of this object from a mysql row object
|
|
|
|
|
function loadFromRow( $row )
|
|
|
|
|
{
|
|
|
|
|
$this->mAttribs = get_object_vars( $row );
|
|
|
|
|
$this->mExtra = array();
|
|
|
|
|
}
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-01-17 09:49:43 +00:00
|
|
|
# Makes a pseudo-RC entry from a cur row, for watchlists and things
|
|
|
|
|
function loadFromCurRow( $row )
|
|
|
|
|
{
|
|
|
|
|
$this->mAttribs = array(
|
|
|
|
|
"rc_timestamp" => $row->cur_timestamp,
|
|
|
|
|
"rc_cur_time" => $row->cur_timestamp,
|
|
|
|
|
"rc_user" => $row->cur_user,
|
|
|
|
|
"rc_user_text" => $row->cur_user_text,
|
|
|
|
|
"rc_namespace" => $row->cur_namespace,
|
|
|
|
|
"rc_title" => $row->cur_title,
|
|
|
|
|
"rc_comment" => $row->cur_comment,
|
|
|
|
|
"rc_minor" => !!$row->cur_minor_edit,
|
|
|
|
|
"rc_type" => $row->cur_is_new ? RC_NEW : RC_EDIT,
|
|
|
|
|
"rc_cur_id" => $row->cur_id,
|
|
|
|
|
'rc_this_oldid' => 0,
|
|
|
|
|
'rc_last_oldid' => 0,
|
|
|
|
|
'rc_bot' => 0,
|
|
|
|
|
'rc_moved_to_ns' => 0,
|
2004-01-18 02:24:12 +00:00
|
|
|
'rc_moved_to_title' => '',
|
2004-06-14 10:40:24 +00:00
|
|
|
'rc_ip' => '',
|
2004-08-09 10:02:54 +00:00
|
|
|
'rc_patrolled' => '1', # we can't support patrolling on the Watchlist
|
|
|
|
|
# currently because it uses cur, not recentchanges
|
2004-01-18 02:24:12 +00:00
|
|
|
'rc_new' => $row->cur_is_new # obsolete
|
2004-01-17 09:49:43 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$this->mExtra = array();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-01-17 05:49:39 +00:00
|
|
|
# Gets the end part of the diff URL assoicated with this object
|
|
|
|
|
# Blank if no diff link should be displayed
|
|
|
|
|
function diffLinkTrail( $forceCur )
|
|
|
|
|
{
|
|
|
|
|
if ( $this->mAttribs['rc_type'] == RC_EDIT ) {
|
|
|
|
|
$trail = "curid=" . (int)($this->mAttribs['rc_cur_id']) .
|
|
|
|
|
"&oldid=" . (int)($this->mAttribs['rc_last_oldid']);
|
|
|
|
|
if ( $forceCur ) {
|
|
|
|
|
$trail .= "&diff=0" ;
|
|
|
|
|
} else {
|
|
|
|
|
$trail .= "&diff=" . (int)($this->mAttribs['rc_this_oldid']);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$trail = "";
|
|
|
|
|
}
|
|
|
|
|
return $trail;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|