diff -r 8b130f9f2f708c49fcfaf83d5dfe5e6c27ac4c1a -r 76c3baca5e9ae0c104b9bcb831fbde1b6cfe7472 indefero/src/IDF/FileUtil.php --- a/indefero/src/IDF/FileUtil.php Sat Apr 05 00:02:37 2014 -0500 +++ b/indefero/src/IDF/FileUtil.php Sun Apr 20 16:40:00 2014 -0500 @@ -40,7 +40,8 @@ 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 -r 8b130f9f2f708c49fcfaf83d5dfe5e6c27ac4c1a -r 76c3baca5e9ae0c104b9bcb831fbde1b6cfe7472 indefero/src/IDF/Views.php --- a/indefero/src/IDF/Views.php Sat Apr 05 00:02:37 2014 -0500 +++ b/indefero/src/IDF/Views.php Sun Apr 20 16:40:00 2014 -0500 @@ -565,4 +565,40 @@ $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 -r 8b130f9f2f708c49fcfaf83d5dfe5e6c27ac4c1a -r 76c3baca5e9ae0c104b9bcb831fbde1b6cfe7472 indefero/src/IDF/Views/User.php --- a/indefero/src/IDF/Views/User.php Sat Apr 05 00:02:37 2014 -0500 +++ b/indefero/src/IDF/Views/User.php Sun Apr 20 16:40:00 2014 -0500 @@ -304,7 +304,9 @@ } } } - $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 -r 8b130f9f2f708c49fcfaf83d5dfe5e6c27ac4c1a -r 76c3baca5e9ae0c104b9bcb831fbde1b6cfe7472 indefero/www/media/idf/img/feed-icon.png Binary file indefero/www/media/idf/img/feed-icon.png has changed