This repository has been archived by the owner on Jul 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
236 lines (190 loc) · 6.82 KB
/
index.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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE HTML>
<?php
// api and config
require 'mojang-api.class.php';
include("config.php");
// mysql connecting
$pdo = new PDO('mysql:host='.$ip.';dbname='.$database.'', $user, $password);
?>
<html>
<head>
<title><?php echo $richname; ?></title>
<meta name="description" content="<?php echo $richtext; ?>">
<meta name="theme-color" content="#424242">
<meta charset="UTF-8">
<noscript>
<link rel="stylesheet" href="css/skel.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-xlarge.css" />
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
</noscript>
<script src='https://www.google.com/recaptcha/api.js'></script>
<style>
table {
width: 100%;
margin: 2em 0;
border-collapse: collapse;
word-break:normal;
}
td {
padding: .5em;
vertical-align: top;
border: 1px solid #bbbbbb;
}
th {
padding: .5em;
text-align: left;
border: 1px solid #bbbbbb;
border-bottom: 3px solid #bbbbbb;
background:#f4f7fa;
}
.table-scrollable {
width: 100%;
overflow-y: auto;
margin: 0 0 1em;
}
.table-scrollable::-webkit-scrollbar {
-webkit-appearance: none;
width: 14px;
height: 14px;
}
.table-scrollable::-webkit-scrollbar-thumb {
border-radius: 8px;
border: 3px solid #fff;
background-color: rgba(0, 0, 0, .3);
}
</style>
</head>
<body id="landing">
<!-- Header -->
<header id="header">
<h1><a href="<?php echo $maindomain; ?>"><?php echo $servername; ?></a></h1>
<nav id="nav">
<ul>
<li><a href="<?php echo $domain;?>">Startseite</a></li>
</ul>
</nav>
</header>
<!-- One -->
<section class="wrapper style special">
<header class="major">
<h2><?php echo $servername; ?></h2>
</header>
<div class="container">
<div class="row">
<div class="6u 12u$(medium)">
<section class="box">
<h3>Spieler suchen</h3>
<p></p>
<form id="playersearch" action="search.php" method="post">
<p>Spielername: <input type="text" name="username" class="form-control" placeholder="Spielername" required /></p>
<p></p>
<input type="submit" value="Spieler suchen" />
<p></p>
</form>
</section>
</div>
<div class="6u 12u$(medium)">
<section class="box">
<h3>DkCoins Stats</h3>
<h4>Version: <?php echo $version;?> von TheSystems</h4>
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://project.the-systems.eu/api/resource/?resourceid=4&type=latest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 2,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
?><h4>Ein Fehler beim Versions-Überprüfen ist aufgetreten.</h4><?php
} else {
$response = json_decode($response);
if($response->name == $version){
?><h4>Du nutzt die neuste Version.</h4><?php
} else {
?><h4>Du nutzt eine alte Version. Die neuste ist: <?php echo $response->name; ?></h4><?php
}
}
?>
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://project.the-systems.eu/api/resource/?resourceid=4&type=info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 2,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
?><h4>Ein Fehler beim Versions-Überprüfen ist aufgetreten.</h4><?php
} else {
$response = json_decode($response);
$support = $response->support;
$url = $response->url;
}
?>
<p></p>
<p><a href="<?php echo $support; ?>" class="button">Support Discord</a></p>
<p><a href="<?php echo $url; ?>" class="button">Webseite</a></p>
</section>
</div>
<div class="12u 12u$(medium)">
<section class="box">
<h3>Top <?php echo $topplayeramount;?> Coins</h3>
<div class="table-scrollable">
<table>
<tr>
<th>Rang</th>
<th>Name</th>
<th></th>
<th>Coins</th>
</tr>
<?php
// mysql data
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$statement = $pdo->prepare("SELECT * FROM DKCoins_players ORDER BY coins DESC LIMIT :top");
$statement->execute(array('top' => $topplayeramount));
$anzahl_user = $statement->rowCount();
if ($anzahl_user != "0") {
// users found
$num = 1;
while($row = $statement->fetch()) {
echo '<tr>';
echo '<td>'.$num++.'.</td>';
echo '<td>'.$row['name'].'</td>';
echo '<td><img src="https://minotar.net/helm/'.$row['name'].'/50" class="img-responsive"></td>';
echo '<td>'.$row['coins'].'</td>';
echo '</tr>';
}
} else {
// no users in db found
echo '
<tr>
<td>-</td>
<td>-</td>
<td><img src="https://minotar.net/helm/Notch/50" class="img-responsive"></td>
<td>-</td>
</tr>';
}
?>
</section>
</div>
</section>
</div>
</section>
<script src="js/jquery.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-layers.min.js"></script>
<script src="js/init.js"></script>
</body>
</html>