From 289aa01f505af30bde90d34d06ea3214d933a4af Mon Sep 17 00:00:00 2001 From: Magnus Manske Date: Fri, 30 Dec 2005 20:31:57 +0000 Subject: [PATCH] SpecialNewimages can now be called with user=X to limit display to a single user --- includes/SpecialNewimages.php | 19 +++++++++++++++++++ languages/Language.php | 1 + 2 files changed, 20 insertions(+) diff --git a/includes/SpecialNewimages.php b/includes/SpecialNewimages.php index 98c6c36059..4123a16d64 100644 --- a/includes/SpecialNewimages.php +++ b/includes/SpecialNewimages.php @@ -20,6 +20,7 @@ function wfSpecialNewimages( $par, $specialPage ) { $sk = $wgUser->getSkin(); $shownav = !$specialPage->including(); $hidebots = $wgRequest->getBool('hidebots',1); + $singleUser = $wgRequest->getInt('user',0); # Limit images to a single user? if($hidebots) { @@ -47,9 +48,12 @@ function wfSpecialNewimages( $par, $specialPage ) { $image = $dbr->tableName('image'); $sql="SELECT img_timestamp from $image"; + + # Hide bots? if($hidebots) { $sql.=$joinsql.' WHERE ug_group IS NULL'; } + $sql.=' ORDER BY img_timestamp DESC LIMIT 1'; $res = $dbr->query($sql, 'wfSpecialNewImages'); $row = $dbr->fetchRow($res); @@ -84,6 +88,12 @@ function wfSpecialNewimages( $par, $specialPage ) { } } + # Single user only? + if ( $singleUser > 0 ) { + $where[] .= "img_user='{$singleUser}'" ; + } + + $invertSort = false; if( $until = $wgRequest->getVal( 'until' ) ) { $where[] = 'img_timestamp < ' . $dbr->timestamp( $until ); @@ -153,6 +163,15 @@ function wfSpecialNewimages( $par, $specialPage ) { $wgOut->addHTML( "

{$text}\n

" ); } + if ( $singleUser > 0 ) { + $u = new User ; + $u->setID ( $singleUser ) ; + $u->loadFromDatabase () ; + $t = $u->getUserPage() ; + $uPage = $sk->makeLinkObj( $t ) ; + $wgOut->addHTML ( wfMsgForContent ( 'imagelistforuser' , $uPage ) ) ; + } + $sub = wfMsg( 'ilsubmit' ); $titleObj = Title::makeTitle( NS_SPECIAL, 'Newimages' ); $action = $titleObj->escapeLocalURL(); diff --git a/languages/Language.php b/languages/Language.php index aa7b556b9e..9b5f86ee22 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1070,6 +1070,7 @@ created and by whom, and anything else you may know about it. If this is an imag # 'imagelist' => 'File list', 'imagelisttext' => "Below is a list of $1 files sorted $2.", +'imagelistforuser' => "This shows only images uploaded by $1.", 'getimagelist' => 'fetching file list', 'ilsubmit' => 'Search', 'showlast' => "Show last $1 files sorted $2.", -- 2.20.1