3 * Copyright 1999-2001 (c) VA Linux Systems
5 * This file is part of FusionForge. FusionForge is free software;
6 * you can redistribute it and/or modify it under the terms of the
7 * GNU General Public License as published by the Free Software
8 * Foundation; either version 2 of the Licence, or (at your option)
11 * FusionForge is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 function site_stats_day($year,$month,$day) {
25 $day_begin=mktime(0,0,0,$month,$day,$year);
26 $day_end=($day_begin + 86400);
28 # echo "Stats_site: $datetime::$day_begin::$day_end::".date('Ymd',$day_begin)."::".date('Ymd',$day_end)."--> $i\n";
31 // build row for stats_site
33 $rel = db_query_params ('DELETE FROM stats_site WHERE month=$1 AND day=$2',
39 $rel = db_query_params ('INSERT INTO stats_site (month,day,uniq_users,sessions,total_users,new_users,new_projects)
42 (SELECT COUNT(DISTINCT(user_id)) FROM user_session WHERE (time < $3 AND time > $4)),
43 (SELECT COUNT(session_hash) FROM user_session WHERE (time < $3 AND time > $4)),
44 (SELECT COUNT(user_id) FROM users WHERE ( add_date < $3 AND status=$5 )),
45 (SELECT COUNT(user_id) FROM users WHERE ( add_date < $3 AND add_date > $4 )),
46 (SELECT COUNT(group_id) FROM groups WHERE ( register_time < $3 AND register_time > $4 )))',