$opts->add( 'like', '' );
$opts->add( 'user', '' );
$opts->add( 'showbots', false );
+ $opts->add( 'newbies', false );
$opts->add( 'hidepatrolled', false );
$opts->add( 'limit', 50 );
$opts->add( 'offset', '' );
'name' => 'user',
],
+ 'newbies' => [
+ 'type' => 'check',
+ 'label-message' => 'newimages-newbies',
+ 'name' => 'newbies',
+ ],
+
'showbots' => [
'type' => 'check',
'label-message' => 'newimages-showbots',
}
}
+ 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' );
"newimages-legend": "Filter",
"newimages-label": "Filename (or a part of it):",
"newimages-user": "IP address or username",
+ "newimages-newbies": "Show contributions of new accounts only",
"newimages-showbots": "Show uploads by bots",
"newimages-hidepatrolled": "Hide patrolled uploads",
"noimages": "Nothing to see.",
"newimages-legend": "Caption of the fieldset for the filter on [[Special:NewImages]]\n\n{{Identical|Filter}}",
"newimages-label": "Caption of the filter editbox on [[Special:NewImages]]",
"newimages-user": "Caption of the username/IP address editbox on [[Special:NewImages]]",
+ "newimages-newbies": "Used as label for a checkbox. When checked, [[Special:NewImages]] will only display uploads by new users.",
"newimages-showbots": "Used as label for a checkbox. When checked, [[Special:NewImages]] will also display uploads by users in the bots group.",
"newimages-hidepatrolled": "Used as label for a checkbox. When checked, [[Special:NewImages]] will not display patrolled uploads.\n\nCf. {{msg-mw|tog-hidepatrolled}} and {{msg-mw|apihelp-feedrecentchanges-param-hidepatrolled}}.",
"noimages": "This is shown on the special page [[Special:NewImages]], when there aren't any recently uploaded files.",