* Copyright 1999-2001, VA Linux Systems, Inc.
* Copyright 2002, GForge, LLC
* Copyright 2009, Roland Mas
- * Copyright © 2012
- * Thorsten Glaser <t.glaser@tarent.de>
+ * Copyright 2012, Thorsten Glaser <t.glaser@tarent.de>
+ * Copyright 2021, Franck Villaume - TrivialDev
*
* This file is part of FusionForge. FusionForge is free software;
* you can redistribute it and/or modify it under the terms of the
}
/**
- * Returns a resultset containing unix_group_name, group_name, and items - the count of
- * the messages posted on that group's forums
+ * Returns a _name, group_name, and items - the count of
+ * the messages posted on that group's forumsresultset containing unix_group
*
* @return resource a resultset of unix_group_name, group_name, items
*/
array ('A'),
100) ;
}
-}
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
+ function getTopVotedProjects() {
+ return db_query_params('SELECT g.group_name, g.unix_group_name, gv.group_id, COUNT(*) AS counter FROM group_votes AS gv, groups AS g WHERE gv.group_id = g.group_id AND g.status = $1 GROUP BY gv.group_id, g.group_name, g.unix_group_name ORDER BY counter DESC',
+ array('A'),
+ 100);
+ }
+}
<?php
/**
- * Copyright 2016, Franck Villaume - TrivialDev
+ * Copyright 2016,2021, Franck Villaume - TrivialDev
* This file is a part of Fusionforge.
*
* Fusionforge is free software; you can redistribute it and/or modify
}
$return .= $HTML->boxMiddle(_('Most Active This Week'), 'Most_Active_This_Week');
$return .= show_highest_ranked_projects();
+ $return .= $HTML->boxMiddle(_('Top Voted Projects'), 'Top_Voted_Projects');
+ $return .= show_top_voted_project();
$return .= $HTML->boxMiddle(_('Recently Registered Projects'), 'Recently_Registered_Projects');
$return .= show_newest_projects();
$params['return'] = &$return;
*
* Copyright 1999-2001 (c) VA Linux Systems
* Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * Copyright 2012,2016, Franck Villaume - TrivialDev
+ * Copyright 2012,2016,2021, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
return $return;
}
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
+function show_top_voted_project() {
+ global $HTML;
+ $stats = new Stats();
+ $result = $stats->getTopVotedProjects();
+ $return = '' ;
+ $count = 1 ;
+ while(($row = db_fetch_array($result)) && ($count <= 20)) {
+ if (!forge_check_perm('project_read', $row['group_id'])) {
+ continue ;
+ }
+
+ $t_prj_link = util_make_link_g($row['unix_group_name'], $row['group_id'], $row['group_name']);
+
+ $return .= "<tr>";
+ $return .= '<td class="width-stat-col1">'. $row['counter'] . "</td>";
+ $return .= '<td>' . $t_prj_link . '</td>';
+ $return .= "</tr>\n";
+
+ $count++ ;
+ }
+ if ( $return == "" ) {
+ return $HTML->warning_msg(_('No stats available.'));
+ } else {
+ return $HTML->listTableTop().$return.$HTML->listTableBottom();
+ }
+}