Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2259
imageGalleryUser.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 8:47 PM
2014-11-21 20:47:48 (UTC+0)
Size
4 KB
Referenced Files
None
Subscribers
None
imageGalleryUser.patch
View Options
Index: includes/specials/SpecialListfiles.php
===================================================================
--- includes/specials/SpecialListfiles.php (revision 63755)
+++ includes/specials/SpecialListfiles.php (working copy)
@@ -41,7 +41,11 @@
strtolower( $nt->getDBkey() ), $dbr->anyString() ) );
}
}
-
+ $user = $wgRequest->getText( 'user', '' );
+ $user = Title::makeTitleSafe( NS_USER, $user );
+ if ( $user ) {
+ $this->mQueryConds['img_user_text'] = $user->getText();
+ }
parent::__construct();
}
@@ -158,11 +162,14 @@
function getForm() {
global $wgRequest, $wgScript, $wgMiserMode;
$search = $wgRequest->getText( 'ilsearch' );
+ $user = $wgRequest->getText( 'user' );
$s = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' ) ) .
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', null, wfMsg( 'listfiles' ) ) .
- Xml::tags( 'label', null, wfMsgHtml( 'table_pager_limit', $this->getLimitSelect() ) );
+ Xml::tags( 'label', null, wfMsgHtml( 'table_pager_limit', $this->getLimitSelect() ) ) .
+ Xml::element( 'br' ) .
+ Xml::inputLabel( wfMsg( 'listfiles_search_user' ), 'user', 'mw-iluser', 20, $user );
if ( !$wgMiserMode ) {
$s .= "<br />\n" .
@@ -170,7 +177,7 @@
}
$s .= ' ' .
Xml::submitButton( wfMsg( 'table_pager_limit_submit' ) ) ."\n" .
- $this->getHiddenFields( array( 'limit', 'ilsearch' ) ) .
+ $this->getHiddenFields( array( 'limit', 'ilsearch', 'user' ) ) .
Xml::closeElement( 'fieldset' ) .
Xml::closeElement( 'form' ) . "\n";
return $s;
Index: includes/specials/SpecialNewimages.php
===================================================================
--- includes/specials/SpecialNewimages.php (revision 63755)
+++ includes/specials/SpecialNewimages.php (working copy)
@@ -13,7 +13,18 @@
$sk = $wgUser->getSkin();
$shownav = !$specialPage->including();
$hidebots = $wgRequest->getBool( 'hidebots' , 1 );
+ $user = $wgRequest->getText( 'user', '' );
+ $usersql = '';
+ if ( $user !== '' ) {
+ $user = Title::makeTitleSafe( NS_USER, $user );
+ if ( $user != null ) {
+ $user = $user->getText();
+ $usersql = ' img_user_text = ' . $dbr->addQuotes( $user );
+ # using img_user_text instead of img_user, as that has index
+ }
+ }
+
$hidebotsql = '';
if ( $hidebots ) {
# Make a list of group names which have the 'bot' flag set.
@@ -74,6 +85,11 @@
}
}
+ if ( $user ) {
+ $where[] = $usersql;
+ $searchpar['user'] = $user;
+ }
+
$invertSort = false;
if( $until = $wgRequest->getVal( 'until' ) ) {
$where[] = "img_timestamp < '" . $dbr->timestamp( $until ) . "'";
@@ -138,11 +154,18 @@
$titleObj = SpecialPage::getTitleFor( 'Newimages' );
$action = $titleObj->getLocalURL( $hidebots ? '' : 'hidebots=0' );
- if ( $shownav && !$wgMiserMode ) {
+ if ( $shownav ) {
$wgOut->addHTML(
Xml::openElement( 'form', array( 'action' => $action, 'method' => 'post', 'id' => 'imagesearch' ) ) .
Xml::fieldset( wfMsg( 'newimages-legend' ) ) .
- Xml::inputLabel( wfMsg( 'newimages-label' ), 'wpIlMatch', 'wpIlMatch', 20, $wpIlMatch ) . ' ' .
+ Xml::inputLabel( wfMsg( 'newimages-user' ), 'user', 'mw-niuser', 20, $user ) . ' '
+ );
+ if ( !$wgMiserMode ) {
+ $wgOut->addHTML(
+ Xml::inputLabel( wfMsg( 'newimages-label' ), 'wpIlMatch', 'wpIlMatch', 20, $wpIlMatch ) . ' '
+ );
+ }
+ $wgOut->addHTML(
Xml::submitButton( wfMsg( 'ilsubmit' ), array( 'name' => 'wpIlSubmit' ) ) .
Xml::closeElement( 'fieldset' ) .
Xml::closeElement( 'form' )
Index: languages/messages/MessagesEn.php
===================================================================
--- languages/messages/MessagesEn.php (revision 63755)
+++ languages/messages/MessagesEn.php (working copy)
@@ -2189,6 +2189,7 @@
By default the last uploaded files are shown at top of the list.
A click on a column header changes the sorting.',
'listfiles_search_for' => 'Search for media name:',
+'listfiles_search_user' => 'Username:',
'imgfile' => 'file',
'listfiles' => 'File list',
'listfiles_date' => 'Date',
@@ -3483,6 +3484,7 @@
'newimages-summary' => 'This special page shows the last uploaded files.',
'newimages-legend' => 'Filter',
'newimages-label' => 'Filename (or a part of it):',
+'newimages-user' => 'Username:',
'showhidebots' => '($1 bots)',
'noimages' => 'Nothing to see.',
'ilsubmit' => 'Search',
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1835
Default Alt Text
imageGalleryUser.patch (4 KB)
Attached To
Mode
T5341: gallery of images uploaded by a user
Attached
Detach File
Event Timeline
Log In to Comment