-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathonline.php
97 lines (90 loc) · 4.3 KB
/
online.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
94
95
96
97
<?
$sql = "SELECT user_id, username, premiumaccount, admin, online, buddy, blocklist,ismobile FROM gebruikers WHERE online+'1000'>'" . time() . "' ORDER BY rank DESC, rankexp DESC, username ASC";
$expire = 1;
$records = query_cache("online", $sql, $expire);
$aantal = count($records);
$teller = 0;
#Beeld weergave
?>
<p>
<h3>
<?php
if ($aantal > 0) echo $txt['online_users'] . ' (' . $aantal . '):';
else echo $txt['nobody_online']; ?>
</h3><br/>
<?
if ($aantal > 0) {
foreach ($records as $id => $online) {
$fixt = ',' . $online['user_id'] . ',';
//Bij elk lid bij de teller 1 op tellen
$teller++;
//Name dik gedrukt maken als de online speler een admin is
if ($online['admin'] == 0) {
$type = "User";
$color = "black";
$img = "images/icons/user.png";
}
elseif ($online['admin'] == 1) {
$type = "Moderator";
$color = "blue";
$img = "images/icons/user_mod.png";
}
elseif ($online['admin'] == 2) {
$type = "Administrator";
$color = "purple";
$img = "images/icons/user_suit.png";
}
elseif ($online['admin'] == 3) {
$type = "Eigenaar";
$color = "red";
$img = "images/icons/user_admin.png";
} else {
$type = "User";
$color = "black";
$img = "images/icons/user.png";
}
//Premiumaccount check, true = ster
if (($online['premiumaccount'] > 0) && ($online['admin'] == 0)) {
$star = '<img src="images/icons/lidbetaald.png" width="16" height="16" border="0" alt="Premiumlid" title="Premiumlid" style="margin-bottom:-3px;">';
} else {
$star = '';
}
//is user mobile
if ($online['ismobile']) {
$type = "Op mobiel";
$img = "images/icons/mobile.png";
}
if($online['username'] != $_SESSION['naam']){
$link = "javascript:chatWith('" . $online['username'] . "')";
}else{
$link = "?page=profile&player=" . $online['username'];
}
if ($aantal == 1) {
echo "<a href=".$link."><span style='color: ".$color.";'><b>" . $online['username'] . "</b></span> <img src='".$img."' width='16' height=16 border=0 alt='".$type."' title='".$type."' style='margin-bottom:-3px;'></a> ".$star;
}
elseif ($aantal > $teller) {
echo "<a href=".$link."><span style='color: ".$color.";'><b>" . $online['username'] . "</b></span> <img src='".$img."' width='16' height=16 border=0 alt='".$type."' title='".$type."' style='margin-bottom:-3px;'></a> ".$star." | ";
}
else {
echo "<a href=".$link."><span style='color: ".$color.";'><b>" . $online['username'] . "</b></span> <img src='".$img."' width='16' height=16 border=0 alt='".$type."' title='".$type."' style='margin-bottom:-3px;'></a> ".$star;
}
}
}
?>
<hr>
<br/>
<b><span style='color: Red;'>Naam</span></b> <img src="images/icons/user_admin.png" width="16" height="16" border="0"
alt="Crew" title="Owner" style="margin-bottom:-3px;"> = Eigenaar ||
<b><span
style='color: blue;'>Naam</span></b> <img src="images/icons/user_mod.png" width="16" height="16" border="0"
alt="Crew" title="Moderator"
style="margin-bottom:-3px;"> = Moderator || <b><span
style='color: Black;'>Naam</span></b> <img src="images/icons/user.png" width="16" height="16" border="0"
alt="User" title="Speler" style="margin-bottom:-3px;"> = Speler || <b><span
style='color: dimgrey;'>Naam</span></b> <img src="images/icons/mobile.png" width="16" height="16" border="0"
alt="User" title="Speler" style="margin-bottom:-3px;"> = Mobiel <a
href="?page=rankinglist" style='float:right;'><img src="images/icons/all.png" width="16"
height="16" border="0" alt="Ledenlijst"
title="Leden" style="margin-bottom:-3px;">
Ledenlijst</a>
</p>