-
Notifications
You must be signed in to change notification settings - Fork 0
/
display-log.php
61 lines (51 loc) · 1.96 KB
/
display-log.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
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/***********************************************
Zurich Water Game: internet version
Author: Nigel Gilbert and the FIRMA project
--------------------------------------------
display-log.php
Displays a panel showing the actions logged
Version 1.0 6 August 2001
Version 1.1 1 September 2001
Version 2.1 7 April 2002
**********************************************/
$item_limit = 100; /* display up to this number from the end of the log */
/* filter out anything with a level of detail below the log_level
unless the player is the bank (which sees everything)
However, include log_level - 1 for items that are for this particular player */
$levelminusone = $log_level - 1;
if ($playobj->id != 'bank') $filter = "WHERE detail >= '$levelminusone'";
$query = new Query("SELECT id, name, action, detail,
to_char(time, 'HH24:MI on DD Mon') as timestring
FROM log
$filter
ORDER BY id DESC
LIMIT $item_limit");
?>
<div id="diarylayer" style="position:absolute; left:320px; top:40px;
width:410px; height:340px; z-index:2; visibility:hidden;
background-color:white">
<p class=actiontext>diary of events</p>
<div id="log" style="position:absolute; left:0px; top:20px;
width:400px; height: 300; overflow: auto">
<table width="90%" border="0" cellspacing="2" cellpadding="0">
<?php
while($query->next_rec()) {
$log_time = $query->field('timestring');
$log_name = $query->field('name');
$log_action = $query->field('action');
$log_detail = $query->field('detail');
if ($log_detail > $log_level or $log_name == $player) {
echo "<tr><td colspan=3 valign=top bgcolor=white>
<span class=smalltext>$log_time</span></td>
<td width=76 valign=top bgcolor=white>
<span class=smalltext>";
echo " ". display_player_name($log_name) . " ";
echo "</span></td><td valign=top bgcolor=white>
<span class=smalltext>$log_action</span></td>\n</tr>\n";
}
}
?>
</table>
</div>
</div>