author | Dan |
Sat, 10 Jan 2009 14:08:11 -0500 | |
changeset 49 | 4c4d69b2cd4d |
parent 46 | 186507f67064 |
child 52 | a8f0e99883d1 |
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; |
|
44
73f74d395f95
Added theme support. Oh yeah, you can customize graphs using graph_{line,bar}.def.
Dan
parents:
34
diff
changeset
|
8 |
|
73f74d395f95
Added theme support. Oh yeah, you can customize graphs using graph_{line,bar}.def.
Dan
parents:
34
diff
changeset
|
9 |
$title = "$nick - Statistics"; |
73f74d395f95
Added theme support. Oh yeah, you can customize graphs using graph_{line,bar}.def.
Dan
parents:
34
diff
changeset
|
10 |
require("./themes/$webtheme/header.php"); |
8 | 11 |
?> |
12 |
<div style="float: right;"> |
|
13 |
<p> |
|
14 |
<?php |
|
15 |
$tz_display = str_replace('_', ' ', str_replace('/', ': ', $tz)); |
|
16 |
echo 'Time zone: ' . $tz_display . ' [<a href="changetz.php">change</a>]<br />'; |
|
20 | 17 |
echo '<small>The time now is ' . date('H:i:s') . '.<br />Statistics now updated constantly (see <a href="news.php">news</a>)</small>'; |
8 | 18 |
?> |
19 |
</p> |
|
20 |
<p> |
|
21 |
<big><b>Channels:</b></big><br /> |
|
22 |
<?php |
|
23 |
foreach ( $channels as $i => $c ) |
|
24 |
{ |
|
25 |
$bold = ( $c == $channel ); |
|
26 |
echo $bold ? '<b>' : ''; |
|
27 |
echo $bold ? '' : '<a href="index.php?channel=' . urlencode($c) . '">'; |
|
28 |
echo $c; |
|
29 |
echo $bold ? '' : '</a>'; |
|
30 |
echo $bold ? '</b>' : ''; |
|
31 |
echo $i == count($channels) - 1 ? '' : ' | '; |
|
32 |
} |
|
33 |
?> |
|
34 |
</p> |
|
35 |
</div> |
|
36 |
<h1>Active members</h1> |
|
37 |
<p>For the last 1, 5, and 15 minutes: |
|
38 |
<?php echo count(stats_activity_percent($channel, 1)) . ', ' . |
|
39 |
count(stats_activity_percent($channel, 5)) . ', ' . |
|
40 |
count(stats_activity_percent($channel, 15)) . ' (respectively)'; |
|
41 |
?> |
|
42 |
</p> |
|
43 |
<h1>Currently active members:</h1> |
|
44 |
<p>These people have posted in the last 3 minutes:</p> |
|
45 |
<ul> |
|
46 |
<?php |
|
47 |
$datum = stats_activity_percent($channel, 3); |
|
48 |
$count = stats_message_count($channel, 3); |
|
49 |
if ( empty($datum) ) |
|
50 |
echo '<li>No recent posts.</li>'; |
|
11 | 51 |
foreach ( $datum as $usernick => $pct ) |
8 | 52 |
{ |
53 |
$total = round($pct * $count); |
|
54 |
$pct = round(100 * $pct, 1); |
|
11 | 55 |
echo "<li>$usernick - $pct% ($total)</li>\n"; |
8 | 56 |
} |
57 |
?> |
|
58 |
</ul> |
|
59 |
<p>Last 20 minutes:</p> |
|
60 |
<ul> |
|
61 |
<?php |
|
62 |
$datum = stats_activity_percent($channel, 20); |
|
63 |
$count = stats_message_count($channel, 20); |
|
64 |
if ( empty($datum) ) |
|
65 |
echo '<li>No recent posts.</li>'; |
|
11 | 66 |
foreach ( $datum as $usernick => $pct ) |
8 | 67 |
{ |
68 |
$total = round($pct * $count); |
|
69 |
$pct = round(100 * $pct, 1); |
|
11 | 70 |
echo "<li>$usernick - $pct% ($total)</li>\n"; |
8 | 71 |
} |
72 |
?> |
|
73 |
</ul> |
|
45 | 74 |
<h1>Last 60 minutes</h1> |
75 |
<img alt="Graph image" src="graph.php?mode=lasthour&channel=<?php echo urlencode($channel); ?>" /> |
|
8 | 76 |
<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
|
77 |
<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
|
78 |
<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
|
79 |
<img alt="Graph image" src="graph.php?mode=lastweek&channel=<?php echo urlencode($channel); ?>" /> |
44
73f74d395f95
Added theme support. Oh yeah, you can customize graphs using graph_{line,bar}.def.
Dan
parents:
34
diff
changeset
|
80 |
<?php |
73f74d395f95
Added theme support. Oh yeah, you can customize graphs using graph_{line,bar}.def.
Dan
parents:
34
diff
changeset
|
81 |
require("./themes/$webtheme/footer.php"); |
73f74d395f95
Added theme support. Oh yeah, you can customize graphs using graph_{line,bar}.def.
Dan
parents:
34
diff
changeset
|
82 |