/**
  * Constructor of BsDiagramNumberOfUsers class
  */
 public function __construct()
 {
     parent::__construct();
     BsConfig::get('MW::Statistics::ExcludeUsers');
     $this->sTitle = wfMessage('bs-statistics-diag-number-of-users')->plain();
     $this->sDescription = wfMessage('bs-statistics-diag-number-of-users-desc')->plain();
     $this->sTitlex = wfMessage('bs-statistics-label-time')->plain();
     $this->sTitley = wfMessage('bs-statistics-label-count')->plain();
     $this->sActualGrain = "m";
     $this->sModLabel = "M y";
     $this->iDataSource = BsDiagram::DATASOURCE_DATABASE;
     $this->bListable = true;
     $this->sSqlWhatForDiagram = "count(user_id)";
     $this->sSqlWhatForList = "user_name, user_registration";
     $this->sSqlFromWhere = "FROM #__user\n\t\t\t\t\t\t\t\tWHERE user_registration @period\n\t\t\t\t\t\t\t\tAND user_id NOT IN (\n\t\t\t\t\t\t\t\t\tSELECT ug_user\n\t\t\t\t\t\t\t\t\tFROM #__user_groups\n\t\t\t\t\t\t\t\t\tWHERE ug_group = 'bot'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tAND NOT user_name IN (@BsFilterUsers)";
     $this->sListLabel = array(wfMessage('bs-statistics-label-name')->plain(), wfMessage('bs-statistics-label-registration')->plain());
     $this->sMode = BsDiagram::MODE_AGGREGATED;
     $this->addFilter(new BsFilterUsers($this));
 }
 /**
  * Constructor of BsDiagramNumberOfArticles class
  */
 public function __construct()
 {
     parent::__construct();
     $this->sTitle = wfMsg('bs-statistics-diag-number-of-pages-mw');
     $this->sDescription = wfMsg('bs-statistics-diag-number-of-pages-mw-desc');
     $this->sTitlex = wfMsg('bs-statistics-label-time');
     $this->sTitley = wfMsg('bs-statistics-label-count');
     $this->sActualGrain = "m";
     $this->sModLabel = "M y";
     $this->iDataSource = BsDiagram::DATASOURCE_DATABASE;
     $this->bListable = true;
     $this->sSqlWhatForDiagram = "count(DISTINCT rev_page)";
     $this->sSqlWhatForList = "DISTINCT page_title, rev_user_text";
     $this->sSqlFromWhere = "FROM #__revision AS a\n\t\t\t\t\t\t\t\t\tJOIN #__page ON #__page.page_id = a.rev_page\n\t\t\t\t\t\t\t\t\tLEFT JOIN #__categorylinks AS c ON c.cl_from = a.rev_page\n\t\t\t\t\t\t\t\tWHERE rev_timestamp @period\n\t\t\t\t\t\t\t\tAND rev_id in (\n\t\t\t\t\t\t\t\t\tSELECT Min(rev_id)\n\t\t\t\t\t\t\t\t\tFROM #__revision\n\t\t\t\t\t\t\t\t\tWHERE rev_page=a.rev_page\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tAND @BsFilterNamespace\n\t\t\t\t\t\t\t\tAND NOT page_is_redirect = 1\n\t\t\t\t\t\t\t\tAND (\n\t\t\t\t\t\t\t\t\tpage_id IN (\n\t\t\t\t\t\t\t\t\t\tSELECT DISTINCT(pl_from)\n\t\t\t\t\t\t\t\t\t\tFROM #__pagelinks\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\tOR page_id IN (\n\t\t\t\t\t\t\t\t\t\tSELECT DISTINCT(cl_from)\n\t\t\t\t\t\t\t\t\t\tFROM #__categorylinks\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\tOR page_id IN (\n\t\t\t\t\t\t\t\t\t\tSELECT DISTINCT(tl_from)\n\t\t\t\t\t\t\t\t\t\tFROM #__templatelinks\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\tOR page_id IN (\n\t\t\t\t\t\t\t\t\t\tSELECT DISTINCT(il_from)\n\t\t\t\t\t\t\t\t\t\tFROM #__imagelinks\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\tOR page_id IN (\n\t\t\t\t\t\t\t\t\t\tSELECT DISTINCT(el_from)\n\t\t\t\t\t\t\t\t\t\tFROM #__externallinks\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\tOR page_id IN (\n\t\t\t\t\t\t\t\t\t\tSELECT DISTINCT(ll_from)\n\t\t\t\t\t\t\t\t\t\tFROM #__langlinks\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tAND @BsFilterCategory";
     $this->sListLabel = array(wfMsg('bs-statistics-label-page'), wfMsg('bs-statistics-label-creator'));
     $this->sMode = BsDiagram::MODE_AGGREGATED;
     $this->addFilter(new BsFilterNamespace($this, array(0)));
     $this->addFilter(new BsFilterCategory($this));
 }
 /**
  * Constructor of BsDiagramSearches class
  */
 public function __construct()
 {
     parent::__construct();
     $this->sTitle = wfMsg('bs-statistics-diag-search-queries');
     $this->sDescription = wfMsg('bs-statistics-diag-search-queries-desc');
     $this->sTitlex = wfMsg('bs-statistics-label-time');
     $this->sTitley = wfMsg('bs-statistics-label-count');
     $this->sActualGrain = "m";
     $this->sModLabel = "M y";
     $this->iDataSource = BsDiagram::DATASOURCE_DATABASE;
     $this->bListable = true;
     $this->sSqlWhatForDiagram = "count(stats_term)";
     $this->sSqlWhatForList = "stats_term, count(stats_term) as x, max(stats_hits)";
     $this->sSqlFromWhere = "FROM #__bs_searchstats WHERE stats_ts @period AND @BsFilterSearchScope";
     $this->sSqlOptionsForList = "GROUP BY stats_term";
     $this->sListLabel = array(wfMsg('bs-statistics-label-searchterm'), wfMsg('bs-statistics-label-count'), wfMsg('bs-statistics-label-maxhits'));
     $this->sMode = BsDiagram::MODE_AGGREGATED;
     $this->addFilter(new BsFilterSearchScope($this, array("title")));
 }
 /**
  * Constructor of BsDiagramNumberOfEdits class
  */
 public function __construct()
 {
     parent::__construct();
     $this->sTitle = wfMsg('bs-statistics-diag-number-of-edits');
     $this->sDescription = wfMsg('bs-statistics-diag-number-of-edits-desc');
     $this->sTitlex = wfMsg('bs-statistics-label-time');
     $this->sTitley = wfMsg('bs-statistics-label-count');
     $this->sActualGrain = "m";
     $this->sModLabel = "M y";
     $this->iDataSource = BsDiagram::DATASOURCE_DATABASE;
     $this->bListable = false;
     $this->sSqlWhatForDiagram = "count(DISTINCT rev_id)";
     // Evtl: user->edits oder artikel->edits?
     //$this->sSqlWhatForList = "DISTINCT page_title, rev_user_text";
     // Important: Keep DISTINCT rev_id, otherwise a revision is counted once per category link
     //            cf also EditsPerUser
     // TODO MRG (30.04.12 01:00): Wieso werden die categorylinks überhaupt gezählt?
     $this->sSqlFromWhere = "FROM #__revision AS a\n\t\t\t\t\t\t\t\t\tJOIN #__page ON #__page.page_id = a.rev_page\n\t\t\t\t\t\t\t\t\tLEFT JOIN #__categorylinks AS c ON c.cl_from = a.rev_page\n\t\t\t\t\t\t\t\tWHERE rev_timestamp @period\n\t\t\t\t\t\t\t\tAND @BsFilterNamespace\n\t\t\t\t\t\t\t\tAND NOT rev_user IN (\n\t\t\t\t\t\t\t\t\tSELECT ug_user\n\t\t\t\t\t\t\t\t\tFROM #__user_groups\n\t\t\t\t\t\t\t\t\tWHERE ug_group = 'bot'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tAND NOT rev_user_text IN (@BsFilterUsers)\n\t\t\t\t\t\t\t\tAND @BsFilterCategory";
     //$this->sListLabel = array(wfMsg( 'label-article'), wfMsg( 'label-creator'));
     $this->sMode = BsDiagram::MODE_ABSOLUTE;
     $this->addFilter(new BsFilterNamespace($this, array(0)));
     $this->addFilter(new BsFilterCategory($this));
     $this->addFilter(new BsFilterUsers($this));
 }