if( $row->rev_minor_edit ) {
$s .= ' ' . wfElement( 'span', array( 'class' => 'minor' ), wfMsg( 'minoreditletter') );
}
+
+ if (!is_null($size = $rev->getSize())) {
+ if ($size == 0)
+ $stxt = wfMsgHtml('historyempty');
+ else
+ $stxt = wfMsgHtml('historysize', $size);
+ $s .= " <span class=\"history-size\">$stxt</span>";
+ }
+
#getComment is safe, but this is better formatted
if( $rev->isDeleted( Revision::DELETED_COMMENT ) ) {
$s .= " <span class=\"history-deleted\"><span class=\"comment\">" .
$res = $dbr->select(
'revision',
array('rev_id', 'rev_page', 'rev_text_id', 'rev_user', 'rev_comment', 'rev_user_text',
- 'rev_timestamp', 'rev_minor_edit', 'rev_deleted'),
+ 'rev_timestamp', 'rev_minor_edit', 'rev_deleted', 'rev_len'),
array_merge(array("rev_page=$page_id"), $offsets),
$fname,
array('ORDER BY' => "rev_timestamp $dirs",
return array(
'tables' => 'revision',
'fields' => array('rev_id', 'rev_page', 'rev_text_id', 'rev_user', 'rev_comment', 'rev_user_text',
- 'rev_timestamp', 'rev_minor_edit', 'rev_deleted'),
+ 'rev_timestamp', 'rev_minor_edit', 'rev_deleted', 'rev_len'),
'conds' => array('rev_page' => $this->mPageHistory->mTitle->getArticleID() ),
'options' => array( 'USE INDEX' => 'page_timestamp' )
);
'rev_user',
'rev_minor_edit',
'rev_timestamp',
- 'rev_deleted' ),
+ 'rev_deleted',
+ 'rev_len' ),
$conditions,
'Revision::fetchRow',
array( 'LIMIT' => 1 ) );
$this->mTimestamp = $row->rev_timestamp;
$this->mDeleted = intval( $row->rev_deleted );
+ if (is_null($row->rev_len))
+ $this->mSize = null;
+ else
+ $this->mSize = intval( $row->rev_len );
+
if( isset( $row->page_latest ) ) {
$this->mCurrent = ( $row->rev_id == $row->page_latest );
$this->mTitle = Title::makeTitle( $row->page_namespace,
$this->mTitle = null; # Load on demand if needed
$this->mCurrent = false;
+
+ $this->mSize = is_null($this->mText) ? null : strlen($this->mText);
} else {
throw new MWException( 'Revision constructor passed invalid row format.' );
}
return $this->mTextId;
}
+ /**
+ * Returns the length of the text in this revision, or null if unknown.
+ */
+ function getSize() {
+ return $this->mSize;
+ }
+
/**
* Returns the title of the page associated with this entry.
* @return Title
</div>',
#'rev-delundel' => 'del/undel',
'rev-delundel' => 'show/hide',
-
+'historysize' => '($1 bytes)',
+'historyempty' => '(empty)',
'history-feed-title' => 'Revision history',
'history-feed-description' => 'Revision history for this page on the wiki',