class ContribsPager extends IndexPager {
public $mDefaultDirection = true;
var $messages, $target;
+ var $namespace = '', $mDb;
function __construct( $target, $namespace = false ) {
- global $wgUser;
-
parent::__construct();
foreach( explode( ' ', 'uctop diff newarticle rollbacklink diff hist minoreditletter' ) as $msg ) {
$this->messages[$msg] = wfMsgExt( $msg, array( 'escape') );
}
$this->target = $target;
$this->namespace = $namespace;
+ $this->mDb = wfGetDB( DB_SLAVE, 'contributions' );
}
function getDefaultQuery() {
if ( $this->target == 'newbies' ) {
$max = $this->mDb->selectField( 'user', 'max(user_id)', false, __METHOD__ );
- $condition[] = 'rev_user >' . (int)($max - $max / 2/*100*/);
+ $condition[] = 'rev_user >' . (int)($max - $max / 100);
$index = 'user_timestamp';
} else {
$condition['rev_user_text'] = $this->target;
}
function getNamespaceCond() {
- if ( $this->namespace !== false ) {
+ if ( $this->namespace !== '' ) {
return array( 'page_namespace' => (int)$this->namespace );
} else {
return array();
wfProfileOut( __METHOD__ );
return $ret;
}
+
+ /**
+ * Get the Database object in use
+ *
+ * @return Database
+ */
+ public function getDatabase() {
+ return $this->mDb;
+ }
+
}
/**
$wgOut->addWikiText( wfMsg( 'nocontribs' ) );
return;
}
+
+ # Show a message about slave lag, if applicable
+ if( ( $lag = $pager->getDatabase()->getLag() ) > 0 )
+ $wgOut->showLagWarning( $lag );
+
$wgOut->addHTML(
'<p>' . $pager->getNavigationBar() . '</p>' .
$pager->getBody() .
$talk = $nt->getTalkPage();
if( $talk ) {
# Talk page link
- $tools[] = $sk->makeLinkObj( $talk, $wgLang->getNsText( NS_TALK ) );
+ $tools[] = $sk->makeLinkObj( $talk, wfMsgHtml( 'talkpagelinktext' ) );
if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && User::isIP( $nt->getText() ) ) ) {
# Block link
if( $wgUser->isAllowed( 'block' ) )