3 * Copyright 1999-2001 (c) VA Linux Systems
5 * This file is part of FusionForge.
7 * FusionForge is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * GForge is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GForge; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
22 function site_stats_day($year,$month,$day) {
26 $day_begin=mktime(0,0,0,$month,$day,$year);
27 $day_end=($day_begin + 86400);
29 # echo "Stats_site: $datetime::$day_begin::$day_end::".date('Ymd',$day_begin)."::".date('Ymd',$day_end)."--> $i\n";
32 // build row for stats_site
34 $rel = db_query_params ('DELETE FROM stats_site WHERE month=$1 AND day=$2',
40 $rel = db_query_params ('INSERT INTO stats_site (month,day,uniq_users,sessions,total_users,new_users,new_projects)
43 (SELECT COUNT(DISTINCT(user_id)) FROM user_session WHERE (time < $3 AND time > $4)),
44 (SELECT COUNT(session_hash) FROM user_session WHERE (time < $3 AND time > $4)),
45 (SELECT COUNT(user_id) FROM users WHERE ( add_date < $3 AND status=$5 )),
46 (SELECT COUNT(user_id) FROM users WHERE ( add_date < $3 AND add_date > $4 )),
47 (SELECT COUNT(group_id) FROM groups WHERE ( register_time < $3 AND register_time > $4 )))',