- $search = $wgRequest->getText( 'ilsearch' );
- if ( $search != '' && !$wgMiserMode ) {
- $nt = Title::newFromURL( $search );
- if ( $nt ) {
- $dbr = wfGetDB( DB_SLAVE );
- $this->mQueryConds[] = 'LOWER(img_name)' . $dbr->buildLike( $dbr->anyString(),
- strtolower( $nt->getDBkey() ), $dbr->anyString() );
+ if ( !$including ) {
+ if ( $wgRequest->getText( 'sort', 'img_date' ) == 'img_date' ) {
+ $this->mDefaultDirection = true;
+ } else {
+ $this->mDefaultDirection = false;
+ }
+
+ $search = $wgRequest->getText( 'ilsearch' );
+ if ( $search != '' && !$wgMiserMode ) {
+ $nt = Title::newFromURL( $search );
+ if ( $nt ) {
+ $dbr = wfGetDB( DB_SLAVE );
+ $this->mQueryConds[] = 'LOWER(img_name)' . $dbr->buildLike( $dbr->anyString(),
+ strtolower( $nt->getDBkey() ), $dbr->anyString() );
+ }