This repository was archived by the owner on Feb 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstats.php
More file actions
115 lines (106 loc) · 3.86 KB
/
stats.php
File metadata and controls
115 lines (106 loc) · 3.86 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<html>
<head>
<title>Live Statistics</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<a href="index.php"><<-- Back to the server list</a>
<br>
<?php
include("inc/serversf.php");
$sf = new Serversf();
$dir = opendir('servers/');
$servers = "";
$nb = 0;
$max = 1;
$maxPop = 0.000000000000001;
while ($read_file = readdir($dir))
{
if (($read_file!=".")&&($read_file!="..")&&($read_file!="bck")&&(substr($read_file,-3)!="ock"))
{
$sf->readf($read_file);
if (intval($sf->openTime)>0)
$popu = floatval($sf->popularity)/floatval($sf->openTime);
else
$popu = 0;
$max = max($max,intval($sf->openTime));
$maxPop = max($maxPop,$popu);
$servers[] =array('serverName' => $sf->serverName,
'ip' => $sf->ip,
'openTime' => intval($sf->openTime),
'pop' => $popu
);
$nb++;
}
}
foreach ($servers as $key => $row)
{
$serverName[$key] = $row['serverName'];
$ip[$key] = $row['ip'];
$openTime[$key] = $row['openTime'];
$pop[$key] = $row['pop'];
}
$servers2 = $servers;
array_multisort($openTime, SORT_DESC, $serverName, SORT_ASC, $servers);
?>
<strong><font size="5"> <font color="#000066"></font> <font color="#000066"></font> <font color="#000066"></font>LIVE
STATISTICS -- New >> <a href="daily_stats.php">Day statistics</a></font></strong>
<p> </p>
Older statistics:<br>
<?php
$dir = opendir('oldStats/');
while ($read_file = readdir($dir))
{
if (($read_file!=".")&&($read_file!=".."))
{
echo "<a href='oldStats/".$read_file."'>".substr($read_file,0,-4)."</a> ";
}
}
?>
<br>
<br>
<div align="left"><font size="5"> <font color="#000066">Open
time </font></font></div>
<p> </p><table>
<tr><td>Name</td><td><strong><font size="2">IP</font></strong></td><td>Open Time</td></tr>
<?php
$i = 0;
while ($i < $nb)
{
echo "<tr><td>".$servers[$i]["serverName"]."</td><td><strong><font size='2'>".$servers[$i]["ip"]."</font></strong></td><td><img src='im/bord.png' height='10' width='1'><img src='im/barre2.png' title='".convert_sec($servers[$i]["openTime"],true)."' width='".($servers[$i]["openTime"]/$max*400)."' height='10'><img src='im/bord.png' height='10' width='1'></td></tr>\r\n";
$i++;
}
?>
</table>
<p align="left"> </p>
<p align="left"><br>
<font size="5"> <font color="#000066">Average Number of users by hour.</font></font></p>
<table>
<tr>
<td>Name</td>
<td><strong><font size="2">IP</font></strong></td>
<td>Popularity</td>
</tr>
<?php
array_multisort($pop, SORT_DESC, $serverName, SORT_ASC, $servers2);
$i = 0;
while ($i < $nb)
{
echo "<tr><td>".$servers2[$i]["serverName"]."</td><td><strong><font size='2'>".$servers2[$i]["ip"]."</font></strong></td><td><img src='im/bord.png' height='10' width='1'><img src='im/barrem.png' title='".($servers2[$i]["pop"])." users by hour' width='".($servers2[$i]["pop"]/$maxPop*400)."' height='10'><img src='im/bord.png' height='10' width='1'></td></tr>\r\n";
$i++;
}
//array_multisort($pop, SORT_ASC, $serverName, SORT_ASC, $servers);
?>
</table>
<br>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-8462049-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>