+ $mtime1 = $dbr->timestampOrNull( $this->getOption( 'mtimeafter', null ) );
+ $mtime2 = $dbr->timestampOrNull( $this->getOption( 'mtimebefore', null ) );
+
+ $joinTables = array( 'image' );
+ $joinConds = array( 'image' => array( 'INNER JOIN', 'img_name = page_title' ) );
+ if ( $mtime1 || $mtime2 ) {
+ $joinTables[] = 'logging';
+ $on = array( 'log_page = page_id', 'log_type' => array( 'upload', 'move', 'delete' ) );
+ if ( $mtime1 ) {
+ $on[] = "log_timestamp > {$dbr->addQuotes($mtime1)}";
+ }
+ if ( $mtime2 ) {
+ $on[] = "log_timestamp < {$dbr->addQuotes($mtime2)}";
+ }
+ $joinConds['logging'] = array( 'INNER JOIN', $on );
+ }
+