4 require ('squal_pre.php');
6 /*if (!strstr($REMOTE_ADDR,$sys_internal_network)) {
7 exit_permission_denied();
10 $today_formatted=date('Ymd',time());
14 ## shuffle the activity log tables - we keep 3 days of data
15 $sql = "DROP TABLE activity_log_old_old";
16 $rel = db_query($sql);
18 $sql = "ALTER TABLE activity_log_old RENAME TO activity_log_old_old";
19 $rel = db_query($sql);
21 $sql = "ALTER TABLE activity_log RENAME TO activity_log_old";
22 $rel = db_query($sql);
24 $sql = "CREATE TABLE activity_log (
25 day int DEFAULT '0' NOT NULL,
26 hour int DEFAULT '0' NOT NULL,
27 group_id int DEFAULT '0' NOT NULL,
28 browser varchar(8) DEFAULT 'OTHER' NOT NULL,
29 ver float(8) DEFAULT '0.00' NOT NULL,
30 platform varchar(8) DEFAULT 'OTHER' NOT NULL,
31 time int DEFAULT '0' NOT NULL,
33 type int DEFAULT '0' NOT NULL
35 $rel = db_query($sql);
37 ## Cleanup any spillover, so that the activity log always contains exactly 24 hours worth of data.
38 $sql = "INSERT INTO activity_log SELECT * FROM activity_log_old WHERE day='$today_formatted'";
39 $rel = db_query($sql);
41 $sql = "DELETE FROM activity_log_old WHERE day='$today_formatted'";
42 $rel = db_query($sql);
45 echo "Done: ".db_error();