-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathstats-daily.php
More file actions
59 lines (58 loc) · 1.46 KB
/
Copy pathstats-daily.php
File metadata and controls
59 lines (58 loc) · 1.46 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
<?php
require 'lib/function.php';
require 'lib/layout.php';
print "
$header
<br>$tblstart
<tr>$tccellh>Information</td></tr>
<tr>$tccellc>
<br>
Daily stats for the board. This page might take a while to fully display.
<br><br>
</td>
</tr>
$tblend
<br>
$tblstart<tr>
$tccellh colspan=9>Daily stats<tr>
$tccellc>Date</td>
$tccellc>Total users</td>
$tccellc>Total posts</td>
$tccellc>Total threads</td>
$tccellc>Total views</td>
$tccellc>New users</td>
$tccellc>New posts</td>
$tccellc>New threads</td>
$tccellc>New views</td></tr>
";
$users=0;
$posts=0;
$threads=0;
$views=0;
$stats=$sql->query("SELECT * FROM dailystats");
$oldyear = "";
while($day=$sql->fetch($stats)){
$year = substr($day['date'], 6);
if ($year !== $oldyear) {
print "<tr>
$tccellh colspan=9>20$year<tr>";
$oldyear = $year;
}
print "<tr>
$tccell1>$day[date]</td>
$tccell2>". number_format($day['users']) ."</td>
$tccell2>". number_format($day['posts']) ."</td>
$tccell2>". number_format($day['threads']) ."</td>
$tccell2>". number_format($day['views']) ."</td>
$tccell2>". number_format($day['users']-$users)."</td>
$tccell2>". number_format($day['posts']-$posts)."</td>
$tccell2>". number_format($day['threads']-$threads)."</td>
$tccell2>". number_format($day['views']-$views)."</td></tr>
";
$users=$day['users'];
$posts=$day['posts'];
$threads=$day['threads'];
$views=$day['views'];
}
print $tblend.$footer;
printtimedif($startingtime);