list( $index, $usercond ) = $this->getUserCond();
$nscond = $this->getNamespaceCond();
$use_index = $this->dbr->useIndexClause( $index );
- extract( $this->dbr->tableNames( 'revision', 'page' ) );
+ list( $revision, $page) = $this->dbr->tableNamesN( 'revision', 'page' );
$sql = "SELECT rev_timestamp " .
" FROM $page,$revision $use_index " .
" WHERE rev_page=page_id AND $usercond $nscond" .
$nscond = $this->getNamespaceCond();
$use_index = $this->dbr->useIndexClause( $index );
- extract( $this->dbr->tableNames( 'page', 'revision' ) );
+ list( $page, $revision ) = $this->dbr->tableNamesN( 'page', 'revision' );
$sql = "SELECT rev_timestamp FROM $page, $revision $use_index " .
"WHERE page_id = rev_page AND rev_timestamp > '" . $this->offset . "' AND " .
function getFirstOffsetForPaging() {
list( $index, $usercond ) = $this->getUserCond();
$use_index = $this->dbr->useIndexClause( $index );
- extract( $this->dbr->tableNames( 'page', 'revision' ) );
+ list( $page, $revision ) = $this->dbr->tableNamesN( 'page', 'revision' );
$nscond = $this->getNamespaceCond();
$sql = "SELECT rev_timestamp FROM $page, $revision $use_index " .
"WHERE page_id = rev_page AND " .
}
/* private */ function makeSql() {
- $userCond = $condition = $index = $offsetQuery = '';
+ $offsetQuery = '';
- extract( $this->dbr->tableNames( 'page', 'revision' ) );
+ list( $page, $revision ) = $this->dbr->tableNamesN( 'page', 'revision' );
list( $index, $userCond ) = $this->getUserCond();
if ( $this->offset )
*/
function wfSpecialContributions( $par = null ) {
global $wgUser, $wgOut, $wgLang, $wgRequest;
- $fname = 'wfSpecialContributions';
$target = isset( $par ) ? $par : $wgRequest->getVal( 'target' );
if ( !strlen( $target ) ) {
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'] = '';
+ /* Offset must be an integral, unless the db is using timestamps */
+ $dbr =& wfGetDB( DB_SLAVE );
+ if ( !strlen( $options['offset'] ) ||
+ ( !$dbr->realTimestamps() && !preg_match( '/^[0-9]+$/', $options['offset'] ) ) )
+ $options['offset'] = '';
- $title = Title::makeTitle( NS_SPECIAL, 'Contributions' );
+ $title = SpecialPage::getTitleFor( 'Contributions' );
$options['target'] = $target;
$nt =& Title::makeTitle( NS_USER, $nt->getDBkey() );
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' ) );
+ $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( '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() );
+ $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( '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() );
+ $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsgHtml( 'log' ), 'user=' . $nt->getPartialUrl() );
$ul .= ' (' . implode( ' | ', $tools ) . ')';
}
return $ul;
* 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, $row ) {
}
$rev = new Revision( $row );
-
+
$page = Title::makeTitle( $row->page_namespace, $row->page_title );
$link = $sk->makeKnownLinkObj( $page );
$difftext = $topmarktext = '';
}
if( $wgUser->isAllowed( 'rollback' ) ) {
- $extraRollback = $wgRequest->getBool( 'bot' ) ? '&bot=1' : '';
- $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 ) .']';
+ $topmarktext .= ' '.$sk->generateRollback( $rev );
}
}