3 #################################################################################
4 ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
5 ## --------------------------------------------------------------------------- ##
6 ## Filename medals.php ##
7 ## Developed by: Dixie ##
8 ## License: TravianX Project ##
9 ## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
11 #################################################################################
13 /******************************
15 ===============================
16 == 1. Aanvallers top 10 ==
17 == 2. Defence top 10 ==
18 == 3. Klimmers top 10 ==
19 == 4. Overvallers top 10 ==
20 == 5. In att en def tegelijk ==
21 == 6. in top 3 - aanval ==
22 == 7. in top 3 - verdediging ==
23 == 8. in top 3 - klimmers ==
24 == 9. in top 3 - overval ==
25 ******************************/
26 include_once("GameEngine/Account.php");
28 mysql_connect(SQL_SERVER
, SQL_USER
, SQL_PASS
);
29 mysql_select_db(SQL_DB
);
31 if (mysql_num_rows(mysql_query("SELECT id FROM ".TB_PREFIX
."users WHERE access = 9 AND id = ".$session->uid
)) != '1') die("Hacking attemp!");
33 //bepaal welke week we zitten
34 $q = "SELECT * FROM ".TB_PREFIX
."medal order by week DESC LIMIT 0, 1";
35 $result = mysql_query($q);
36 if(mysql_num_rows($result)) {
37 $row=mysql_fetch_assoc($result);
38 $week=($row['week']+
1);
43 //Do same for ally week
44 $q = "SELECT * FROM ".TB_PREFIX
."allimedal order by week DESC LIMIT 0, 1";
45 $result = mysql_query($q);
46 if(mysql_num_rows($result)) {
47 $row=mysql_fetch_assoc($result);
48 $allyweek=($row['week']+
1);
53 //we mogen de lintjes weggeven
54 if(isset($_GET['giveout'])){
58 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY ap DESC Limit 10");
59 $i=0; while($row = mysql_fetch_array($result)){
60 $i++
; $img="t2_".($i)."";
61 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '1', '".($i)."', '".$week."', '".$row['ap']."', '".$img."')";
62 $resul=mysql_query($quer);
66 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY dp DESC Limit 10");
67 $i=0; while($row = mysql_fetch_array($result)){
68 $i++
; $img="t3_".($i)."";
69 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '2', '".($i)."', '".$week."', '".$row['dp']."', '".$img."')";
70 $resul=mysql_query($quer);
74 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY Rc DESC Limit 10");
75 $i=0; while($row = mysql_fetch_array($result)){
76 $i++
; $img="t1_".($i)."";
77 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '3', '".($i)."', '".$week."', '".$row['Rc']."', '".$img."')";
78 $resul=mysql_query($quer);
81 //Rank climbers of the week
82 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY clp DESC Limit 10");
83 $i=0; while($row = mysql_fetch_array($result)){
84 $i++
; $img="t6_".($i)."";
85 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '10', '".($i)."', '".$week."', '".$row['clp']."', '".$img."')";
86 $resul=mysql_query($quer);
89 //Overvallers v/d Week
90 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY RR DESC Limit 10");
91 $i=0; while($row = mysql_fetch_array($result)){
92 $i++
; $img="t4_".($i)."";
93 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '4', '".($i)."', '".$week."', '".$row['RR']."', '".$img."')";
94 $resul=mysql_query($quer);
97 //deel de bonus voor aanval+defence top 10 uit
98 //Pak de top10 aanvallers
99 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY ap DESC Limit 10");
100 while($row = mysql_fetch_array($result)){
102 //Pak de top10 verdedigers
103 $result2 = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY dp DESC Limit 10");
104 while($row2 = mysql_fetch_array($result2)){
105 if($row['id']==$row2['id']){
107 $query3="SELECT count(*) FROM ".TB_PREFIX
."medal WHERE userid='".$row['id']."' AND categorie = 5";
108 $result3=mysql_query($query3);
109 $row3=mysql_fetch_row($result3);
111 //kijk welke kleur het lintje moet hebben
113 $img="t22".$row3[0]."_1";
122 $tekst="three times ";
125 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '5', '0', '".$week."', '".$tekst."', '".$img."')";
126 $resul=mysql_query($quer);
132 //je staat voor 3e / 5e / 10e keer in de top 3 aanvallers
133 //Pak de top10 aanvallers
134 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY ap DESC Limit 10");
135 while($row = mysql_fetch_array($result)){
137 $query1="SELECT count(*) FROM ".TB_PREFIX
."medal WHERE userid='".$row['id']."' AND categorie = 1 AND plaats<=3";
138 $result1=mysql_query($query1);
139 $row1=mysql_fetch_row($result1);
142 //2x in gestaan, dit is 3e dus lintje (brons)
145 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '6', '0', '".$week."', 'Three', '".$img."')";
146 $resul=mysql_query($quer);
148 //4x in gestaan, dit is 5e dus lintje (zilver)
151 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '6', '0', '".$week."', 'Five', '".$img."')";
152 $resul=mysql_query($quer);
154 //9x in gestaan, dit is 10e dus lintje (goud)
157 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '6', '0', '".$week."', 'Ten', '".$img."')";
158 $resul=mysql_query($quer);
162 //je staat voor 3e / 5e / 10e keer in de top 10 aanvallers
163 //Pak de top10 aanvallers
164 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY ap DESC Limit 10");
165 while($row = mysql_fetch_array($result)){
167 $query1="SELECT count(*) FROM ".TB_PREFIX
."medal WHERE userid='".$row['id']."' AND categorie = 1 AND plaats<=10";
168 $result1=mysql_query($query1);
169 $row1=mysql_fetch_row($result1);
172 //2x in gestaan, dit is 3e dus lintje (brons)
175 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '12', '0', '".$week."', 'Three', '".$img."')";
176 $resul=mysql_query($quer);
178 //4x in gestaan, dit is 5e dus lintje (zilver)
181 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '12', '0', '".$week."', 'Five', '".$img."')";
182 $resul=mysql_query($quer);
184 //9x in gestaan, dit is 10e dus lintje (goud)
187 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '12', '0', '".$week."', 'Ten', '".$img."')";
188 $resul=mysql_query($quer);
192 //je staat voor 3e / 5e / 10e keer in de top 3 verdedigers
193 //Pak de top10 verdedigers
194 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY dp DESC Limit 10");
195 while($row = mysql_fetch_array($result)){
197 $query1="SELECT count(*) FROM ".TB_PREFIX
."medal WHERE userid='".$row['id']."' AND categorie = 2 AND plaats<=3";
198 $result1=mysql_query($query1);
199 $row1=mysql_fetch_row($result1);
202 //2x in gestaan, dit is 3e dus lintje (brons)
205 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '7', '0', '".$week."', 'Three', '".$img."')";
206 $resul=mysql_query($quer);
208 //4x in gestaan, dit is 5e dus lintje (zilver)
211 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '7', '0', '".$week."', 'Five', '".$img."')";
212 $resul=mysql_query($quer);
214 //9x in gestaan, dit is 10e dus lintje (goud)
217 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '7', '0', '".$week."', 'Ten', '".$img."')";
218 $resul=mysql_query($quer);
222 //je staat voor 3e / 5e / 10e keer in de top 3 verdedigers
223 //Pak de top10 verdedigers
224 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY dp DESC Limit 10");
225 while($row = mysql_fetch_array($result)){
227 $query1="SELECT count(*) FROM ".TB_PREFIX
."medal WHERE userid='".$row['id']."' AND categorie = 2 AND plaats<=10";
228 $result1=mysql_query($query1);
229 $row1=mysql_fetch_row($result1);
232 //2x in gestaan, dit is 3e dus lintje (brons)
235 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '13', '0', '".$week."', 'Three', '".$img."')";
236 $resul=mysql_query($quer);
238 //4x in gestaan, dit is 5e dus lintje (zilver)
241 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '13', '0', '".$week."', 'Five', '".$img."')";
242 $resul=mysql_query($quer);
244 //9x in gestaan, dit is 10e dus lintje (goud)
247 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '13', '0', '".$week."', 'Ten', '".$img."')";
248 $resul=mysql_query($quer);
253 //je staat voor 3e / 5e / 10e keer in de top 3 klimmers
254 //Pak de top10 klimmers
255 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY Rc DESC Limit 10");
256 while($row = mysql_fetch_array($result)){
258 $query1="SELECT count(*) FROM ".TB_PREFIX
."medal WHERE userid='".$row['id']."' AND categorie = 3 AND plaats<=3";
259 $result1=mysql_query($query1);
260 $row1=mysql_fetch_row($result1);
263 //2x in gestaan, dit is 3e dus lintje (brons)
266 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '8', '0', '".$week."', 'Three', '".$img."')";
267 $resul=mysql_query($quer);
269 //4x in gestaan, dit is 5e dus lintje (zilver)
272 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '8', '0', '".$week."', 'Five', '".$img."')";
273 $resul=mysql_query($quer);
275 //9x in gestaan, dit is 10e dus lintje (goud)
278 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '8', '0', '".$week."', 'Ten', '".$img."')";
279 $resul=mysql_query($quer);
281 }//je staat voor 3e / 5e / 10e keer in de top 3 klimmers
282 //Pak de top10 klimmers
283 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY Rc DESC Limit 10");
284 while($row = mysql_fetch_array($result)){
286 $query1="SELECT count(*) FROM ".TB_PREFIX
."medal WHERE userid='".$row['id']."' AND categorie = 3 AND plaats<=10";
287 $result1=mysql_query($query1);
288 $row1=mysql_fetch_row($result1);
291 //2x in gestaan, dit is 3e dus lintje (brons)
294 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '14', '0', '".$week."', 'Three', '".$img."')";
295 $resul=mysql_query($quer);
297 //4x in gestaan, dit is 5e dus lintje (zilver)
300 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '14', '0', '".$week."', 'Five', '".$img."')";
301 $resul=mysql_query($quer);
303 //9x in gestaan, dit is 10e dus lintje (goud)
306 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '14', '0', '".$week."', 'Ten', '".$img."')";
307 $resul=mysql_query($quer);
311 //je staat voor 3e / 5e / 10e keer in de top 3 klimmers
312 //Pak de top3 rank climbers
313 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY clp DESC Limit 10");
314 while($row = mysql_fetch_array($result)){
316 $query1="SELECT count(*) FROM ".TB_PREFIX
."medal WHERE userid='".$row['id']."' AND categorie = 10 AND plaats<=3";
317 $result1=mysql_query($query1);
318 $row1=mysql_fetch_row($result1);
321 //2x in gestaan, dit is 3e dus lintje (brons)
324 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '11', '0', '".$week."', 'Three', '".$img."')";
325 $resul=mysql_query($quer);
327 //4x in gestaan, dit is 5e dus lintje (zilver)
330 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '11', '0', '".$week."', 'Five', '".$img."')";
331 $resul=mysql_query($quer);
333 //9x in gestaan, dit is 10e dus lintje (goud)
336 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '11', '0', '".$week."', 'Ten', '".$img."')";
337 $resul=mysql_query($quer);
340 //je staat voor 3e / 5e / 10e keer in de top 10klimmers
341 //Pak de top3 rank climbers
342 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY clp DESC Limit 10");
343 while($row = mysql_fetch_array($result)){
345 $query1="SELECT count(*) FROM ".TB_PREFIX
."medal WHERE userid='".$row['id']."' AND categorie = 10 AND plaats<=10";
346 $result1=mysql_query($query1);
347 $row1=mysql_fetch_row($result1);
350 //2x in gestaan, dit is 3e dus lintje (brons)
353 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '16', '0', '".$week."', 'Three', '".$img."')";
354 $resul=mysql_query($quer);
356 //4x in gestaan, dit is 5e dus lintje (zilver)
359 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '16', '0', '".$week."', 'Five', '".$img."')";
360 $resul=mysql_query($quer);
362 //9x in gestaan, dit is 10e dus lintje (goud)
365 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '16', '0', '".$week."', 'Ten', '".$img."')";
366 $resul=mysql_query($quer);
370 //je staat voor 3e / 5e / 10e keer in de top 10 overvallers
371 //Pak de top10 overvallers
372 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY RR DESC Limit 10");
373 while($row = mysql_fetch_array($result)){
375 $query1="SELECT count(*) FROM ".TB_PREFIX
."medal WHERE userid='".$row['id']."' AND categorie = 4 AND plaats<=3";
376 $result1=mysql_query($query1);
377 $row1=mysql_fetch_row($result1);
380 //2x in gestaan, dit is 3e dus lintje (brons)
383 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '9', '0', '".$week."', 'Three', '".$img."')";
384 $resul=mysql_query($quer);
386 //4x in gestaan, dit is 5e dus lintje (zilver)
389 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '9', '0', '".$week."', 'Five', '".$img."')";
390 $resul=mysql_query($quer);
392 //9x in gestaan, dit is 10e dus lintje (goud)
395 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '9', '0', '".$week."', 'Ten', '".$img."')";
396 $resul=mysql_query($quer);
398 } //je staat voor 3e / 5e / 10e keer in de top 10 overvallers
399 //Pak de top10 overvallers
400 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."users ORDER BY RR DESC Limit 10");
401 while($row = mysql_fetch_array($result)){
403 $query1="SELECT count(*) FROM ".TB_PREFIX
."medal WHERE userid='".$row['id']."' AND categorie = 4 AND plaats<=10";
404 $result1=mysql_query($query1);
405 $row1=mysql_fetch_row($result1);
408 //2x in gestaan, dit is 3e dus lintje (brons)
411 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '15', '0', '".$week."', 'Three', '".$img."')";
412 $resul=mysql_query($quer);
414 //4x in gestaan, dit is 5e dus lintje (zilver)
417 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '15', '0', '".$week."', 'Five', '".$img."')";
418 $resul=mysql_query($quer);
420 //9x in gestaan, dit is 10e dus lintje (goud)
423 $quer="insert into ".TB_PREFIX
."medal(userid, categorie, plaats, week, points, img) values('".$row['id']."', '15', '0', '".$week."', 'Ten', '".$img."')";
424 $resul=mysql_query($quer);
428 //Zet alle waardens weer op 0
429 $query="SELECT * FROM ".TB_PREFIX
."users ORDER BY id+0 DESC";
430 $result=mysql_query($query);
431 for ($i=0; $row=mysql_fetch_row($result); $i++
){
432 mysql_query("UPDATE ".TB_PREFIX
."users SET ap=0, dp=0,Rc=0,clp=0, RR=0 WHERE id = ".$row[0]."");
435 //Start alliance Medals wooot
437 //Aanvallers v/d Week
438 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY ap DESC Limit 10");
439 $i=0; while($row = mysql_fetch_array($result)){
440 $i++
; $img="a2_".($i)."";
441 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '1', '".($i)."', '".$allyweek."', '".$row['ap']."', '".$img."')";
442 $resul=mysql_query($quer);
445 //Verdediger v/d Week
446 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY dp DESC Limit 10");
447 $i=0; while($row = mysql_fetch_array($result)){
448 $i++
; $img="a3_".($i)."";
449 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '2', '".($i)."', '".$allyweek."', '".$row['dp']."', '".$img."')";
450 $resul=mysql_query($quer);
453 //Overvallers v/d Week
454 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY RR DESC Limit 10");
455 $i=0; while($row = mysql_fetch_array($result)){
456 $i++
; $img="a4_".($i)."";
457 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '4', '".($i)."', '".$allyweek."', '".$row['RR']."', '".$img."')";
458 $resul=mysql_query($quer);
460 //Rank climbers of the week
461 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY clp DESC Limit 10");
462 $i=0; while($row = mysql_fetch_array($result)){
463 $i++
; $img="a1_".($i)."";
464 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '3', '".($i)."', '".$allyweek."', '".$row['clp']."', '".$img."')";
465 $resul=mysql_query($quer);
468 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY ap DESC Limit 10");
469 while($row = mysql_fetch_array($result)){
471 //Pak de top10 verdedigers
472 $result2 = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY dp DESC Limit 10");
473 while($row2 = mysql_fetch_array($result2)){
474 if($row['id']==$row2['id']){
476 $query3="SELECT count(*) FROM ".TB_PREFIX
."allimedal WHERE allyid='".$row['id']."' AND categorie = 5";
477 $result3=mysql_query($query3);
478 $row3=mysql_fetch_row($result3);
480 //kijk welke kleur het lintje moet hebben
482 $img="t22".$row3[0]."_1";
491 $tekst="three times ";
494 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '5', '0', '".$allyweek."', '".$tekst."', '".$img."')";
495 $resul=mysql_query($quer);
501 //je staat voor 3e / 5e / 10e keer in de top 3 aanvallers
502 //Pak de top10 aanvallers
503 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY ap DESC Limit 10");
504 while($row = mysql_fetch_array($result)){
506 $query1="SELECT count(*) FROM ".TB_PREFIX
."allimedal WHERE allyid='".$row['id']."' AND categorie = 1 AND plaats<=3";
507 $result1=mysql_query($query1);
508 $row1=mysql_fetch_row($result1);
511 //2x in gestaan, dit is 3e dus lintje (brons)
514 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '6', '0', '".$allyweek."', 'Three', '".$img."')";
515 $resul=mysql_query($quer);
517 //4x in gestaan, dit is 5e dus lintje (zilver)
520 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '6', '0', '".$allyweek."', 'Five', '".$img."')";
521 $resul=mysql_query($quer);
523 //9x in gestaan, dit is 10e dus lintje (goud)
526 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '6', '0', '".$allyweek."', 'Ten', '".$img."')";
527 $resul=mysql_query($quer);
531 //je staat voor 3e / 5e / 10e keer in de top 10 aanvallers
532 //Pak de top10 aanvallers
533 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY ap DESC Limit 10");
534 while($row = mysql_fetch_array($result)){
536 $query1="SELECT count(*) FROM ".TB_PREFIX
."allimedal WHERE allyid='".$row['id']."' AND categorie = 1 AND plaats<=10";
537 $result1=mysql_query($query1);
538 $row1=mysql_fetch_row($result1);
541 //2x in gestaan, dit is 3e dus lintje (brons)
544 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '12', '0', '".$allyweek."', 'Three', '".$img."')";
545 $resul=mysql_query($quer);
547 //4x in gestaan, dit is 5e dus lintje (zilver)
550 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '12', '0', '".$allyweek."', 'Five', '".$img."')";
551 $resul=mysql_query($quer);
553 //9x in gestaan, dit is 10e dus lintje (goud)
556 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '12', '0', '".$allyweek."', 'Ten', '".$img."')";
557 $resul=mysql_query($quer);
561 //je staat voor 3e / 5e / 10e keer in de top 3 verdedigers
562 //Pak de top10 verdedigers
563 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY dp DESC Limit 10");
564 while($row = mysql_fetch_array($result)){
566 $query1="SELECT count(*) FROM ".TB_PREFIX
."allimedal WHERE allyid='".$row['id']."' AND categorie = 2 AND plaats<=3";
567 $result1=mysql_query($query1);
568 $row1=mysql_fetch_row($result1);
571 //2x in gestaan, dit is 3e dus lintje (brons)
574 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '7', '0', '".$allyweek."', 'Three', '".$img."')";
575 $resul=mysql_query($quer);
577 //4x in gestaan, dit is 5e dus lintje (zilver)
580 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '7', '0', '".$allyweek."', 'Five', '".$img."')";
581 $resul=mysql_query($quer);
583 //9x in gestaan, dit is 10e dus lintje (goud)
586 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '7', '0', '".$allyweek."', 'Ten', '".$img."')";
587 $resul=mysql_query($quer);
591 //je staat voor 3e / 5e / 10e keer in de top 3 verdedigers
592 //Pak de top10 verdedigers
593 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY dp DESC Limit 10");
594 while($row = mysql_fetch_array($result)){
596 $query1="SELECT count(*) FROM ".TB_PREFIX
."allimedal WHERE allyid='".$row['id']."' AND categorie = 2 AND plaats<=10";
597 $result1=mysql_query($query1);
598 $row1=mysql_fetch_row($result1);
601 //2x in gestaan, dit is 3e dus lintje (brons)
604 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '13', '0', '".$allyweek."', 'Three', '".$img."')";
605 $resul=mysql_query($quer);
607 //4x in gestaan, dit is 5e dus lintje (zilver)
610 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '13', '0', '".$allyweek."', 'Five', '".$img."')";
611 $resul=mysql_query($quer);
613 //9x in gestaan, dit is 10e dus lintje (goud)
616 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '13', '0', '".$allyweek."', 'Ten', '".$img."')";
617 $resul=mysql_query($quer);
624 //je staat voor 3e / 5e / 10e keer in de top 3 klimmers
625 //Pak de top3 rank climbers
626 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY clp DESC Limit 10");
627 while($row = mysql_fetch_array($result)){
629 $query1="SELECT count(*) FROM ".TB_PREFIX
."allimedal WHERE allyid='".$row['id']."' AND categorie = 10 AND plaats<=3";
630 $result1=mysql_query($query1);
631 $row1=mysql_fetch_row($result1);
634 //2x in gestaan, dit is 3e dus lintje (brons)
637 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '8', '0', '".$allyweek."', 'Three', '".$img."')";
638 $resul=mysql_query($quer);
640 //4x in gestaan, dit is 5e dus lintje (zilver)
643 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '8', '0', '".$allyweek."', 'Five', '".$img."')";
644 $resul=mysql_query($quer);
646 //9x in gestaan, dit is 10e dus lintje (goud)
649 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '8', '0', '".$allyweek."', 'Ten', '".$img."')";
650 $resul=mysql_query($quer);
653 //je staat voor 3e / 5e / 10e keer in de top 10klimmers
654 //Pak de top3 rank climbers
655 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY clp DESC Limit 10");
656 while($row = mysql_fetch_array($result)){
658 $query1="SELECT count(*) FROM ".TB_PREFIX
."allimedal WHERE allyid='".$row['id']."' AND categorie = 10 AND plaats<=10";
659 $result1=mysql_query($query1);
660 $row1=mysql_fetch_row($result1);
663 //2x in gestaan, dit is 3e dus lintje (brons)
666 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '16', '0', '".$allyweek."', 'Three', '".$img."')";
667 $resul=mysql_query($quer);
669 //4x in gestaan, dit is 5e dus lintje (zilver)
672 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '16', '0', '".$allyweek."', 'Five', '".$img."')";
673 $resul=mysql_query($quer);
675 //9x in gestaan, dit is 10e dus lintje (goud)
678 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '16', '0', '".$allyweek."', 'Ten', '".$img."')";
679 $resul=mysql_query($quer);
683 //je staat voor 3e / 5e / 10e keer in de top 10 overvallers
684 //Pak de top10 overvallers
685 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY RR DESC Limit 10");
686 while($row = mysql_fetch_array($result)){
688 $query1="SELECT count(*) FROM ".TB_PREFIX
."allimedal WHERE allyid='".$row['id']."' AND categorie = 4 AND plaats<=3";
689 $result1=mysql_query($query1);
690 $row1=mysql_fetch_row($result1);
693 //2x in gestaan, dit is 3e dus lintje (brons)
696 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '9', '0', '".$allyweek."', 'Three', '".$img."')";
697 $resul=mysql_query($quer);
699 //4x in gestaan, dit is 5e dus lintje (zilver)
702 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '9', '0', '".$allyweek."', 'Five', '".$img."')";
703 $resul=mysql_query($quer);
705 //9x in gestaan, dit is 10e dus lintje (goud)
708 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '9', '0', '".$allyweek."', 'Ten', '".$img."')";
709 $resul=mysql_query($quer);
711 } //je staat voor 3e / 5e / 10e keer in de top 10 overvallers
712 //Pak de top10 overvallers
713 $result = mysql_query("SELECT * FROM ".TB_PREFIX
."alidata ORDER BY RR DESC Limit 10");
714 while($row = mysql_fetch_array($result)){
716 $query1="SELECT count(*) FROM ".TB_PREFIX
."allimedal WHERE allyid='".$row['id']."' AND categorie = 4 AND plaats<=10";
717 $result1=mysql_query($query1);
718 $row1=mysql_fetch_row($result1);
721 //2x in gestaan, dit is 3e dus lintje (brons)
724 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '15', '0', '".$allyweek."', 'Three', '".$img."')";
725 $resul=mysql_query($quer);
727 //4x in gestaan, dit is 5e dus lintje (zilver)
730 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '15', '0', '".$allyweek."', 'Five', '".$img."')";
731 $resul=mysql_query($quer);
733 //9x in gestaan, dit is 10e dus lintje (goud)
736 $quer="insert into ".TB_PREFIX
."allimedal(allyid, categorie, plaats, week, points, img) values('".$row['id']."', '15', '0', '".$allyweek."', 'Ten', '".$img."')";
737 $resul=mysql_query($quer);
741 $query="SELECT * FROM ".TB_PREFIX
."alidata ORDER BY id+0 DESC";
742 $result=mysql_query($query);
743 for ($i=0; $row=mysql_fetch_row($result); $i++
){
744 mysql_query("UPDATE ".TB_PREFIX
."alidata SET ap=0, dp=0, RR=0, clp=0 WHERE id = ".$row[0]."");
750 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
753 <title
><?php
echo SERVER_NAME ?
></title
>
754 <link REL
="shortcut icon" HREF
="favicon.ico"/>
755 <meta http
-equiv
="cache-control" content
="max-age=0" />
756 <meta http
-equiv
="pragma" content
="no-cache" />
757 <meta http
-equiv
="expires" content
="0" />
758 <meta http
-equiv
="imagetoolbar" content
="no" />
759 <meta http
-equiv
="content-type" content
="text/html; charset=UTF-8" />
761 <script src
="mt-full.js?0ac36" type
="text/javascript"></script
>
762 <script src
="unx.js?0ac36" type
="text/javascript"></script
>
763 <script src
="new.js?0ac36" type
="text/javascript"></script
>
764 <link href
="<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7c" rel
="stylesheet" type
="text/css" />
765 <link href
="<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7c" rel
="stylesheet" type
="text/css" />
767 if($session->gpack
== null || GP_ENABLE
== false) {
769 <link href='".GP_LOCATE
."travian.css?e21d2' rel='stylesheet' type='text/css' />
770 <link href='".GP_LOCATE
."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
773 <link href='".$session->gpack
."travian.css?e21d2' rel='stylesheet' type='text/css' />
774 <link href='".$session->gpack
."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
777 <script type
="text/javascript">
779 window
.addEvent('domready', start
);
782 <body
class="v35 ie ie8">
783 <div
class="wrapper">
784 <img style
="filter:chroma();" src
="img/x.gif" id
="msfilter" alt
="" />
785 <div id
="dynamic_header">
787 <?php
include("Templates/header.tpl"); ?
>
789 <?php
include("Templates/menu.tpl"); ?
>
791 <div id
="content" class="login">
793 if(isset($_GET['giveout'])){?
>
794 <h1
><br
/>Top
10 Medals
</h1
><br
/>
796 -Top
10 Attacker
<br
/>
797 -Top
10 Defender
<br
/>
798 -Top
10 Robbers
<br
/>
799 -Top
10 Alliance Attacker
<br
/>
800 -Top
10 Alliance Defencer
<br
/>
801 -Top
10 Alliance Robbers
<br
/>
802 -Top
10 Alliance
Climbers(Rank
)<br
/>
803 -Top
10 Pop Climbers
<br
/>
804 -Top
10 Rank Climbers
<br
/>
805 -Bonus
: Attacker
AND Defender
<br
/>
806 -Bonus
: 3/5/10 times in a row top
3 Pop Climbers
<br
/>
807 -Bonus
: 3/5/10 times in a row top
3 Rank Climbers
<br
/>
808 -Bonus
: 3/5/10 times top
3 Attack
<br
/>
809 -Bonus
: 3/5/10 times top
3 Defence
<br
/>
810 -Bonus
: 3/5/10 times top
3 Robber
<br
/>
812 -Bonus
: 3/5/10 times in a row top
10 Attack
<br
/>
813 -Bonus
: 3/5/10 times in a row top
10 Defence
<br
/>
814 -Bonus
: 3/5/10 times in a row top
10 Pop Climbers
<br
/>
815 -Bonus
: 3/5/10 times in a row top
10 Rank Climbers
<br
/>
816 -Bonus
: 3/5/10 times in a row top
10 Robber
<br
/>
821 } else{ ?
><h1
><br
/>Top
10 Medals
</h1
><br
/>
822 Click
<a href
="?giveout">here
</a
>, to give the medals away
for <b
>week
<?php
echo $week; ?
></b
>!<br
/>WARNING
: Loading next page can take some time
!
824 <div id
="side_info" class="outgame">
827 <div
class="clear"></div
>
830 <div
class="footer-stopper outgame"></div
>
831 <div
class="clear"></div
>
833 <?php
include("Templates/footer.tpl"); ?
>
837 <?php
mysql_close(); ?
>