3 * FusionForge top-level information
5 * Copyright 2002, GForge, LLC
7 * This file is part of FusionForge.
9 * FusionForge is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published
11 * by the Free Software Foundation; either version 2 of the License,
12 * or (at your option) any later version.
14 * FusionForge is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with FusionForge; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 require_once $gfcommon.'include/Error.class.php';
26 class FusionForge extends Error {
29 var $software_version ;
32 * FusionForge - FusionForge object constructor
34 function FusionForge() {
37 $this->software_name = 'FusionForge' ;
38 $this->software_version = '4.7' ;
43 function getNumberOfPublicHostedProjects() {
44 $res=db_query("SELECT count(*) AS count FROM groups WHERE status='A' AND is_public=1");
45 if (!$res || db_numrows($res) < 1) {
46 $this->setError('Unable to get hosted project count: '.db_error());
49 return $this->parseCount($res);
52 function getNumberOfHostedProjects() {
53 $res=db_query("SELECT count(*) AS count FROM groups WHERE status='A'");
54 if (!$res || db_numrows($res) < 1) {
55 $this->setError('Unable to get hosted project count: '.db_error());
58 return $this->parseCount($res);
61 function getNumberOfActiveUsers() {
62 $res = db_query("SELECT count(*) AS count FROM users WHERE status='A' and user_id != 100");
63 if (!$res || db_numrows($res) < 1) {
64 $this->setError('Unable to get user count: '.db_error());
67 return $this->parseCount($res);
71 function getPublicProjectNames() {
72 $res = db_query("SELECT unix_group_name FROM groups WHERE status='A' AND is_public=1");
74 $this->setError('Unable to get list of public projects: '.db_error());
77 $rows=db_numrows($res);
79 for ($i=0; $i<$rows; $i++) {
80 $result[$i] = db_result($res, $i, 'unix_group_name');
85 function parseCount($res) {
86 $row_count = db_fetch_array($res);
87 return $row_count['count'];
95 // c-file-style: "bsd"