4 * GForge Top-Statistics: Top List
6 * Copyright 1999-2000 (c) The SourceForge Crew
7 * The rest Copyright 2002-2004 (c) GForge Team
10 * This file is part of GForge.
12 * GForge 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 * GForge 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 GForge; 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 $gfwww.'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 '<h1>'.$title.'</h1>';
57 print '<p>'.util_make_link ('/top/','['._('View Other Top Categories').']').'</p>';
58 $arr=array(_('Rank'),_('Project name'),"$column1");
59 echo $HTML->listTableTop($arr);
65 while ($row_top = db_fetch_array($res_top)) {
67 if ($row_top["items"] == 0) {
71 print '<tr '. $HTML->boxGetAltRowStyle($i) .'><td> '.$display_rank
72 .'</td><td>'.util_make_link_g (strtolower($row_top['unix_group_name']),@$row_top['group_id'],stripslashes($row_top['group_name']))
73 .'</td><td align="right">'.$row_top['items']
74 .' </td>'
79 echo $HTML->listTableBottom();
81 $HTML->footer(array());
85 // c-file-style: "bsd"