return 'img_timestamp';
}
- function getStartBody() {
- # Do a link batch query for user pages
- if ( $this->mResult->numRows() ) {
- $lb = new LinkBatch;
- $this->mResult->seek( 0 );
- foreach ( $this->mResult as $row ) {
- if ( $row->img_user ) {
- $lb->add( NS_USER, str_replace( ' ', '_', $row->img_user_text ) );
- }
- }
- $lb->execute();
+ function doBatchLookups() {
+ $userIds = array();
+ $this->mResult->seek( 0 );
+ foreach ( $this->mResult as $row ) {
+ $userIds[] = $row->img_user;
}
-
- return parent::getStartBody();
+ # Do a link batch query for names and userpages
+ UserCache::singleton()->doQuery( $userIds, array( 'userpage' ), __METHOD__ );
}
function formatValue( $field, $value ) {
}
case 'img_user_text':
if ( $this->mCurrentRow->img_user ) {
+ $name = User::whoIs( $this->mCurrentRow->img_user );
$link = Linker::link(
- Title::makeTitle( NS_USER, $value ),
- htmlspecialchars( $value )
+ Title::makeTitle( NS_USER, $name ),
+ htmlspecialchars( $name )
);
} else {
$link = htmlspecialchars( $value );