-
Notifications
You must be signed in to change notification settings - Fork 1
/
site.php
49 lines (47 loc) · 1.6 KB
/
site.php
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
<?php include("top.php"); ?>
<?php
$fileIpAddresses = "statistiks/ips";
$fileCounter = "statistiks/vis";
$fileUbCounter = "statistiks/ubs";
if (filesize($fileIpAddresses) == 0) {
$ipVisits = 0;
} else {
$fh = fopen($fileIpAddresses, "r");
$ipVisits = substr_count(fread($fh, filesize($fileIpAddresses)), ";") - 1;
fclose($fh);
}
if (filesize($fileCounter) == 0) {
$visitors = 0;
} else {
$fh = fopen($fileCounter, "r");
$visitors = fread($fh, filesize($fileCounter));
fclose($fh);
}
/*if (filesize($fileUbCounter) == 0) {
$ubs = 0;
} else {
$fh = fopen($fileUbCounter, "r");
$ubs = fread($fh, filesize($fileUbCounter));
fclose($fh);
}*/
echo("<b>Site statistiks</b><br/>");
echo("<table border=\"0\">");
echo("<tr><td width=\"200px\"> IPs visited:</td><td>" . $ipVisits . "</td></tr>");
//echo("<tr><td> Total hits:</td><td>" . $visitors . "</td></tr>");
//echo("<tr><td> Userbars loaded:</td><td>" . $ubs . "</td></tr>");
echo("</table>");
echo("<br/>");
echo("<b>Other statistiks</b><br/>");
echo("<table border=\"0\">");
echo("<tr><td width=\"200px\"> Registered users:</td><td>" . count($users) . "</td>");
$states = 0;
foreach ($users as $cItem) {
$utime = stateTimes($cItem["nick"], $cItem["elmaname"]);
if ($utime != NULL) $states++;
}
echo("</tr>");
echo("<tr><td width=\"200px\"> State files:</td><td>" . $states . "</td></tr>");
echo("<tr><td width=\"200px\"> Replay files:</td><td>" . fileCount("recs/", ".rec") . "</td></tr>");
echo("</table>");
?>
<?php include("tpo.php"); ?>