62 $conds = $jconds = [];
64 $fields = [
'img_name',
'img_user',
'img_timestamp' ];
69 $userId = User::idFromName( $user );
71 $conds[
'img_user'] = $userId;
73 $conds[
'img_user_text'] =
$user;
80 $max =
$dbr->selectField(
'user',
'max(user_id)',
false, __METHOD__ );
81 $conds[] =
'img_user >' . (int)( $max - $max / 100 );
87 $conds[] =
'img_timestamp > ' .
92 $groupsWithBotPermission = User::getGroupsWithPermission(
'bot' );
94 if ( count( $groupsWithBotPermission ) ) {
97 $conds[] =
'ug_group IS NULL';
98 $jconds[
'user_groups'] = [
101 'ug_group' => $groupsWithBotPermission,
102 'ug_user = img_user',
103 'ug_expiry IS NULL OR ug_expiry >= ' .
$dbr->addQuotes(
$dbr->timestamp() )
111 $conds[
'rc_type'] =
RC_LOG;
112 $conds[
'rc_log_type'] =
'upload';
113 $conds[
'rc_patrolled'] = 0;
114 $conds[
'rc_namespace'] =
NS_FILE;
115 $jconds[
'recentchanges'] = [
118 'rc_title = img_name',
119 'rc_user = img_user',
120 'rc_timestamp = img_timestamp'
134 if ( !$this->
getConfig()->
get(
'MiserMode' ) && $likeVal !==
'' ) {
136 $likeObj = Title::newFromText( $likeVal );
137 if ( $likeObj instanceof
Title ) {
138 $like =
$dbr->buildLike(
140 strtolower( $likeObj->getDBkey() ),
143 $conds[] =
"LOWER(img_name) $like";
150 'join_conds' => $jconds,
159 return 'img_timestamp';
163 if ( !$this->gallery ) {
165 $mode = $this->
getRequest()->getVal(
'gallerymode',
null );
168 }
catch ( Exception
$e ) {
178 return $this->gallery->toHTML();
182 $name = $row->img_name;
183 $user = User::newFromId( $row->img_user );
185 $title = Title::makeTitle(
NS_FILE, $name );
186 $ul = MediaWikiServices::getInstance()->getLinkRenderer()->makeLink(
187 $user->getUserPage(),
190 $time = $this->
getLanguage()->userTimeAndDate( $row->img_timestamp, $this->getUser() );
195 . htmlspecialchars(
$time )
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
getRequest()
Get the WebRequest object.
getConfig()
Get the Config object.
getLanguage()
Get the Language object.
static factory( $mode=false, IContextSource $context=null)
Get a new image gallery.
Represents a title within MediaWiki.
see documentation in includes Linker php for Linker::makeImageLink & $time
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
returning false will NOT prevent logging $e
Interface for objects which can provide a MediaWiki context on request.