<?php
/**
- *
* @package MediaWiki
* @subpackage SpecialPage
*/
+/** @package MediaWiki */
+class ContribsFinder {
+ var $username, $offset, $limit, $namespace;
+ var $dbr;
+
+ function ContribsFinder( $username ) {
+ $this->username = $username;
+ $this->namespace = false;
+ $this->dbr =& wfGetDB( DB_SLAVE );
+ }
+
+ function setNamespace( $ns ) {
+ $this->namespace = $ns;
+ }
+
+ function setLimit( $limit ) {
+ $this->limit = $limit;
+ }
+
+ function setOffset( $offset ) {
+ $this->offset = $offset;
+ }
+
+ function getEditLimit( $dir ) {
+ list( $index, $usercond ) = $this->getUserCond();
+ $nscond = $this->getNamespaceCond();
+ $use_index = $this->dbr->useIndexClause( $index );
+ extract( $this->dbr->tableNames( 'revision', 'page' ) );
+ $sql = "SELECT rev_timestamp " .
+ " FROM $page,$revision $use_index " .
+ " WHERE rev_page=page_id AND $usercond $nscond" .
+ " ORDER BY rev_timestamp $dir LIMIT 1";
+
+ $res = $this->dbr->query( $sql, __METHOD__ );
+ $row = $this->dbr->fetchObject( $res );
+ if ( $row ) {
+ return $row->rev_timestamp;
+ } else {
+ return false;
+ }
+ }
+
+ function getEditLimits() {
+ return array(
+ $this->getEditLimit( "ASC" ),
+ $this->getEditLimit( "DESC" )
+ );
+ }
+
+ function getUserCond() {
+ $condition = '';
+
+ if ( $this->username == 'newbies' ) {
+ $max = $this->dbr->selectField( 'user', 'max(user_id)', false, 'make_sql' );
+ $condition = '>' . (int)($max - $max / 100);
+ }
+
+ if ( $condition == '' ) {
+ $condition = ' rev_user_text=' . $this->dbr->addQuotes( $this->username );
+ $index = 'usertext_timestamp';
+ } else {
+ $condition = ' rev_user '.$condition ;
+ $index = 'user_timestamp';
+ }
+ return array( $index, $condition );
+ }
+
+ function getNamespaceCond() {
+ if ( $this->namespace !== false )
+ return ' AND page_namespace = ' . (int)$this->namespace;
+ return '';
+ }
+
+ function getPreviousOffsetForPaging() {
+ list( $index, $usercond ) = $this->getUserCond();
+ $nscond = $this->getNamespaceCond();
+
+ $use_index = $this->dbr->useIndexClause( $index );
+ extract( $this->dbr->tableNames( 'page', 'revision' ) );
+
+ $sql = "SELECT rev_timestamp FROM $page, $revision $use_index " .
+ "WHERE page_id = rev_page AND rev_timestamp > '" . $this->offset . "' AND " .
+ $usercond . $nscond;
+ $sql .= " ORDER BY rev_timestamp ASC";
+ $sql = $this->dbr->limitResult( $sql, $this->limit, 0 );
+ $res = $this->dbr->query( $sql );
+
+ $numRows = $this->dbr->numRows( $res );
+ if ( $numRows ) {
+ $this->dbr->dataSeek( $res, $numRows - 1 );
+ $row = $this->dbr->fetchObject( $res );
+ $offset = $row->rev_timestamp;
+ } else {
+ $offset = false;
+ }
+ $this->dbr->freeResult( $res );
+ return $offset;
+ }
+
+ function getFirstOffsetForPaging() {
+ list( $index, $usercond ) = $this->getUserCond();
+ $use_index = $this->dbr->useIndexClause( $index );
+ extract( $this->dbr->tableNames( 'page', 'revision' ) );
+ $nscond = $this->getNamespaceCond();
+ $sql = "SELECT rev_timestamp FROM $page, $revision $use_index " .
+ "WHERE page_id = rev_page AND " .
+ $usercond . $nscond;
+ $sql .= " ORDER BY rev_timestamp ASC";
+ $sql = $this->dbr->limitResult( $sql, $this->limit, 0 );
+ $res = $this->dbr->query( $sql );
+
+ $numRows = $this->dbr->numRows( $res );
+ if ( $numRows ) {
+ $this->dbr->dataSeek( $res, $numRows - 1 );
+ $row = $this->dbr->fetchObject( $res );
+ $offset = $row->rev_timestamp;
+ } else {
+ $offset = false;
+ }
+ $this->dbr->freeResult( $res );
+ return $offset;
+ }
+
+ /* private */ function makeSql() {
+ $userCond = $condition = $index = $offsetQuery = '';
+
+ extract( $this->dbr->tableNames( 'page', 'revision' ) );
+ list( $index, $userCond ) = $this->getUserCond();
+
+ if ( $this->offset )
+ $offsetQuery = "AND rev_timestamp <= '{$this->offset}'";
+
+ $nscond = $this->getNamespaceCond();
+ $use_index = $this->dbr->useIndexClause( $index );
+ $sql = "SELECT
+ page_namespace,page_title,page_is_new,page_latest,
+ rev_id,rev_page,rev_text_id,rev_timestamp,rev_comment,rev_minor_edit,rev_user,rev_user_text,
+ rev_deleted
+ FROM $page,$revision $use_index
+ WHERE page_id=rev_page AND $userCond $nscond $offsetQuery
+ ORDER BY rev_timestamp DESC";
+ $sql = $this->dbr->limitResult( $sql, $this->limit, 0 );
+ return $sql;
+ }
+
+ function find() {
+ $contribs = array();
+ $res = $this->dbr->query( $this->makeSql(), __METHOD__ );
+ while ( $c = $this->dbr->fetchObject( $res ) )
+ $contribs[] = $c;
+ $this->dbr->freeResult( $res );
+ return $contribs;
+ }
+};
+
/**
* Special page "user contributions".
* Shows a list of the contributions of a user.
*
* @return none
- * @param string $par (optional) user name of the user for which to show the contributions
+ * @param $par String: (optional) user name of the user for which to show the contributions
*/
-function wfSpecialContributions( $par = '' ) {
- global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest;
+function wfSpecialContributions( $par = null ) {
+ global $wgUser, $wgOut, $wgLang, $wgRequest;
$fname = 'wfSpecialContributions';
- if( $par )
- $target = $par;
- else
- $target = $wgRequest->getVal( 'target' );
-
- if ( '' == $target ) {
- $wgOut->errorpage( 'notargettitle', 'notargettext' );
+ $target = isset( $par ) ? $par : $wgRequest->getVal( 'target' );
+ if ( !strlen( $target ) ) {
+ $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
return;
}
- # FIXME: Change from numeric offsets to date offsets
- list( $limit, $offset ) = wfCheckLimits( 50, '' );
- $offlimit = $limit + $offset;
- $querylimit = $offlimit + 1;
- $hideminor = ($wgRequest->getVal( 'hideminor' ) ? 1 : 0);
- $sk = $wgUser->getSkin();
- $dbr =& wfGetDB( DB_SLAVE );
- $userCond = "";
-
$nt = Title::newFromURL( $target );
if ( !$nt ) {
- $wgOut->errorpage( 'notargettitle', 'notargettext' );
+ $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
return;
}
- $nt->setNamespace( Namespace::getUser() );
- $id = User::idFromName( $nt->getText() );
+ $options = array();
- if ( 0 == $id ) {
- $ul = $nt->getText();
+ list( $options['limit'], $options['offset']) = wfCheckLimits();
+ $options['offset'] = $wgRequest->getVal( 'offset' );
+ /* Offset must be an integral. */
+ if ( !strlen( $options['offset'] ) || !preg_match( '/^[0-9]+$/', $options['offset'] ) )
+ $options['offset'] = '';
+
+ $title = Title::makeTitle( NS_SPECIAL, 'Contributions' );
+ $options['target'] = $target;
+
+ $nt =& Title::makeTitle( NS_USER, $nt->getDBkey() );
+ $finder = new ContribsFinder( ( $target == 'newbies' ) ? 'newbies' : $nt->getText() );
+ $finder->setLimit( $options['limit'] );
+ $finder->setOffset( $options['offset'] );
+
+ if ( ( $ns = $wgRequest->getVal( 'namespace', null ) ) !== null && $ns !== '' ) {
+ $options['namespace'] = intval( $ns );
+ $finder->setNamespace( $options['namespace'] );
} else {
- $ul = $sk->makeLinkObj( $nt, htmlspecialchars( $nt->getText() ) );
- $userCond = '=' . $id;
+ $options['namespace'] = '';
}
- $talk = $nt->getTalkPage();
- if( $talk ) {
- $ul .= ' (' . $sk->makeLinkObj( $talk, $wgLang->getNsText(Namespace::getTalk(0)) ) . ')';
+
+ if ( $wgUser->isAllowed( 'rollback' ) && $wgRequest->getBool( 'bot' ) ) {
+ $options['bot'] = '1';
}
+ if ( $wgRequest->getText( 'go' ) == 'prev' ) {
+ $offset = $finder->getPreviousOffsetForPaging();
+ if ( $offset !== false ) {
+ $options['offset'] = $offset;
+ $prevurl = $title->getLocalURL( wfArrayToCGI( $options ) );
+ $wgOut->redirect( $prevurl );
+ return;
+ }
+ }
+
+ if ( $wgRequest->getText( 'go' ) == 'first' && $target != 'newbies') {
+ $offset = $finder->getFirstOffsetForPaging();
+ if ( $offset !== false ) {
+ $options['offset'] = $offset;
+ $prevurl = $title->getLocalURL( wfArrayToCGI( $options ) );
+ $wgOut->redirect( $prevurl );
+ return;
+ }
+ }
if ( $target == 'newbies' ) {
- # View the contributions of all recently created accounts
- $max = $dbr->selectField( 'user', 'max(user_id)', false, $fname );
- $userCond = '>' . ($max - $max / 100);
- $ul = wfMsg ( 'newbies' );
- $id = 0;
+ $wgOut->setSubtitle( wfMsgHtml( 'sp-contributions-newbies-sub') );
+ } else {
+ $wgOut->setSubtitle( wfMsgHtml( 'contribsub', contributionsSub( $nt ) ) );
}
- $wgOut->setSubtitle( wfMsg( 'contribsub', $ul ) );
+ $id = User::idFromName( $nt->getText() );
+ wfRunHooks( 'SpecialContributionsBeforeMainOutput', $id );
- if ( $hideminor ) {
- $cmq = 'AND cur_minor_edit=0';
- $omq = 'AND old_minor_edit=0';
- $mlink = $sk->makeKnownLink( $wgContLang->specialPage( 'Contributions' ),
- WfMsg( 'show' ), "target=" . htmlspecialchars( $nt->getPrefixedURL() ) .
- "&offset={$offset}&limit={$limit}&hideminor=0" );
- } else {
- $cmq = $omq = '';
- $mlink = $sk->makeKnownLink( $wgContLang->specialPage( "Contributions" ),
- WfMsg( 'hide' ), 'target=' . htmlspecialchars( $nt->getPrefixedURL() ) .
- "&offset={$offset}&limit={$limit}&hideminor=1" );
- }
-
- extract( $dbr->tableNames( 'old', 'cur' ) );
- if ( $userCond == '' ) {
- $sql = "SELECT cur_namespace,cur_title,cur_timestamp,cur_comment,cur_minor_edit,cur_is_new,cur_user_text FROM $cur " .
- "WHERE cur_user_text='" . $dbr->strencode( $nt->getText() ) . "' {$cmq} " .
- "ORDER BY inverse_timestamp LIMIT {$querylimit}";
- $res1 = $dbr->query( $sql, $fname );
-
- $sql = "SELECT old_namespace,old_title,old_timestamp,old_comment,old_minor_edit,old_user_text,old_id FROM $old " .
- "WHERE old_user_text='" . $dbr->strencode( $nt->getText() ) . "' {$omq} " .
- "ORDER BY inverse_timestamp LIMIT {$querylimit}";
- $res2 = $dbr->query( $sql, $fname );
- } else {
- $sql = "SELECT cur_namespace,cur_title,cur_timestamp,cur_comment,cur_minor_edit,cur_is_new,cur_user_text FROM $cur " .
- "WHERE cur_user {$userCond} {$cmq} ORDER BY inverse_timestamp LIMIT {$querylimit}";
- $res1 = $dbr->query( $sql, $fname );
+ $wgOut->addHTML( contributionsForm( $options) );
- $sql = "SELECT old_namespace,old_title,old_timestamp,old_comment,old_minor_edit,old_user_text,old_id FROM $old " .
- "WHERE old_user {$userCond} {$omq} ORDER BY inverse_timestamp LIMIT {$querylimit}";
- $res2 = $dbr->query( $sql, $fname );
- }
- $nCur = $dbr->numRows( $res1 );
- $nOld = $dbr->numRows( $res2 );
+ $contribs = $finder->find();
- $top = wfShowingResults( $offset, $limit );
- $wgOut->addHTML( "<p>{$top}\n" );
+ if ( count( $contribs ) == 0) {
+ $wgOut->addWikiText( wfMsg( 'nocontribs' ) );
+ return;
+ }
- $sl = wfViewPrevNext( $offset, $limit,
- $wgContLang->specialpage( 'Contributions' ),
- "hideminor={$hideminor}&target=" . wfUrlEncode( $target ),
- ($nCur + $nOld) <= $offlimit);
+ list( $early, $late ) = $finder->getEditLimits();
+ $lastts = count( $contribs ) ? $contribs[count( $contribs ) - 1]->rev_timestamp : 0;
+ $atstart = ( !count( $contribs ) || $late == $contribs[0]->rev_timestamp );
+ $atend = ( !count( $contribs ) || $early == $lastts );
+
+ // These four are defaults
+ $newestlink = wfMsgHtml( 'sp-contributions-newest' );
+ $oldestlink = wfMsgHtml( 'sp-contributions-oldest' );
+ $newerlink = wfMsgHtml( 'sp-contributions-newer', $options['limit'] );
+ $olderlink = wfMsgHtml( 'sp-contributions-older', $options['limit'] );
+
+ if ( !$atstart ) {
+ $stuff = $title->escapeLocalURL( wfArrayToCGI( array( 'offset' => '' ), $options ) );
+ $newestlink = "<a href=\"$stuff\">$newestlink</a>";
+ $stuff = $title->escapeLocalURL( wfArrayToCGI( array( 'go' => 'prev' ), $options ) );
+ $newerlink = "<a href=\"$stuff\">$newerlink</a>";
+ }
- $shm = wfMsg( 'showhideminor', $mlink );
- $wgOut->addHTML( "<br />{$sl} ($shm)</p>\n");
+ if ( !$atend ) {
+ $stuff = $title->escapeLocalURL( wfArrayToCGI( array( 'go' => 'first' ), $options ) );
+ $oldestlink = "<a href=\"$stuff\">$oldestlink</a>";
+ $stuff = $title->escapeLocalURL( wfArrayToCGI( array( 'offset' => $lastts ), $options ) );
+ $olderlink = "<a href=\"$stuff\">$olderlink</a>";
+ }
+ if ( $target == 'newbies' ) {
+ $firstlast ="($newestlink)";
+ } else {
+ $firstlast = "($newestlink | $oldestlink)";
+ }
- if ( 0 == $nCur && 0 == $nOld ) {
- $wgOut->addHTML( "\n<p>" . wfMsg( 'nocontribs' ) . "</p>\n" );
- return;
+ $urls = array();
+ foreach ( array( 20, 50, 100, 250, 500 ) as $num ) {
+ $stuff = $title->escapeLocalURL( wfArrayToCGI( array( 'limit' => $num ), $options ) );
+ $urls[] = "<a href=\"$stuff\">".$wgLang->formatNum( $num )."</a>";
}
- if ( 0 != $nCur ) { $obj1 = $dbr->fetchObject( $res1 ); }
- if ( 0 != $nOld ) { $obj2 = $dbr->fetchObject( $res2 ); }
+ $bits = implode( $urls, ' | ' );
+
+ $prevnextbits = $firstlast .' '. wfMsgHtml( 'viewprevnext', $newerlink, $olderlink, $bits );
+
+ $wgOut->addHTML( "<p>{$prevnextbits}</p>\n" );
$wgOut->addHTML( "<ul>\n" );
- for( $n = 0; $n < $offlimit; $n++ ) {
- if ( 0 == $nCur && 0 == $nOld ) { break; }
-
- if ( ( 0 == $nOld ) ||
- ( ( 0 != $nCur ) &&
- ( $obj1->cur_timestamp >= $obj2->old_timestamp ) ) ) {
- $ns = $obj1->cur_namespace;
- $t = $obj1->cur_title;
- $ts = $obj1->cur_timestamp;
- $comment =$obj1->cur_comment;
- $me = $obj1->cur_minor_edit;
- $isnew = $obj1->cur_is_new;
- $usertext = $obj1->cur_user_text;
-
- $obj1 = $dbr->fetchObject( $res1 );
- $topmark = true;
- $oldid = false;
- --$nCur;
- } else {
- $ns = $obj2->old_namespace;
- $t = $obj2->old_title;
- $ts = $obj2->old_timestamp;
- $comment =$obj2->old_comment;
- $me = $obj2->old_minor_edit;
- $usertext = $obj2->old_user_text;
- $oldid = $obj2->old_id;
-
- $obj2 = $dbr->fetchObject( $res2 );
- $topmark = false;
- $isnew = false;
- --$nOld;
- }
- if( $n >= $offset )
- ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, ( $me > 0), $isnew, $usertext, $oldid );
- }
+
+ $sk = $wgUser->getSkin();
+ foreach ( $contribs as $contrib )
+ $wgOut->addHTML( ucListEdit( $sk, $contrib ) );
+
$wgOut->addHTML( "</ul>\n" );
+ $wgOut->addHTML( "<p>{$prevnextbits}</p>\n" );
+}
+
+/**
+ * Generates the subheading with links
+ * @param $nt @see Title object for the target
+ */
+function contributionsSub( $nt ) {
+ global $wgSysopUserBans, $wgLang, $wgUser;
+
+ $sk = $wgUser->getSkin();
+ $id = User::idFromName( $nt->getText() );
- # Validations
- global $wgUseValidation;
- if( $wgUseValidation ) {
- require_once( 'SpecialValidate.php' );
- $val = new Validation ;
- $val = $val->countUserValidations ( $id ) ;
- $wgOut->addHTML( wfMsg ( 'val_user_validations', $val ) );
+ if ( 0 == $id ) {
+ $ul = $nt->getText();
+ } else {
+ $ul = $sk->makeLinkObj( $nt, htmlspecialchars( $nt->getText() ) );
+ }
+ $talk = $nt->getTalkPage();
+ if( $talk ) {
+ # Talk page link
+ $tools[] = $sk->makeLinkObj( $talk, $wgLang->getNsText( NS_TALK ) );
+ if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && User::isIP( $nt->getText() ) ) ) {
+ # Block link
+ if( $wgUser->isAllowed( 'block' ) )
+ $tools[] = $sk->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Blockip/' . $nt->getDBkey() ), wfMsgHtml( 'blocklink' ) );
+ # Block log link
+ $tools[] = $sk->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Log' ), htmlspecialchars( LogPage::logName( 'block' ) ), 'type=block&page=' . $nt->getPrefixedUrl() );
+ }
+ # Other logs link
+ $tools[] = $sk->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Log' ), wfMsgHtml( 'log' ), 'user=' . $nt->getPartialUrl() );
+ $ul .= ' (' . implode( ' | ', $tools ) . ')';
}
+ return $ul;
}
+/**
+ * Generates the namespace selector form with hidden attributes.
+ * @param $options Array: the options to be included.
+ */
+function contributionsForm( $options ) {
+ global $wgScript, $wgTitle;
+
+ $options['title'] = $wgTitle->getPrefixedText();
+
+ $f = "<form method='get' action=\"$wgScript\">\n";
+ foreach ( $options as $name => $value ) {
+ if( $name === 'namespace') continue;
+ $f .= "\t" . wfElement( 'input', array(
+ 'name' => $name,
+ 'type' => 'hidden',
+ 'value' => $value ) ) . "\n";
+ }
+
+ $f .= '<p>' . wfMsgHtml( 'namespace' ) . ' ' .
+ HTMLnamespaceselector( $options['namespace'], '' ) .
+ wfElement( 'input', array(
+ 'type' => 'submit',
+ 'value' => wfMsg( 'allpagessubmit' ) )
+ ) .
+ "</p></form>\n";
+
+ return $f;
+}
/**
* Generates each row in the contributions list.
* For these contributions, a [rollback] link is shown for users with sysop
* privileges. The rollback link restores the most recent version that was not
* written by the target user.
- *
+ *
* If the contributions page is called with the parameter &bot=1, all rollback
* links also get that parameter. It causes the edit itself and the rollback
* to be marked as "bot" edits. Bot edits are hidden by default from recent
* changes, so this allows sysops to combat a busy vandal without bothering
* other users.
- *
+ *
* @todo This would probably look a lot nicer in a table.
*/
-function ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, $isminor, $isnew, $target, $oldid ) {
- global $wgLang, $wgOut, $wgUser, $wgRequest;
- $page = Title::makeName( $ns, $t );
- $link = $sk->makeKnownLink( $page, '' );
+function ucListEdit( $sk, $row ) {
+ $fname = 'ucListEdit';
+ wfProfileIn( $fname );
+
+ global $wgLang, $wgUser, $wgRequest;
+ static $messages;
+ if( !isset( $messages ) ) {
+ foreach( explode( ' ', 'uctop diff newarticle rollbacklink diff hist minoreditletter' ) as $msg ) {
+ $messages[$msg] = wfMsgExt( $msg, array( 'escape') );
+ }
+ }
+
+ $rev = new Revision( $row );
+
+ $page = Title::makeTitle( $row->page_namespace, $row->page_title );
+ $link = $sk->makeKnownLinkObj( $page );
$difftext = $topmarktext = '';
- if($topmark) {
- $topmarktext .= '<strong>' . wfMsg('uctop') . '</strong>';
- if(!$isnew) {
- $difftext .= $sk->makeKnownLink( $page, '(' . wfMsg('diff') . ')', 'diff=0' );
+ if( $row->rev_id == $row->page_latest ) {
+ $topmarktext .= '<strong>' . $messages['uctop'] . '</strong>';
+ if( !$row->page_is_new ) {
+ $difftext .= '(' . $sk->makeKnownLinkObj( $page, $messages['diff'], 'diff=0' ) . ')';
} else {
- $difftext .= wfMsg('newarticle');
+ $difftext .= $messages['newarticle'];
}
-
- if( $wgUser->isAllowed('rollback') ) {
+
+ if( $wgUser->isAllowed( 'rollback' ) ) {
$extraRollback = $wgRequest->getBool( 'bot' ) ? '&bot=1' : '';
- # $target = $wgRequest->getText( 'target' );
- $topmarktext .= ' ['. $sk->makeKnownLink( $page,
- wfMsg( 'rollbacklink' ),
- 'action=rollback&from=' . urlencode( $target ) . $extraRollback ) .']';
+ $extraRollback .= '&token=' . urlencode(
+ $wgUser->editToken( array( $page->getPrefixedText(), $row->rev_user_text ) ) );
+ $topmarktext .= ' ['. $sk->makeKnownLinkObj( $page,
+ $messages['rollbacklink'],
+ 'action=rollback&from=' . urlencode( $row->rev_user_text ) . $extraRollback ) .']';
}
}
- if ( $oldid ) {
- $difftext= $sk->makeKnownLink( $page, '('.wfMsg('diff').')', 'diff=prev&oldid='.$oldid );
- }
- $histlink='('.$sk->makeKnownLink($page,wfMsg('hist'),'action=history').')';
-
- if($comment) {
-
- $comment='<em>('. $sk->formatComment($comment, Title::newFromText($t) ) .')</em> ';
+ if( $rev->userCan( Revision::DELETED_TEXT ) ) {
+ $difftext = '(' . $sk->makeKnownLinkObj( $page, $messages['diff'], 'diff=prev&oldid='.$row->rev_id ) . ')';
+ } else {
+ $difftext = '(' . $messages['diff'] . ')';
+ }
+ $histlink='('.$sk->makeKnownLinkObj( $page, $messages['hist'], 'action=history' ) . ')';
+ $comment = $sk->revComment( $rev );
+ $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
+
+ if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
+ $d = '<span class="history-deleted">' . $d . '</span>';
}
- $d = $wgLang->timeanddate( $ts, true );
- if ($isminor) {
- $mflag = '<span class="minor">'.wfMsg( 'minoreditletter' ).'</span> ';
+ if( $row->rev_minor_edit ) {
+ $mflag = '<span class="minor">' . $messages['minoreditletter'] . '</span> ';
} else {
$mflag = '';
}
- $wgOut->addHTML( "<li>{$d} {$histlink} {$difftext} {$mflag} {$link} {$comment} {$topmarktext}</li>\n" );
-}
-
-/**
- *
- */
-function ucCountLink( $lim, $d ) {
- global $wgUser, $wgContLang, $wgRequest;
-
- $target = $wgRequest->getText( 'target' );
- $sk = $wgUser->getSkin();
- $s = $sk->makeKnownLink( $wgContLang->specialPage( "Contributions" ),
- "{$lim}", "target={$target}&days={$d}&limit={$lim}" );
- return $s;
+ $ret = "{$d} {$histlink} {$difftext} {$mflag} {$link} {$comment} {$topmarktext}";
+ if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
+ $ret .= ' ' . wfMsgHtml( 'deletedrev' );
+ }
+ $ret = "<li>$ret</li>\n";
+ wfProfileOut( $fname );
+ return $ret;
}
-/**
- *
- */
-function ucDaysLink( $lim, $d ) {
- global $wgUser, $wgContLang, $wgRequest;
-
- $target = $wgRequest->getText( 'target' );
- $sk = $wgUser->getSkin();
- $s = $sk->makeKnownLink( $wgContLang->specialPage( 'Contributions' ),
- "{$d}", "target={$target}&days={$d}&limit={$lim}" );
- return $s;
-}
?>