4 * Top-Statistics: Top List
6 * Copyright 1999-2000 (c) The SourceForge Crew
7 * Copyright 2002-2004 (c) GForge Team
8 * http://fusionforge.org/
10 * This file is part of FusionForge. FusionForge is free software;
11 * you can redistribute it and/or modify it under the terms of the
12 * GNU General Public License as published by the Free Software
13 * Foundation; either version 2 of the Licence, or (at your option)
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 require ('../env.inc.php');
27 require_once $gfcommon.'include/pre.php';
28 require_once $gfcommon.'include/Stats.class.php';
30 $type = getStringFromRequest('type');
34 if ($type == 'downloads_week') {
35 $title = _('Top Downloads in the Past 7 Days');
36 $column1 = _('Downloads');
38 else if ($type == 'pageviews_proj') {
39 $res_top = $stats->getTopPageViews();
40 $title = sprintf(_('Top Weekly Project Pageviews at *.%1$s (from impressions of %2$s logo)'), forge_get_config('web_host'), forge_get_config ('forge_name'));
41 $column1 = _('Pageviews');
43 else if ($type == 'forumposts_week') {
44 $res_top = $stats->getTopMessagesPosted();
45 $title = _('Top Forum Post Counts');
46 $column1 = _('Posts');
48 // default to downloads
50 $res_top = $stats->getTopDownloads();
51 $title = _('Top Downloads');
52 $column1 = _('Downloads');
54 $HTML->header(array('title'=>$title));
55 print '<p>'.util_make_link ('/top/','['._('View Other Top Categories').']').'</p>';
56 $arr=array(_('Rank'),_('Project name'),"$column1");
57 echo $HTML->listTableTop($arr);
63 while ($row_top = db_fetch_array($res_top)) {
64 if (!forge_check_perm ('project_read', $row_top['group_id'])) {
68 if ($row_top["items"] == 0) {
72 print '<tr '. $HTML->boxGetAltRowStyle($i) .'><td> '.$display_rank
73 .'</td><td>'.util_make_link_g (strtolower($row_top['unix_group_name']),@$row_top['group_id'],stripslashes($row_top['group_name']))
74 .'</td><td class="align-right">'.$row_top['items']
75 .' </td>'
80 echo $HTML->listTableBottom();
82 $HTML->footer(array());
86 // c-file-style: "bsd"