diff --git a/indefero/src/IDF/FileUtil.php b/indefero/src/IDF/FileUtil.php index db9563c..3b2c388 100644 --- a/indefero/src/IDF/FileUtil.php +++ b/indefero/src/IDF/FileUtil.php @@ -40,7 +40,8 @@ class IDF_FileUtil public static $map = array("cxx" => "cpp", "h" => "cpp", "hpp" => "cpp", "rc"=>"text", "sh"=>"bash", "cs"=>"csharp"); - public static $syntaxhighlightext = array("as3", "cf", "cpp", "c", "css", "pas", "diff", "patch", "erl", "java", "jfx", "js", "pl", "php", "py", "rb", "sass", "scss", "scala", "sql", "vb", ); + public static $syntaxhighlightext = array("html", "as3", "cf", "cpp", "c", "css", "pas", "diff", "patch", "erl", "java", "jfx", "js", "pl", "php", "py", "rb", "sass", "scss", "scala", "sql", "vb", ); + /** * Test if an extension is supported by the syntax highlighter. diff --git a/indefero/src/IDF/Views.php b/indefero/src/IDF/Views.php index 7f351a7..9bea911 100644 --- a/indefero/src/IDF/Views.php +++ b/indefero/src/IDF/Views.php @@ -565,4 +565,40 @@ class IDF_Views $forgestats['proj_count'] = count($projects); return $forgestats; } + + /** + * Returns statistics by a userID + * + * @param ArrayObject IDF_Project + * @return Associative array of statistics + */ + public static function getProjectsStatisticsByUser($uid) + { + $forgestats = array(); + + // count overall project stats + $forgestats['total'] = 0; + $what = array( + 'downloads' => 'IDF_Upload', + 'reviews' => 'IDF_Review', + 'issues' => 'IDF_Issue', + 'docpages' => 'IDF_Wiki_Page', + + ); + foreach ($what as $key => $model) { + $count = Pluf::factory($model)->getCount(array( + 'filter' => sprintf('submitter = %d', $uid) + )); + $forgestats[$key] = $count; + $forgestats['total'] += $count; + } + // 'commits' => 'IDF_Commit', + $count = Pluf::factory('IDF_Commit')->getCount(array( + 'filter' => sprintf('author = %d', $uid) + )); + $forgestats['commits'] = $count; + $forgestats['total'] += $count; + + return $forgestats; + } } diff --git a/indefero/src/IDF/Views/User.php b/indefero/src/IDF/Views/User.php index 04803f3..b9da9f5 100644 --- a/indefero/src/IDF/Views/User.php +++ b/indefero/src/IDF/Views/User.php @@ -304,7 +304,9 @@ class IDF_Views_User } } } - $projectstats = IDF_Views::getProjectsStatistics($pubprojects); + //$projectstats = IDF_Views::getProjectsStatistics($pubprojects); + $projectstats = IDF_Views::getProjectsStatisticsByUser($user->id); + $projectstats["proj_count"] = count($pubprojects); //print_r($projectstats); //echo $privprojects; diff --git a/indefero/www/media/idf/img/feed-icon.png b/indefero/www/media/idf/img/feed-icon.png new file mode 100644 index 0000000..b3c949d Binary files /dev/null and b/indefero/www/media/idf/img/feed-icon.png differ