* AND rc_timestamp < $end AND rc_namespace = $namespace
* AND rc_deleted = '0'
*/
- $this->addTables('recentchanges');
$this->addWhereRange('rc_timestamp', $dir, $start, $end);
$this->addWhereFld('rc_namespace', $namespace);
$this->addWhereFld('rc_deleted', 0);
/* Check for conflicting parameters. */
if ((isset ($show['minor']) && isset ($show['!minor']))
|| (isset ($show['bot']) && isset ($show['!bot']))
- || (isset ($show['anon']) && isset ($show['!anon']))) {
+ || (isset ($show['anon']) && isset ($show['!anon']))
+ || (isset ($show['redirect']) && isset ($show['!redirect']))) {
$this->dieUsage("Incorrect parameter - mutually exclusive values may not be supplied", 'show');
}
$this->addWhereIf('rc_bot != 0', isset ($show['bot']));
$this->addWhereIf('rc_user = 0', isset ($show['anon']));
$this->addWhereIf('rc_user != 0', isset ($show['!anon']));
+ $this->addWhereIf('page_is_redirect = 1', isset ($show['redirect']));
+ $this->addWhereIf('page_is_redirect = 0', isset ($show['!redirect']));
}
/* Add the fields we're concerned with to out query. */
$this->fld_title = isset ($prop['title']);
$this->fld_ids = isset ($prop['ids']);
$this->fld_sizes = isset ($prop['sizes']);
+ $this->fld_redirect = isset($prop['redirect']);
$this->fld_patrolled = isset($prop['patrolled']);
global $wgUser;
$this->addFieldsIf('rc_old_len', $this->fld_sizes);
$this->addFieldsIf('rc_new_len', $this->fld_sizes);
$this->addFieldsIf('rc_patrolled', $this->fld_patrolled);
+ if($this->fld_redirect || isset($show['redirect']) || isset($show['!redirect']))
+ {
+ $this->addTables('page');
+ $this->addWhere('page_namespace=rc_namespace');
+ $this->addWhere('page_title=rc_title');
+ $this->addFields('page_is_redirect');
+ }
}
-
+ $this->addTables('recentchanges');
/* Specify the limit for our query. It's $limit+1 because we (possibly) need to
* generate a "continue" parameter, to allow paging. */
$this->addOption('LIMIT', $limit +1);
$vals['comment'] = $row->rc_comment;
}
+ if ($this->fld_redirect)
+ if($row->page_is_redirect)
+ $vals['redirect'] = '';
+
/* Add the patrolled flag */
if ($this->fld_patrolled && $row->rc_patrolled == 1)
$vals['patrolled'] = '';
'title',
'ids',
'sizes',
+ 'redirect',
'patrolled'
)
),
'bot',
'!bot',
'anon',
- '!anon'
+ '!anon',
+ 'redirect',
+ '!redirect'
)
),
'limit' => array (