4 * Top-Statistics: Top List
6 * Copyright 1999-2000 (c) The SourceForge Crew
7 * Copyright 2002-2004 (c) GForge Team
9 * Thorsten Glaser <t.glaser@tarent.de>
11 * This file is part of FusionForge. FusionForge is free software;
12 * you can redistribute it and/or modify it under the terms of the
13 * GNU General Public License as published by the Free Software
14 * Foundation; either version 2 of the Licence, or (at your option)
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 along
23 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 $res_top = "oops… no function for this in class Stats";
37 $title = _('Top Downloads in the Past 7 Days');
38 $column1 = _('Downloads');
40 else if ($type == 'pageviews_proj') {
41 $res_top = $stats->getTopPageViews();
42 $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'));
43 $column1 = _('Pageviews');
45 else if ($type == 'forumposts_week') {
46 $res_top = $stats->getTopMessagesPosted();
47 $title = _('Top Forum Post Counts');
48 $column1 = _('Posts');
50 // default to downloads
53 $res_top = $stats->getTopDownloads();
54 $title = _('Top Downloads');
55 $column1 = _('Downloads');
57 $HTML->header(array('title'=>$title));
58 print '<p>'.util_make_link ('/top/','['._('View Other Top Categories').']').'</p>';
59 $arr=array(_('Rank'),_('Project name'),"$column1");
60 echo $HTML->listTableTop($arr);
66 while ($row_top = db_fetch_array($res_top)) {
67 if (!forge_check_perm('project_read', $row_top['group_id'])) {
70 if (($type == 'downloads_week' || $type == 'downloads') && 0 &&
71 !forge_check_perm('frs', $row_new['group_id'], 'read_public')) {
75 * pageviews_proj: project_read probably enough
76 * forumposts_week: forum read? no idea…
79 if ($row_top["items"] == 0) {
83 print '<tr '. $HTML->boxGetAltRowStyle($i) .'><td> '.$display_rank
84 .'</td><td>'.util_make_link_g (strtolower($row_top['unix_group_name']),@$row_top['group_id'],stripslashes($row_top['group_name']))
85 .'</td><td class="align-right">'.$row_top['items']
86 .' </td>'
91 echo $HTML->listTableBottom();
93 $HTML->footer(array());
97 // c-file-style: "bsd"