X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2Fpagers%2FNewFilesPager.php;h=001c296d4368552ab1c94a707f5f5231d11e47b4;hb=36395150104588f2afea866c330b683e4329fa48;hp=cce03231985a3258e5ce93d15a546708359fe456;hpb=fb742a3a8eb951c91544e70fe09b63b1bac6aec5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/pagers/NewFilesPager.php b/includes/specials/pagers/NewFilesPager.php index cce0323198..001c296d43 100644 --- a/includes/specials/pagers/NewFilesPager.php +++ b/includes/specials/pagers/NewFilesPager.php @@ -74,6 +74,20 @@ class NewFilesPager extends RangeChronologicalPager { } } + if ( $opts->getValue( 'newbies' ) ) { + // newbie = most recent 1% of users + $dbr = wfGetDB( DB_REPLICA ); + $max = $dbr->selectField( 'user', 'max(user_id)', false, __METHOD__ ); + $conds[] = 'img_user >' . (int)( $max - $max / 100 ); + + // there's no point in looking for new user activity in a far past; + // beyond a certain point, we'd just end up scanning the rest of the + // table even though the users we're looking for didn't yet exist... + // see T140537, (for ContribsPages, but similar to this) + $conds[] = 'img_timestamp > ' . + $dbr->addQuotes( $dbr->timestamp( wfTimestamp() - 30 * 24 * 60 * 60 ) ); + } + if ( !$opts->getValue( 'showbots' ) ) { $groupsWithBotPermission = User::getGroupsWithPermission( 'bot' ); @@ -112,6 +126,10 @@ class NewFilesPager extends RangeChronologicalPager { $options[] = 'STRAIGHT_JOIN'; } + if ( $opts->getValue( 'mediatype' ) ) { + $conds['img_media_type'] = $opts->getValue( 'mediatype' ); + } + $likeVal = $opts->getValue( 'like' ); if ( !$this->getConfig()->get( 'MiserMode' ) && $likeVal !== '' ) { $dbr = wfGetDB( DB_REPLICA );