- // Only allow watched page filtering if the user has the 'unwatchedpages' permission
- // $wgMiserMode disables this
- global $wgUser, $wgMiserMode;
- if ($wgUser->isAllowed('unwatchedpages') && !$wgMiserMode) {
- if($params['filterwatched'] != 'all') {
- $this->addTables('watchlist');
- $this->addJoinConds(array('watchlist' => array('LEFT JOIN', array(
- 'wl_namespace = page_namespace',
- 'wl_title = page_title'))));
- }
- if($params['filterwatched'] == 'unwatched') {
- $this->addWhere('wl_title IS NULL');
- }
- else if ($params['filterwatched'] == 'watched') {
- $this->addWhere('wl_title IS NOT NULL');
- }
- }
- else if($params['filterwatched'] != 'all') {
- if($wgMiserMode)
- $this->setWarning('apfilterwatched is disabled on this wiki for performance reasons');
- else
- $this->setWarning('You don\'t have permission to filter by watched status');
- }