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.
12 * FusionForge is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * FusionForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with FusionForge; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 require ('../env.inc.php');
28 require_once $gfcommon.'include/pre.php';
29 require_once $gfcommon.'include/Stats.class.php';
31 $type = getStringFromRequest('type');
35 if ($type == 'downloads_week') {
36 $title = _('Top Downloads in the Past 7 Days');
37 $column1 = _('Downloads');
39 else if ($type == 'pageviews_proj') {
40 $res_top = $stats->getTopPageViews();
41 $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'));
42 $column1 = _('Pageviews');
44 else if ($type == 'forumposts_week') {
45 $res_top = $stats->getTopMessagesPosted();
46 $title = _('Top Forum Post Counts');
47 $column1 = _('Posts');
49 // default to downloads
51 $res_top = $stats->getTopDownloads();
52 $title = _('Top Downloads');
53 $column1 = _('Downloads');
55 $HTML->header(array('title'=>$title));
56 print '<p>'.util_make_link ('/top/','['._('View Other Top Categories').']').'</p>';
57 $arr=array(_('Rank'),_('Project name'),"$column1");
58 echo $HTML->listTableTop($arr);
64 while ($row_top = db_fetch_array($res_top)) {
66 if ($row_top["items"] == 0) {
70 print '<tr '. $HTML->boxGetAltRowStyle($i) .'><td> '.$display_rank
71 .'</td><td>'.util_make_link_g (strtolower($row_top['unix_group_name']),@$row_top['group_id'],stripslashes($row_top['group_name']))
72 .'</td><td align="right">'.$row_top['items']
73 .' </td>'
78 echo $HTML->listTableBottom();
80 $HTML->footer(array());
84 // c-file-style: "bsd"