-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathonline.php
More file actions
46 lines (39 loc) · 1.09 KB
/
online.php
File metadata and controls
46 lines (39 loc) · 1.09 KB
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
<?php
$pagetitle = 'Online Characters';
$NEEDPUB = true;
require 'common.php';
$tpl->limit = $topplayers;
if ($online)
{
if (empty($onlinelist))
{
$tpl->message = "No characters are currently online.";
$tpl->Execute(null);
exit;
}
foreach ($onlinelist as &$character)
{
if ($character['name'])
{
$character['name'] = ucfirst($character['name']);
$character['title'] = empty($character['title'])?'-':ucfirst($character['title']);
$character['gm'] = $character['admin'] == 4 || $character['admin'] == 5 || $character['admin'] == 9 || $character['admin'] == 10;
$character['class_str'] = class_str($character['class']);
$char = webcp_db_fetchall("SELECT COALESCE(a.lastip, a.regip) AS ip FROM characters c LEFT JOIN accounts a ON a.username = c.account WHERE c.name = ? LIMIT 1", $character['name']);
if (isset($char[0]))
$char = $char[0];
else
$char = null;
$character['ip'] = $char['ip'];
}
}
unset($character);
$tpl->characters = $onlinelist;
$tpl->Execute('online');
}
else
{
$tpl->message = "Server is offline";
$tpl->Execute(null);
exit;
}