\n"; print " \n"; print " \n"; print " \n \n\n"; print <<
{$clan->name}
{$clan->info}
\n"; print <<

ENDHTML; print " \n"; $dbres = mysql_query("SELECT `attack`,`defence`,`clicks`,`type` FROM `[users]` WHERE `clan`='{$clan->name}'"); print " \n"; while($member = mysql_fetch_object($dbres)) $power += round(($member->attack+$member->defence)/2+$member->clicks*5); $power += ($clan->def_lvl1*1500)/2; $power += ($clan->def_lvl4*20000)/2; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print "
Owner: owner}\">{$clan->owner}
Members: ". (mysql_num_rows($dbres)) ."
Power: ".number_format($power,0,',','.')."
Land: ".number_format($clan->land,0,',','.')."m2
Contant: €".number_format($clan->cash,0,',','.')."
Bank: €".number_format($clan->bank,0,',','.')."
Clicks: ".number_format($clan->clicks,0,',','.')."
Clicks vandaag: {$clan->clickstoday}
Opgericht: {$clan->started}
"; print ""; print ""; if($data->clanlevel >= 7) print ""; print "
name}\">Joinname}\">Bezittingenname}\">Donerenname}\">Attack

ENDHTML; $begin = ($_GET['p'] >= 0) ? $_GET['p']*15 : 0; if($_GET['s'] == "login") $dbres = mysql_query("SELECT `login`,`attack`,`defence`,`clicks`,`bank`,`cash`,`clanlevel`,`type` FROM `[users]` WHERE `clan`='{$clan->name}' ORDER BY `login` LIMIT $begin,15"); else if($_GET['s'] == "money") $dbres = mysql_query("SELECT `login`,`attack`,`defence`,`clicks`,`bank`,`cash`,`clanlevel`,`type` FROM `[users]` WHERE `clan`='{$clan->name}' ORDER BY `cash`+`bank` DESC,`login` ASC LIMIT $begin,15"); else if($_GET['s'] == "power") $dbres = mysql_query("SELECT `login`,`attack`,`defence`,`clicks`,`bank`,`cash`,`clanlevel`,`type` FROM `[users]` WHERE `clan`='{$clan->name}' ORDER BY (`attack`+`defence`)/2+`clicks`*5 DESC,`login` ASC LIMIT $begin,15"); else $dbres = mysql_query("SELECT `login`,`attack`,`defence`,`clicks`,`bank`,`cash`,`clanlevel`,`type` FROM `[users]` WHERE `clan`='{$clan->name}' ORDER BY `clanlevel` DESC,`login` ASC LIMIT $begin,15"); for($j=$begin+1; $member = mysql_fetch_object($dbres); $j++) { $rank = Array("","Member","Recruiter","","","","Manager","Generaal","Leader","Owner"); $rank = $rank[$member->clanlevel]; $power = number_format(round(($member->attack+$member->defence)/2+$member->clicks*5),0,',','.'); $money = number_format($member->cash+$member->bank,0,',','.'); print << ENDHTML; } $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `clan`='{$clan->name}'"); print "
# Nick Rank Geld Power
$j {$member->login} $rank €$money $power
\n\n\n
"; if(mysql_num_rows($dbres) <= 15) print "| 1 |
\n"; else { if($begin/15 == 0) print "<< "; else print "name}&s={$_GET['s']}&p=". ($begin/15-1) ."\"><< "; for($i=0; $iname}&s={$_GET['s']}&p=$i\">". ($i+1) ." "; } if($begin+15 >= mysql_num_rows($dbres)) print ">> "; else print "name}&s={$_GET['s']}&p=". ($begin/15+1) ."\">>>"; print "
\n"; } } } else if($_GET['p'] == "list") { print " \n"; print " \n"; $dbres = mysql_query("SELECT `name`,`owner`,`type`,`def_lvl1` FROM `[clans]` ORDER BY `type`"); while($clan = mysql_fetch_object($dbres)) { $power = 0; $dbres2 = mysql_query("SELECT `attack`,`defence`,`clicks`,`type` FROM `[users]` WHERE `clan`='{$clan->name}'"); while($member = mysql_fetch_object($dbres2)) $power += round(($member->attack+$member->defence)/2+$member->clicks*5); $power += ($clan->def_lvl1*1500)/2; $clanpower[$clan->type][$clan->name] = $power; } $lasttype = 1; foreach($clanpower as $type => $info) { arsort($info); foreach($info as $name => $power) { $dbres = mysql_query("SELECT `name`,`owner`,`type` FROM `[clans]` WHERE `name`='$name'"); $clan = mysql_fetch_object($dbres); $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `clan`='$name'"); $nummembers = mysql_num_rows($dbres); $type2 = Array("","Drugsdealers","Wetenschappers","Politie"); $type2 = $type2[$clan->type]; print " "; if($data->clanlevel >= 7) print " \n"; else print "\n"; $lasttype = $type; } } print "
Clan Owner Members Power
$name owner}\">{$clan->owner} $nummembers $power attack
\n"; $db = mysql_query("SELECT `name` FROM `[clans]`"); $num = mysql_num_rows($db); echo "Er zijn momenteel $num clans in het spel"; } else if($_GET['p'] == "join") { if($data->clanlevel == 0) { print " Meld je aan bij een clan\n"; if(isset($_POST['clan'])) { $dbres2 = mysql_query("SELECT * FROM `[clanban]` WHERE `clan`='{$_POST['clan']}' AND `speler`='$data->login'"); if(mysql_num_rows($dbres2) != 0){ print "
{$data->login} je bent verbannen uit die clan!
daar kun je niet meer in..
\n"; exit; } $dbres2 = mysql_query("SELECT * FROM `[users]` WHERE `clan`='{$_POST['clan']}' OR `clan`='{$_POST['clan']}-[recruit]' AND `clanlevel` > 0"); if(mysql_num_rows($dbres2) > 29){ print "
Er zitten al 30 leden in die clan!
of er zijn al meer aanmeldingen geweest die eerst moeten worden gedaan
\n"; exit; } $clan = substr($_POST['clan'],0,32); $dbres = mysql_query("SELECT `name`,`owner`,`type` FROM `[clans]` WHERE `name`='{$_POST['clan']}'"); if($clan = mysql_fetch_object($dbres)) { $data->clan = "{$clan->name}-[recruit]"; mysql_query("UPDATE `[users]` SET `clan`='{$clan->name}-[recruit]' WHERE `login`='{$data->login}'"); print " Je hebt je aangemeld bij {$clan->name}\n"; } else print " Die clan bestaat niet!\n"; exit; } print "
Clan: \n"; } else print " Je zit al in een clan\n"; } else if($_GET['p'] == "new" && $data->clanlevel == 9) { print " Clan oprichten\n"; if(isset($_POST['name'])) { $_POST['name'] = substr($_POST['name'],0,16); if(preg_match('/^[A-Za-z0-9_\- ]+$/',$_POST['name'])) { if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } if($_POST['name'] == ' ') { $_POST['name'] = str_replace(" ","*",$_POST['name']); } else { } $dbres = mysql_query("SELECT `name` FROM `[clans]` WHERE `name`='{$_POST['name']}'"); if(mysql_num_rows($dbres) == 0) { $dbres = mysql_query("SELECT `land` FROM `[clans]`"); $land = 0; while($clan = mysql_fetch_object($dbres)) $land += $clan->land; if(9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 - $land >= 300) { $data->clan = $_POST['name']; $data->clanlevel = 9; mysql_query("UPDATE `[users]` SET `clan`='{$_POST['name']}',`clanlevel`=9 WHERE `login`='{$data->login}'"); mysql_query("INSERT INTO `[clans]`(`name`,`owner`,`started`,`type`) values('{$_POST['name']}','{$data->login}',NOW(),1)"); print " Je hebt een clan opgericht!
Je word nu terug gestuurd naar je hoofdkwartier!\n\n"; exit; } else exit; } else print " Er is al een clan met die naam\n"; exit; } else print " Er mogen alleen letters, nummers, _ - en spaties in de clan-name zitten\n"; } else if($data->gold > 122 && $data->login != Webbie){ print "Alleen Gold accounts mogen een eigen clan oprichten!
Klik hier om een Gold account te nemen! Automatisch!"; exit; } echo " Als je een clan maakt, gebruik dan een normale naam!
Geen scheldwoorden, beledigingen, ziekte's enz.
Word dat wel gedaan? Dan word ja clan verwijderd.
En bij meerdere overtredingen word je account verbannen"; } else if($_GET['p'] == "quit" && $data->clanlevel > 0 && $data->clanlevel < 9) { print " FOUT\n"; if(isset($_POST['quit'])) { $data->clan = ""; $data->clanlevel = 0; mysql_query("UPDATE `[users]` SET `clan`='',`clanlevel`=0 WHERE `login`='{$data->login}'"); print <<Je bent uit de clan gestapt ENDHTML; } else if(isset($_POST['cancel'])) { print << document.location = "hq.php"; ENDHTML; } else { print <<

Fout ga terug ENDHTML; } } else if($_GET['p'] == "delete" && $data->clanlevel == 9) { print " Verwijder de clan\n"; if(isset($_POST['delete'])) { $dbres = mysql_query("SELECT `login` FROM `[users]` WHERE `clan`='{$data->clan}' OR `clan`='{$data->clan}-[recruit]'"); while($member = mysql_fetch_object($dbres)) mysql_query("UPDATE `[users]` SET `clan`='',`clanlevel`=0 WHERE `clan`='{$data->clan}' OR `clan`='{$data->clan}-[recruit]'"); mysql_query("DELETE FROM `[clans]` WHERE `name`='{$data->clan}'"); $data->clan = ""; $data->clanlevel = 0; print <<De clan is opgeheven ENDHTML; } else if(isset($_POST['cancel'])) { print << document.location = "hq.php"; ENDHTML; } else { print <<
Weet je zeker dat je de clan op wilt verwijderen?

     
ENDHTML; } } /* ------------------------- */ ?>