private $params, $username;
private $fld_ids = false, $fld_title = false, $fld_timestamp = false,
$fld_comment = false, $fld_flags = false,
- $fld_patrolled = false;
+ $fld_patrolled = false, $fld_tags = false;
public function execute() {
$this->fld_flags = isset($prop['flags']);
$this->fld_timestamp = isset($prop['timestamp']);
$this->fld_patrolled = isset($prop['patrolled']);
+ $this->fld_tags = isset($prop['tags']);
// TODO: if the query is going only against the revision table, should this be done?
$this->selectNamedDB('contributions', DB_SLAVE, 'contributions');
private function prepareQuery() {
// We're after the revision table, and the corresponding page
// row for anything we retrieve. We may also need the
- // recentchanges row.
+ // recentchanges row and/or tag summary row.
global $wgUser;
$tables = array('page', 'revision'); // Order may change
$this->addWhere('page_id=rev_page');
$this->addFieldsIf('rev_minor_edit', $this->fld_flags);
$this->addFieldsIf('rev_parent_id', $this->fld_flags);
$this->addFieldsIf('rc_patrolled', $this->fld_patrolled);
+
+ if($this->fld_tags || !is_null($this->params['tag'])) {
+ $this->addTables('tag_summary');
+ $this->addJoinConds(array('tag_summary' => array('LEFT JOIN', array('rev_id=ts_rev_id'))));
+ $this->addFields('ts_tags');
+ }
+
+ if( !is_null($this->params['tag']) ) {
+ $this->addWhereFld('ts_tags', $this->params['tag']);
+ }
}
/**
if ($this->fld_size && !is_null($row->rev_len))
$vals['size'] = intval($row->rev_len);
+ if ($this->fld_tags && $row->ts_tags)
+ $vals['tags'] = $row->ts_tags;
+
return $vals;
}
'size',
'flags',
'patrolled',
+ 'tags',
)
),
'show' => array (
'!patrolled',
)
),
+ 'tag' => null,
);
}
'prop' => 'Include additional pieces of information',
'show' => array('Show only items that meet this criteria, e.g. non minor edits only: show=!minor',
'NOTE: if show=patrolled or show=!patrolled is set, revisions older than $wgRCMaxAge won\'t be shown',),
+ 'tag' => 'Only list contributions with this tag',
);
}