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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
<?php
htmlHeader();
?>
<body>
<?php
topbar($Links);
include_once('./includes/datas.php');
include_once('./includes/maps.php');
include_once('./includes/mapoftheday.php');
include_once('./includes/sqlEmbedded.php');
include_once('./includes/playerStats.php');
include_once('./includes/chats.php');
if ($_GET['applyall'] == 'true') {
echo "Apply-All command heard. Executing...";
//TODO: Horrible hackery shall follow...
$res = mysqli_query($mysqli, "SELECT count(*) as count FROM `users`");
$row = mysqli_fetch_assoc($res);
$memberCount = $row['count'];
$x = 0;
// +40 because there's missing userID's... Don't judge me...- I'm going to fix it.
while ($x <= $memberCount + 40) {
$x++;
$i = 0;
while ($i <= 4) {
$i++;
applyAchievements($x, $i);
}
}
echo "Execution complete!";
}
else if ($_GET['recalcStats'] == 'true') {
echo "Recalculating all player stats...";
flush(); //This sends the above echo
recalculateStatsForAllPlayers();
echo "Complete!";
}
else if ($_GET['deleteErrors'] == 'true') {
echo "Deleting error log...";
flush(); //This sends the above echo
$today = date("Y-m-d H:i:s");
file_put_contents("includes/errorlogs.txt", "LOG START $today \n");
echo "Log restarted!";
}
else if ($_POST['muteUser'] == 'true') {
muteUser($_POST['muteUserID'], $_POST['muteMinutes']);
echo "User ID ".$_POST['muteUserID']." muted for ".$_POST['muteMinutes']." minutes";
}
$sql = "SELECT `ID`, `displayName`, `dateJoined`, `dateLogin`, `email`, `isAdmin` FROM `users`";
$result = mysql_query($sql);
$res = mysqli_query($mysqli, "SELECT count(*) as count FROM `emailQueue`");
$row = mysqli_fetch_assoc($res);
$count = $row['count'];
?>
<center>
<h3>Administrators Page</h3>
<h2>There are <? echo $count; ?> emails in emailQueue.</h2>
<p>News:</p>
<p>Buttons:<br />
<input type="button" value="Apply all achievements" onClick="parent.location='admin?applyall=true'">
<input type="button" value="Recalculate all player stats" onClick="parent.location='admin?recalcStats=true'">
<input type="button" value="Delete Errorlog" onClick="parent.location='admin?deleteErrors=true'">
</p>
<p>Links: <a href="errorlogs">View Errorlog.txt</a></p>
<form action="admin" method="post" id='muteOptions'>
<input type="hidden" name="muteUser" value="true">
<input type="submit" value='MUTE USER'>
USERID:<input type="text" name="muteUserID" id="muteUserID" value="" maxlength="20" autocomplete="off" >
LENGTH IN MINUTES:<input type="text" name="muteMinutes" id="muteMinutes" value="" maxlength="20" autocomplete="off" >
</form>
</center>
<table style="padding-left:20px;">
<tr>
<th>ID</th><th>Display name:</th><th>Joined On:</th><th>Last Logon</th><th>Email</th><th>Administrator</th>
</tr>
<?
while (list($CUID, $CUsername, $Joined, $LastLogon, $email, $isAdmin) = mysql_fetch_row($result)) {
//$Joined = Date("d/m/y - g:ia", $Joined);
$Joined = strtotime($Joined);
//$Joined = relative_date($Joined);
$Joined = date("Y-m-d", $Joined);
$LastLogon = strtotime($LastLogon);
//$LastLogon = relative_date($LastLogon);
$LastLogon = date("Y-m-d", $LastLogon);
if ($isAdmin == 1)
$isAdmin = "Yes";
else
$isAdmin = "No";
Echo "<tr>
<td>$CUID</td>
<td><a href='javascript:;'>$CUsername</a></td>
<td>$Joined</td>
<td>$LastLogon</td>
<td>$email</td>
<td>$isAdmin</td>
</tr>";
}
Echo "
</table>
<br />
<br />
</td>
</tr>
</table>
";
htmlFooter();
?>
|