-
Notifications
You must be signed in to change notification settings - Fork 28
/
gloperator_log.php
93 lines (82 loc) · 2.5 KB
/
gloperator_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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
require_once("bootstrap.inc.php");
class PouetBoxGloperatorLog extends PouetBox
{
public $logs;
function __construct()
{
parent::__construct();
$this->uniqueID = "pouetbox_gloperatorlog";
$this->title = "edits for this "._html($_GET["what"]).":";
}
function LoadFromDB()
{
$q = new BM_Query();
$q->AddField("gloperator_log.*");
$q->AddTable("gloperator_log");
$q->AddWhere(sprintf_esc("itemType = '%s'",$_GET["what"]));
$q->AddWhere(sprintf_esc("itemID = %d",$_GET["which"]));
$q->attach(array("gloperator_log"=>"gloperatorID"),array("users as gloperator"=>"id"));
$q->AddOrder("date desc");
$this->logs = $q->perform();
}
function RenderBody() {
global $THREAD_CATEGORIES;
echo "<table class='boxtable'>\n";
$n = 0;
echo "<tr>\n";
echo " <th>date</th>\n";
echo " <th>glöperator</th>\n";
echo " <th>action</th>\n";
echo " <th>more info</th>\n";
echo "</tr>\n";
foreach ($this->logs as $r) {
echo "<tr>\n";
echo " <td>"._html($r->date)."</td>\n";
echo " <td>".$r->gloperator->PrintLinkedAvatar()." ".$r->gloperator->PrintLinkedname()."</td>\n";
echo " <td>"._html($r->action)."</td>\n";
echo " <td>";
global $REQUESTTYPES;
if (@$REQUESTTYPES[$r->action])
{
echo $REQUESTTYPES[$r->action]::Display( $_GET["which"], json_decode($r->additionalData,true) );
}
else
{
switch($r->action)
{
default:
{
echo _html($r->additionalData);
} break;
}
}
echo "</td>";
echo "</tr>\n";
}
echo "</table>\n";
echo "<div class='foot'>";
switch ($_GET["what"])
{
case "prod": printf("<a href='prod.php?which=%d'>back to the prod</a>",$_GET["which"]); break;
case "group": printf("<a href='groups.php?which=%d'>back to the group</a>",$_GET["which"]); break;
case "topic": printf("<a href='topic.php?which=%d'>back to the topic</a>",$_GET["which"]); break;
case "party": printf("<a href='party.php?which=%d'>back to the party</a>",$_GET["which"]); break;
}
echo "</div>\n";
}
};
$TITLE = "glöperator log";
require_once("include_pouet/header.php");
require("include_pouet/menu.inc.php");
echo "<div id='content'>\n";
if (@$_GET["what"] && @$_GET["which"])
{
$box = new PouetBoxGloperatorLog();
$box->Load();
$box->Render();
}
echo "</div>\n";
require("include_pouet/menu.inc.php");
require_once("include_pouet/footer.php");
?>