forked from nilsine/Astra-Vires
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstats.php
More file actions
41 lines (38 loc) · 1.24 KB
/
stats.php
File metadata and controls
41 lines (38 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
include('common.inc.php');
db_connect();
switch ($argv[1]) {
case 'inscriptions':
db("select login_id from user_accounts where login_name != '' and signed_up > ".(time() - 24*3600));
echo dbc();
echo "\n";
db("select login_id from user_accounts where login_name != '' and bp_user_id != 0 and signed_up > ".(time() - 24*3600));
echo dbc();
break;
case 'connectes':
db("select login_id from user_accounts where last_request > ".(time() - 300));
echo dbc();
echo "\n";
db("select login_id from user_accounts where bp_user_id != 0 and last_request > ".(time() - 300));
echo dbc();
break;
case 'nbjoueurs':
db("select login_id from user_accounts where login_count >= 4 and last_request > ".(time() - 4*24*3600));
echo dbc();
echo "\n";
db("select login_id from user_accounts where bp_user_id != 0 and login_count >= 4 and last_request > ".(time() - 4*24*3600));
echo dbc();
break;
case 'ressources':
$gal = $argv[2];
db("select avg(metal) as titane from ${gal}_stars where star_id > 1");
$data = dbr();
echo $data['titane'];
echo "\n";
db("select avg(fuel) as larium from ${gal}_stars where star_id > 1");
$data = dbr();
echo $data['larium'];
break;
default:
echo 0;
}