-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
74 lines (60 loc) · 2.56 KB
/
index.php
File metadata and controls
74 lines (60 loc) · 2.56 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
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
<style>
#discord-window { height: 300px; overflow: hidden; width: 250px; }
#discord-scrollable { height: 260px;overflow: auto; }
#discord-scrollable ul { list-style: none; padding: 0; margin: 0; font-size: 13px; line-height:22px; }
#discord-scrollable ul img{ border-radius: 50%; }
#discord-onlinecount{ text-align: left; font-size: 14px; margin-bottom: 10px; }
#discord-scrollable::-webkit-scrollbar { width: 0px; }
#discord-footer { height: 35px; margin-top: 5px; text-align: center; border-color: #1a1a1a; border-width: 2px; border-style: solid; }
#discord-footer a{ line-height:32px; text-align: center; text-decoration: none; }
</style>
<?php
$data = file_get_contents('https://discordapp.com/api/guilds/252132679212990465/widget.json');
$data = json_decode($data, true);
$discord['name'] = $data['name'];
$discord['invite'] = $data['instant_invite'];
$staff = ['LuckyBowers','MFN','LamboCreeper','Turb0Bacon','Maeyrl','DrunkRussianBear'];
foreach ($data['channels'] as $channel){
$discord['channels'][$channel['position']] = $channel['name'];
}
foreach ($data['members'] as $index=>$member){
if (!$member['bot']){
if (in_array($member['username'], $staff)){
$discord['admins'][$index]['username'] = $member['username'];
$discord['admins'][$index]['disc'] = $member['discriminator'];
$discord['admins'][$index]['avatar'] = $member['avatar_url'];
$discord['admins'][$index]['status'] = $member['status'];
}else{
$discord['members'][$index]['username'] = $member['username'];
$discord['members'][$index]['disc'] = $member['discriminator'];
$discord['members'][$index]['avatar'] = $member['avatar_url'];
$discord['members'][$index]['status'] = $member['status'];
}
}
}
$discord['online'] = count($discord['members']);
?>
<div class="widget">
<div id="discord-window">
<div id="discord-scrollable">
<p id="discord-onlinecount"><?php echo $discord['online']; ?> Members Online..</p>
<ul>
<?php
foreach ($discord['members'] as $member){
$username = $member['username'];
$avatar = $member['avatar'];
echo "<li><img src='$avatar' height='22px'> $username</li>";
}
foreach ($discord['admins'] as $member) {
$username = $member['username'];
$avatar = $member['avatar'];
echo "<li><img src='$avatar' height='22px'> <span class='lb-text-red'>ADMIN</span> $username</li>";
}
?>
</ul>
</div>
<div id="discord-footer">
<a href="<?php echo $discord['invite']; ?>">Connect</a>
</div>
</div>
</div>