author | Dan |
Tue, 30 Dec 2008 06:16:54 -0500 | |
changeset 37 | c3cbefda414a |
parent 34 | a8daa2016cf1 |
child 44 | 73f74d395f95 |
child 45 | 53a50ba4d690 |
permissions | -rw-r--r-- |
8 | 1 |
<?php |
2 |
require('../stats-fe.php'); |
|
3 |
require('../timezone.php'); |
|
4 |
||
20 | 5 |
$channel_list = stats_channel_list(); |
6 |
$first_channel = $channel_list[0]; |
|
7 |
$channel = ( isset($_REQUEST['channel']) && in_array($_REQUEST['channel'], $channel_list) ) ? $_REQUEST['channel'] : $first_channel; |
|
8 | 8 |
?> |
9 |
||
10 |
<html> |
|
11 |
<head> |
|
12 |
<title><?php echo $nick; ?> - Statistics</title> |
|
13 |
<style type="text/css"> |
|
14 |
div.footer { |
|
15 |
font-size: smaller; |
|
16 |
padding-top: 10px; |
|
17 |
margin-top: 10px; |
|
18 |
border-top: 1px solid #aaa; |
|
19 |
} |
|
20 |
</style> |
|
21 |
</head> |
|
22 |
<body> |
|
23 |
<div style="float: right;"> |
|
24 |
<p> |
|
25 |
<?php |
|
26 |
$tz_display = str_replace('_', ' ', str_replace('/', ': ', $tz)); |
|
27 |
echo 'Time zone: ' . $tz_display . ' [<a href="changetz.php">change</a>]<br />'; |
|
20 | 28 |
echo '<small>The time now is ' . date('H:i:s') . '.<br />Statistics now updated constantly (see <a href="news.php">news</a>)</small>'; |
8 | 29 |
?> |
30 |
</p> |
|
31 |
<p> |
|
32 |
<big><b>Channels:</b></big><br /> |
|
33 |
<?php |
|
34 |
foreach ( $channels as $i => $c ) |
|
35 |
{ |
|
36 |
$bold = ( $c == $channel ); |
|
37 |
echo $bold ? '<b>' : ''; |
|
38 |
echo $bold ? '' : '<a href="index.php?channel=' . urlencode($c) . '">'; |
|
39 |
echo $c; |
|
40 |
echo $bold ? '' : '</a>'; |
|
41 |
echo $bold ? '</b>' : ''; |
|
42 |
echo $i == count($channels) - 1 ? '' : ' | '; |
|
43 |
} |
|
44 |
?> |
|
45 |
</p> |
|
46 |
</div> |
|
47 |
<h1>Active members</h1> |
|
48 |
<p>For the last 1, 5, and 15 minutes: |
|
49 |
<?php echo count(stats_activity_percent($channel, 1)) . ', ' . |
|
50 |
count(stats_activity_percent($channel, 5)) . ', ' . |
|
51 |
count(stats_activity_percent($channel, 15)) . ' (respectively)'; |
|
52 |
?> |
|
53 |
</p> |
|
54 |
<h1>Currently active members:</h1> |
|
55 |
<p>These people have posted in the last 3 minutes:</p> |
|
56 |
<ul> |
|
57 |
<?php |
|
58 |
$datum = stats_activity_percent($channel, 3); |
|
59 |
$count = stats_message_count($channel, 3); |
|
60 |
if ( empty($datum) ) |
|
61 |
echo '<li>No recent posts.</li>'; |
|
11 | 62 |
foreach ( $datum as $usernick => $pct ) |
8 | 63 |
{ |
64 |
$total = round($pct * $count); |
|
65 |
$pct = round(100 * $pct, 1); |
|
11 | 66 |
echo "<li>$usernick - $pct% ($total)</li>\n"; |
8 | 67 |
} |
68 |
?> |
|
69 |
</ul> |
|
70 |
<p>Last 20 minutes:</p> |
|
71 |
<ul> |
|
72 |
<?php |
|
73 |
$datum = stats_activity_percent($channel, 20); |
|
74 |
$count = stats_message_count($channel, 20); |
|
75 |
if ( empty($datum) ) |
|
76 |
echo '<li>No recent posts.</li>'; |
|
11 | 77 |
foreach ( $datum as $usernick => $pct ) |
8 | 78 |
{ |
79 |
$total = round($pct * $count); |
|
80 |
$pct = round(100 * $pct, 1); |
|
11 | 81 |
echo "<li>$usernick - $pct% ($total)</li>\n"; |
8 | 82 |
} |
83 |
?> |
|
84 |
</ul> |
|
85 |
<h1>Last 24 hours</h1> |
|
34
a8daa2016cf1
Added support for last month and last 2 weeks graphs; adjusted web interface accordingly
Dan
parents:
20
diff
changeset
|
86 |
<img alt="Graph image" src="graph.php?mode=lastday&channel=<?php echo urlencode($channel); ?>" /> |
a8daa2016cf1
Added support for last month and last 2 weeks graphs; adjusted web interface accordingly
Dan
parents:
20
diff
changeset
|
87 |
<h1>Last 2 weeks</h1> |
a8daa2016cf1
Added support for last month and last 2 weeks graphs; adjusted web interface accordingly
Dan
parents:
20
diff
changeset
|
88 |
<img alt="Graph image" src="graph.php?mode=lastweek&channel=<?php echo urlencode($channel); ?>" /> |
8 | 89 |
|
90 |
<div class="footer"> |
|
91 |
<b><?php echo $nick; ?> is a privacy-respecting bot.</b> <a href="privacy.php">Read about what information <?php echo $nick; ?> collects</a> |
|
92 |
</div> |
|
93 |
</body> |
|
94 |
</head> |