diff --git a/codepot/etc/codepot.ini.in b/codepot/etc/codepot.ini.in index f45a28fb..c046a2d4 100644 --- a/codepot/etc/codepot.ini.in +++ b/codepot/etc/codepot.ini.in @@ -153,12 +153,12 @@ max_upload_size = "10000" max_latest_projects = "10" ;------------------------------------------------------------------------------ -; Maximum number of projects to show in the top projects graph +; Maximum number of projects to show in the top projects graph (0 to hide) ;------------------------------------------------------------------------------ max_top_projects = "10" ;------------------------------------------------------------------------------ -; Maximum number of committers to show in the top committers graph +; Maximum number of committers to show in the top committers graph (0 to hide) ;------------------------------------------------------------------------------ max_top_committers = "10" diff --git a/codepot/src/codepot/controllers/site.php b/codepot/src/codepot/controllers/site.php index d13b3d81..4763b459 100644 --- a/codepot/src/codepot/controllers/site.php +++ b/codepot/src/codepot/controllers/site.php @@ -104,8 +104,15 @@ class Site extends Controller $login['id'], $this->issuehelper->_get_open_status_array($this->lang), 0); } - $commit_counts_per_project = $this->logs->countCodeCommitsPerProject ('', 0, CODEPOT_MAX_TOP_PROJECTS); - $commit_counts_per_user = $this->logs->countCodeCommitsPerUser ('', 0, CODEPOT_MAX_TOP_COMMITTERS); + if (CODEPOT_MAX_TOP_PROJECTS > 0) + $commit_counts_per_project = $this->logs->countCodeCommitsPerProject ('', 0, CODEPOT_MAX_TOP_PROJECTS); + else + $commit_counts_per_project = array(); + + if (CODEPOT_MAX_TOP_COMMITTERS > 0) + $commit_counts_per_user = $this->logs->countCodeCommitsPerUser ('', 0, CODEPOT_MAX_TOP_COMMITTERS); + else + $commit_counts_per_user = array(); if (/*$issues === FALSE || $recently_resolved_issues === FALSE ||*/ $open_issue_counts_per_project === FALSE ||