-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcheaterboard.php
321 lines (221 loc) · 8.5 KB
/
cheaterboard.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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<?php
include_once '../client/facebook.php';
// some basic library functions
include_once 'lib.php';
// this defines some of your basic setup
include_once 'config.php';
global $DB;
require_once 'header.php';
$type= get_team($user);
//print_r(get_audited_users());
$team_listing = $_REQUEST['team'];
$sort_listing = $_REQUEST['sort'];
$in = $_REQUEST['i'];
if(isset($in)) {
$facebook->redirect("$facebook_canvas_url/install.php?i=$in");
}
//print_r($user);
$user_in_db = is_user_in_db($user);
if($user_in_db ==0) {
$facebook->redirect("$facebook_canvas_url/install.php");
}
$coin_total = get_coin_total($user);
$buried_coin_total = get_coin_total_buried($user);
$level = get_level($user);
print dashboard();
?>
<?php if($msg):?>
<fb:success>
<fb:message><?php echo $msg; ?></fb:message>
</fb:success>
<?php endif; ?>
<div style="position: relative; text-align:center">
<?php
$uc_team_listing = ucwords($team_listing);
print "<h1 style='padding-bottom: 10px; font-size:250%'>Top $uc_team_listing Pirates!</h1>"; ?>
<?php
if(empty($team_listing)) {
$team_listing = 'overall';
}
if(empty($sort_listing)) {
$sort_listing = 'overall';
}
?>
<fb:tabs>
<fb:tab-item href='leaderboard.php' title='Overall' selected='<?php echo ($team_listing == 'overall'); ?>'/>
<fb:tab-item href='leaderboard.php?sort=<?php echo $sort_listing; ?>&team=buccaneer' title='Top Buccaneer Pirates' selected='<?php echo ($team_listing == 'buccaneer'); ?>' />
<fb:tab-item href='leaderboard.php?sort=<?php echo $sort_listing; ?>&team=corsair' title='Top Corsair Pirates' selected='<?php echo ($team_listing == 'corsair'); ?>' />
<fb:tab-item href='leaderboard.php?sort=<?php echo $sort_listing; ?>&team=barbary' title='Top Barbary Pirates' selected='<?php echo ($team_listing == 'barbary'); ?>'/>
</fb:tabs>
<?php
require_once 'cheater_ids.php';
///ISOLATED SERVER FOR CHEATERS
if(!in_array($user, $cheaters)) {
$facebook->redirect('index.php');
}
?>
<fb:explanation><fb:message>Ahoy! If you see this message, your account has been been moved to a different pirate server! There are now about 60 users on this server, and there are less rules compared to the main pirates server.<br><br>You were moved here because of using multiple accounts to advance one account, using automation, or other suspicious activity. (<a href='rules.php'>main pirate server rules</a>)<br><br>Your Coins, Levels, Booty have not been transferred to this new server. Every one of the new 'advanced' players is starting at level 0. It should be pretty easy to make this leaderboard even without yer old booty, so go get it! :)<br><br>Setting this system up and finding who to put in it was not fun for me. I don't want to ban anyone or stop people from having fun in the game (especially passionate users like you guys), but keeping the game fun for the majority of players is the most important thing.<br><br>
Arrrr.....</fb:message></fb:explanation>
<?php
//}
?>
<div style='text-align:center; margin-bottom:0px; padding-top:10px; padding-bottom:0px'>
<p style='text-align:center; font-size:110%'>
<?php if($sort_listing == 'overall') { ?>
<strong>Overall</strong>
<?php } else { ?>
<a href='leaderboard.php?sort=overall&team=<?php echo $team_listing; ?>'>Overall</a>
<? } ?>
|
<?php if($sort_listing == 'coins') { ?>
<strong>Most Coins</strong>
<?php } else { ?>
<a href='leaderboard.php?sort=coins&team=<?php echo $team_listing; ?>'>Most Coins</a>
<? } ?>
|
<?php if($sort_listing == 'level') { ?>
<strong>Highest Level</strong>
<?php } else { ?>
<a href='leaderboard.php?sort=level&team=<?php echo $team_listing; ?>'>Highest Level</a>
<? } ?>
</p>
</div>
<?php
global $memcache;
if($team_listing == 'overall') {
if($sort_listing == 'overall') {
$r = $memcache->get("leaderboard");
if($r == FALSE) {
$sql = "SELECT id, name, level , buried_coin_total, created_at, level * buried_coin_total b FROM users ORDER BY b DESC LIMIT 50";
$r = $DB->GetArray($sql);
$memcache->set("leaderboard", $r, false, 3600 * 6);
}
}
else if ($sort_listing == 'coins') {
$r = $memcache->get("leaderboard_coins");
if($r == FALSE) {
$sql = "SELECT id, name, level , buried_coin_total, created_at, buried_coin_total b FROM users ORDER BY b DESC LIMIT 50";
$r = $DB->GetArray($sql);
$memcache->set("leaderboard_coins", $r, false, 3600 * 6);
}
}
else if ($sort_listing == 'level') {
$r = $memcache->get("leaderboard_level");
if($r == FALSE) {
$sql = "SELECT id, name, level , buried_coin_total, created_at, level b FROM users ORDER BY b DESC LIMIT 50";
$r = $DB->GetArray($sql);
$memcache->set("leaderboard_level", $r, false, 3600 * 6);
}
}
}
else {
if($sort_listing == 'overall') {
$r = $memcache->get("leaderboard_$team_listing");
if($r == FALSE) {
$sql = "SELECT id, name, level , buried_coin_total, created_at, level * buried_coin_total b FROM users where team = ? ORDER BY b DESC LIMIT 50";
$r = $DB->GetArray($sql, array($team_listing));
$memcache->set("leaderboard_$team_listing", $r, false, 3605 * 6);
}
}
else if($sort_listing == 'coins') {
$r = $memcache->get("leaderboard_coins_$team_listing");
if($r == FALSE) {
$sql = "SELECT id, name, level , buried_coin_total, created_at, buried_coin_total b FROM users where team = ? ORDER BY b DESC LIMIT 50";
$r = $DB->GetArray($sql, array($team_listing));
$memcache->set("leaderboard_coins_$team_listing", $r, false, 3605 * 6);
}
}
else if($sort_listing == 'level') {
$r = $memcache->get("leaderboard_level_$team_listing");
if($r == FALSE) {
$sql = "SELECT id, name, level , buried_coin_total, created_at, level b FROM users where team = ? ORDER BY b DESC LIMIT 50";
$r = $DB->GetArray($sql, array($team_listing));
$memcache->set("leaderboard_level_$team_listing", $r, false, 3605 * 6);
}
}
}
?>
<center>
<table cellspacing='10px' style='margin:10px; margin-top:0px; padding-top:0px;'><tr><td valign='top'>
<?php
//print_r($r);
foreach($r as $key => $value) {
//echo "key $key";
//echo "value $value";
//print_r($value);
$id = $value['id'];
$score = $value['b'];
$level = $value['level'];
$created_at = date("F j, Y", strtotime($value['created_at']));
$buried_coin_total = $value['buried_coin_total'];
$rank = $key + 1;
$buried_coin_total = number_format($buried_coin_total);
echo "<div style='padding-top:10px'><center><table cellpadding='5px' cellspacing='5px' width='400px' border=0 style='padding:5px; padding-top:10px; border: 5px solid #3B5998; text-align:center'><tr><td width='25px' style='font-size:200%'><h1 style='font-size:200%'>$rank</h1></td><td width='75px'>";
echo "<fb:profile-pic size='square' uid = '$id'/>";
echo "</td><td style='font-size:150%'><fb:name uid = '$id' /><br><span style='font-size:75%'>Pirate Since $created_at</span><br>";
if($sort_listing == 'level') {
echo "<strong>level: $level</strong> ";
}
else {
echo "level: $level ";
}
if($sort_listing == 'coins') {
echo "<strong>gold: $buried_coin_total</strong>";
}
else {
echo "gold: $buried_coin_total ";
}
echo "</td></tr></table></center></div>";
}
?>
</div>
</td><td valign='top'> <br>
<div>
<?php
print adsense_120($user);
?>
<div><br><br><br><div>
<?php
print rmx_120($user);
?>
<br> <?php
print adsense_200_200($user);
?>
</div>
</td></tr></table></center>
<br><br>
<?php
?>
<br>
<h3 style="text-align:center; padding-top: 5px; padding-bottom: 10px"><a href="index.php">Go back to sea</a> -adventure, danger and treasure await</h3>
<?php
//require_once "my_pirate.inc.php";
//require_once "world_stats.inc.php";
//set_profile($user);
require_once 'world_stats.inc.php';
print adsense_468($user);
//print adsense_468($user);
?>
<?php
$moderators = get_moderators();
$banned = get_banned();
if (in_array($user, $moderators )) {
$candelete = 'true';
}
else {
$candelete = 'false';
}
if (in_array($user, $banned )) {
$canpost = 'false';
}
else {
$canpost = 'true';
}
?>
<br><br>
<fb:comments showform="true" xid="leaderboard_comments" canpost="<?php echo $canpost; ?>" candelete="<?php echo $candelete; ?>" returnurl="<?php echo $facebook_canvas_url; ?>/leaderboard.php">
<fb:title>Pirate Leaderboard</fb:title>
</fb:comments>
<?php
require_once 'ad_bottom.inc.php';
require_once 'footer.php'; ?>