diff --git a/GameEngine/BBCode.php b/GameEngine/BBCode.php index 28d3b6af..805f450c 100644 --- a/GameEngine/BBCode.php +++ b/GameEngine/BBCode.php @@ -1 +1 @@ -$1"; $a[1] = "$1"; $a[2] = "$1"; $a[3] = "Legionnaire"; $a[4] = "Praetorian"; $a[5] = "Imperian"; $a[6] = "Equites Legati"; $a[7] = "Equites Imperatoris"; $a[8] = "Equites Caesaris"; $a[9] = "Battering Ram"; $a[10] = "Fire Catapult"; $a[11] = "Senator"; $a[12] = "Settler"; $a[13] = "Clubswinger"; $a[14] = "Spearman"; $a[15] = "Axeman"; $a[16] = "Scout"; $a[17] = "Paladin"; $a[18] = "Teutonic Knight"; $a[19] = "Ram"; $a[20] = "Catapult"; $a[21] = "Chief"; $a[22] = "Settler"; $a[23] = "Phalanx"; $a[24] = "Swordsman"; $a[25] = "Pathfinder"; $a[26] = "Theutates Thunder"; $a[27] = "Druidrider"; $a[28] = "Haeduan"; $a[29] = "Ram"; $a[30] = "Trebuchet"; $a[31] = "Chieftain"; $a[32] = "Settler"; $a[33] = "Rat"; $a[34] = "Spider"; $a[35] = "Snake"; $a[36] = "Bat"; $a[37] = "Wild Boar"; $a[38] = "Wolf"; $a[39] = "Bear"; $a[40] = "Crocodile"; $a[41] = "Tiger"; $a[42] = "Elephant"; $a[43] = "Pikeman"; $a[44] = "Thorned Warrior"; $a[45] = "Guardsman"; $a[46] = "Birds Of Prey"; $a[47] = "Axerider"; $a[48] = "Natarian Knight"; $a[49] = "War Elephant"; $a[50] = "Ballista"; $a[51] = "Natarian Emperor"; $a[52] = "Settler"; $a[53] = "Hero"; $a[54] = "Lumber"; $a[55] = "Clay"; $a[56] = "Iron"; $a[57] = "Crop"; $a[58] = "*aha*"; $a[59] = "*angry*"; $a[60] = "*cool*"; $a[61] = "*cry*"; $a[62] = "*cute*"; $a[63] = "*depressed*"; $a[64] = "*eek*"; $a[65] = "*ehem*"; $a[66] = "*emotional*"; $a[67] = ":D"; $a[68] = ":)"; $a[69] = "*hit*"; $a[70] = "*hmm*"; $a[71] = "*hmpf*"; $a[72] = "*hrhr*"; $a[73] = "*huh*"; $a[74] = "*lazy*"; $a[75] = "*love*"; $a[76] = "*nocomment*"; $a[77] = "*noemotion*"; $a[78] = "*notamused*"; $a[79] = "*pout*"; $a[80] = "*redface*"; $a[81] = "*rolleyes*"; $a[82] = ":("; $a[83] = "*shy*"; $a[84] = "*smile*"; $a[85] = "*tongue*"; $a[86] = "*veryangry*"; $a[87] = "*veryhappy*"; $a[88] = ";)"; $a[89] = "$1"; $a[90] = "$1"; $a[91] = "$1"; $a[92] = "$1"; $replace= array(); $replace[0] = "$1"; $replace[1] = "$1"; $replace[2] = "$1"; $replace[3] = "Legionnaire"; $replace[4] = "Praetorian"; $replace[5] = "Imperian"; $replace[6] = "Equites Legati"; $replace[7] = "Equites Imperatoris"; $replace[8] = "Equites Caesaris"; $replace[9] = "Battering Ram"; $replace[10] = "Fire Catapult"; $replace[11] = "Senator"; $replace[12] = "Settler"; $replace[13] = "Clubswinger"; $replace[14] = "Spearman"; $replace[15] = "Axeman"; $replace[16] = "Scout"; $replace[17] = "Paladin"; $replace[18] = "Teutonic Knight"; $replace[19] = "Ram"; $replace[20] = "Catapult"; $replace[21] = "Chief"; $replace[22] = "Settler"; $replace[23] = "Phalanx"; $replace[24] = "Swordsman"; $replace[25] = "Pathfinder"; $replace[26] = "Theutates Thunder"; $replace[27] = "Druidrider"; $replace[28] = "Haeduan"; $replace[29] = "Ram"; $replace[30] = "Trebuchet"; $replace[31] = "Chieftain"; $replace[32] = "Settler"; $replace[33] = "Rat"; $replace[34] = "Spider"; $replace[35] = "Snake"; $replace[36] = "Bat"; $replace[37] = "Wild Boar"; $replace[38] = "Wolf"; $replace[39] = "Bear"; $replace[40] = "Crocodile"; $replace[41] = "Tiger"; $replace[42] = "Elephant"; $replace[43] = "Pikeman"; $replace[44] = "Thorned Warrior"; $replace[45] = "Guardsman"; $replace[46] = "Birds Of Prey"; $replace[47] = "Axerider"; $replace[48] = "Natarian Knight"; $replace[49] = "War Elephant"; $replace[50] = "Ballista"; $replace[51] = "Natarian Emperor"; $replace[52] = "Settler"; $replace[53] = "Hero"; $replace[54] = "Lumber"; $replace[55] = "Clay"; $replace[56] = "Iron"; $replace[57] = "Crop"; $replace[58] = "*aha*"; $replace[59] = "*angry*"; $replace[60] = "*cool*"; $replace[61] = "*cry*"; $replace[62] = "*cute*"; $replace[63] = "*depressed*"; $replace[64] = "*eek*"; $replace[65] = "*ehem*"; $replace[66] = "*emotional*"; $replace[67] = ":D"; $replace[68] = ":)"; $replace[69] = "*hit*"; $replace[70] = "*hmm*"; $replace[71] = "*hmpf*"; $replace[72] = "*hrhr*"; $replace[73] = "*huh*"; $replace[74] = "*lazy*"; $replace[75] = "*love*"; $replace[76] = "*nocomment*"; $replace[77] = "*noemotion*"; $replace[78] = "*notamused*"; $replace[79] = "*pout*"; $replace[80] = "*redface*"; $replace[81] = "*rolleyes*"; $replace[82] = ":("; $replace[83] = "*shy*"; $replace[84] = "*smile*"; $replace[85] = "*tongue*"; $replace[86] = "*veryangry*"; $replace[87] = "*veryhappy*"; $replace[88] = ";)"; $bbcoded1 = preg_replace($pattern[89], $a[89], $input); $bbcoded1 = preg_replace('/\[\/alliance\](.*?)\[\/message\]/is', '', $input); $bbcoded1 = preg_replace('/\[message\](.*?)\[alliance\]/is', '', $bbcoded1); $aname = $database->getAllianceID($bbcoded1); if($aname != ""){ $replace[89] = "$1"; }else{ $replace[89] = "alliance not exist"; } $abc = "/abcdef/"; $ab = "abcdef"; $bbcoded2 = preg_replace($pattern[90], $a[90], $input); $bbcoded2 = preg_replace('/\[\/player\](.*?)\[\/message\]/is', '', $input); $bbcoded2 = preg_replace('/\[message\](.*?)\[player\]/is', '', $bbcoded2); $uname = $database->getUserField($bbcoded2, "id", 1); if($uname != ""){ $replace[90] = "$1"; }else{ $replace[90] = "player not exist"; } $bbcoded3 = preg_replace($pattern[91], $a[91], $input); $bbcoded3 = preg_replace('/\[\/report\](.*?)\[\/message\]/is', '', $input); $bbcoded3 = preg_replace('/\[message\](.*?)\[report\]/is', '', $bbcoded3); $report = count($database->getNotice4($bbcoded3)); if($report > 0){ $topic = $database->getNotice2($bbcoded3,"topic"); $replace[91] = "$topic"; }else{ $replace[91] = "report not exist"; } $bbcoded4 = preg_replace($pattern[92], $a[92], $input); $bbcoded4 = preg_replace('/\[\/coor\](.*?)\[\/message\]/is', '', $input); $bbcoded4 = preg_replace('/\[message\](.*?)\[coor\]/is', '', $bbcoded4); for($x = -400; $x < 401; $x++) { if(preg_match('/^'.$x.'/', $bbcoded4)){ $xx = 1; $cx = $x; } } for($y = 0; $y < 401; $y++) { if(preg_match('/-'.$y.'$/', $bbcoded4)){ $yy = 1; $cy = $y*(-1); }else if(preg_match('/'.$y.'$/', $bbcoded4)){ $yy = 1; $cy = $y; } } if(preg_match('/|/', $bbcoded4) && $xx == 1 && $yy == 1){ $wref = $database->getVilWref($cx,$cy); $cwref = $generator->getMapCheck($wref); if($wref != ""){ $wref1 = $database->getVillageType3($wref); if($wref1['oasistype'] == 0 && $wref1['occupied'] == 1){ $vname = $database->getVillageField($wref,"name"); }else if($wref1['oasistype'] == 0 && $wref1['occupied'] == 0){ $vname = "Abandoned valley"; }else if($wref1['oasistype'] != 0 && $wref1['occupied'] == 1){ $vname = "Occupied Oasis"; }else if($wref1['oasistype'] != 0 && $wref1['occupied'] == 0){ $vname = "Unoccupied Oasis"; } $replace[92] = "$vname($cx|$cy)"; } } if(preg_match('/'.$a[89].'/', $bbcoded2)) echo $bbcoded2; $input = preg_replace('/\[message\]/', '', $input); $input = preg_replace('/\[\/message\]/', '', $input); $bbcoded = preg_replace($pattern, $replace, $input); ?> \ No newline at end of file +$1"; $a[1] = "$1"; $a[2] = "$1"; $a[3] = "Legionnaire"; $a[4] = "Praetorian"; $a[5] = "Imperian"; $a[6] = "Equites Legati"; $a[7] = "Equites Imperatoris"; $a[8] = "Equites Caesaris"; $a[9] = "Battering Ram"; $a[10] = "Fire Catapult"; $a[11] = "Senator"; $a[12] = "Settler"; $a[13] = "Clubswinger"; $a[14] = "Spearman"; $a[15] = "Axeman"; $a[16] = "Scout"; $a[17] = "Paladin"; $a[18] = "Teutonic Knight"; $a[19] = "Ram"; $a[20] = "Catapult"; $a[21] = "Chief"; $a[22] = "Settler"; $a[23] = "Phalanx"; $a[24] = "Swordsman"; $a[25] = "Pathfinder"; $a[26] = "Theutates Thunder"; $a[27] = "Druidrider"; $a[28] = "Haeduan"; $a[29] = "Ram"; $a[30] = "Trebuchet"; $a[31] = "Chieftain"; $a[32] = "Settler"; $a[33] = "Rat"; $a[34] = "Spider"; $a[35] = "Snake"; $a[36] = "Bat"; $a[37] = "Wild Boar"; $a[38] = "Wolf"; $a[39] = "Bear"; $a[40] = "Crocodile"; $a[41] = "Tiger"; $a[42] = "Elephant"; $a[43] = "Pikeman"; $a[44] = "Thorned Warrior"; $a[45] = "Guardsman"; $a[46] = "Birds Of Prey"; $a[47] = "Axerider"; $a[48] = "Natarian Knight"; $a[49] = "War Elephant"; $a[50] = "Ballista"; $a[51] = "Natarian Emperor"; $a[52] = "Settler"; $a[53] = "Hero"; $a[54] = "Lumber"; $a[55] = "Clay"; $a[56] = "Iron"; $a[57] = "Crop"; $a[58] = "*aha*"; $a[59] = "*angry*"; $a[60] = "*cool*"; $a[61] = "*cry*"; $a[62] = "*cute*"; $a[63] = "*depressed*"; $a[64] = "*eek*"; $a[65] = "*ehem*"; $a[66] = "*emotional*"; $a[67] = ":D"; $a[68] = ":)"; $a[69] = "*hit*"; $a[70] = "*hmm*"; $a[71] = "*hmpf*"; $a[72] = "*hrhr*"; $a[73] = "*huh*"; $a[74] = "*lazy*"; $a[75] = "*love*"; $a[76] = "*nocomment*"; $a[77] = "*noemotion*"; $a[78] = "*notamused*"; $a[79] = "*pout*"; $a[80] = "*redface*"; $a[81] = "*rolleyes*"; $a[82] = ":("; $a[83] = "*shy*"; $a[84] = "*smile*"; $a[85] = "*tongue*"; $a[86] = "*veryangry*"; $a[87] = "*veryhappy*"; $a[88] = ";)"; $a[89] = "$1"; $a[90] = "$1"; $a[91] = "$1"; $a[92] = "$1"; $replace = array(); $replace[0] = "$1"; $replace[1] = "$1"; $replace[2] = "$1"; $replace[3] = "Legionnaire"; $replace[4] = "Praetorian"; $replace[5] = "Imperian"; $replace[6] = "Equites Legati"; $replace[7] = "Equites Imperatoris"; $replace[8] = "Equites Caesaris"; $replace[9] = "Battering Ram"; $replace[10] = "Fire Catapult"; $replace[11] = "Senator"; $replace[12] = "Settler"; $replace[13] = "Clubswinger"; $replace[14] = "Spearman"; $replace[15] = "Axeman"; $replace[16] = "Scout"; $replace[17] = "Paladin"; $replace[18] = "Teutonic Knight"; $replace[19] = "Ram"; $replace[20] = "Catapult"; $replace[21] = "Chief"; $replace[22] = "Settler"; $replace[23] = "Phalanx"; $replace[24] = "Swordsman"; $replace[25] = "Pathfinder"; $replace[26] = "Theutates Thunder"; $replace[27] = "Druidrider"; $replace[28] = "Haeduan"; $replace[29] = "Ram"; $replace[30] = "Trebuchet"; $replace[31] = "Chieftain"; $replace[32] = "Settler"; $replace[33] = "Rat"; $replace[34] = "Spider"; $replace[35] = "Snake"; $replace[36] = "Bat"; $replace[37] = "Wild Boar"; $replace[38] = "Wolf"; $replace[39] = "Bear"; $replace[40] = "Crocodile"; $replace[41] = "Tiger"; $replace[42] = "Elephant"; $replace[43] = "Pikeman"; $replace[44] = "Thorned Warrior"; $replace[45] = "Guardsman"; $replace[46] = "Birds Of Prey"; $replace[47] = "Axerider"; $replace[48] = "Natarian Knight"; $replace[49] = "War Elephant"; $replace[50] = "Ballista"; $replace[51] = "Natarian Emperor"; $replace[52] = "Settler"; $replace[53] = "Hero"; $replace[54] = "Lumber"; $replace[55] = "Clay"; $replace[56] = "Iron"; $replace[57] = "Crop"; $replace[58] = "*aha*"; $replace[59] = "*angry*"; $replace[60] = "*cool*"; $replace[61] = "*cry*"; $replace[62] = "*cute*"; $replace[63] = "*depressed*"; $replace[64] = "*eek*"; $replace[65] = "*ehem*"; $replace[66] = "*emotional*"; $replace[67] = ":D"; $replace[68] = ":)"; $replace[69] = "*hit*"; $replace[70] = "*hmm*"; $replace[71] = "*hmpf*"; $replace[72] = "*hrhr*"; $replace[73] = "*huh*"; $replace[74] = "*lazy*"; $replace[75] = "*love*"; $replace[76] = "*nocomment*"; $replace[77] = "*noemotion*"; $replace[78] = "*notamused*"; $replace[79] = "*pout*"; $replace[80] = "*redface*"; $replace[81] = "*rolleyes*"; $replace[82] = ":("; $replace[83] = "*shy*"; $replace[84] = "*smile*"; $replace[85] = "*tongue*"; $replace[86] = "*veryangry*"; $replace[87] = "*veryhappy*"; $replace[88] = ";)"; $bbcoded1 = preg_replace($pattern[89], $a[89], $input); $bbcoded1 = preg_replace('/\[\/alliance\](.*?)\[\/message\]/is', '', $input); $bbcoded1 = preg_replace('/\[message\](.*?)\[alliance\]/is', '', $bbcoded1); $aname = $database->getAllianceID($bbcoded1); if($aname != ""){ $replace[89] = "$1"; }else{ $replace[89] = "alliance not exist"; } $abc = "/abcdef/"; $ab = "abcdef"; $bbcoded2 = preg_replace($pattern[90], $a[90], $input); $bbcoded2 = preg_replace('/\[\/player\](.*?)\[\/message\]/is', '', $input); $bbcoded2 = preg_replace('/\[message\](.*?)\[player\]/is', '', $bbcoded2); $uname = $database->getUserField($bbcoded2, "id", 1); if($uname != ""){ $replace[90] = "$1"; }else{ $replace[90] = "player not exist"; } $bbcoded3 = preg_replace($pattern[91], $a[91], $input); $bbcoded3 = preg_replace('/\[\/report\](.*?)\[\/message\]/is', '', $input); $bbcoded3 = preg_replace('/\[message\](.*?)\[report\]/is', '', $bbcoded3); $report = count($database->getNotice4($bbcoded3)); if($report > 0){ $topic = $database->getNotice2($bbcoded3,"topic"); $replace[91] = "$topic"; }else{ $replace[91] = "report not exist"; } $bbcoded4 = preg_replace($pattern[92], $a[92], $input); $bbcoded4 = preg_replace('/\[\/coor\](.*?)\[\/message\]/is', '', $input); $bbcoded4 = preg_replace('/\[message\](.*?)\[coor\]/is', '', $bbcoded4); for($x = -400; $x < 401; $x++) { if(preg_match('/^'.$x.'/', $bbcoded4)){ $xx = 1; $cx = $x; } } for($y = 0; $y < 401; $y++) { if(preg_match('/-'.$y.'$/', $bbcoded4)){ $yy = 1; $cy = $y*(-1); }else if(preg_match('/'.$y.'$/', $bbcoded4)){ $yy = 1; $cy = $y; } } if(preg_match('/|/', $bbcoded4) && $xx == 1 && $yy == 1){ $wref = $database->getVilWref($cx,$cy); $cwref = $generator->getMapCheck($wref); if($wref != ""){ $wref1 = $database->getVillageType3($wref); if($wref1['oasistype'] == 0 && $wref1['occupied'] == 1){ $vname = $database->getVillageField($wref,"name"); }else if($wref1['oasistype'] == 0 && $wref1['occupied'] == 0){ $vname = "Abandoned valley"; }else if($wref1['oasistype'] != 0 && $wref1['occupied'] == 1){ $vname = "Occupied Oasis"; }else if($wref1['oasistype'] != 0 && $wref1['occupied'] == 0){ $vname = "Unoccupied Oasis"; } $replace[92] = "$vname($cx|$cy)"; } } if(preg_match('/'.$a[89].'/', $bbcoded2)) echo $bbcoded2; $input = preg_replace('/\[message\]/', '', $input); $input = preg_replace('/\[\/message\]/', '', $input); $bbcoded = preg_replace($pattern, $replace, $input); ?> \ No newline at end of file diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php index 0e9ed75c..7d0bcb6d 100644 --- a/GameEngine/Database/db_MYSQL.php +++ b/GameEngine/Database/db_MYSQL.php @@ -2016,19 +2016,6 @@ class MYSQL_DB { return $row[0] + $row2[0] + $row3[0]; } - /*************************** - Function to retrieve movement of village - Type 0: Send Resource - Type 1: Send Merchant - Type 2: Return Resource - Type 3: Attack - Type 4: Return - Type 5: Settler - Type 6: Bounty Type 7: Reinf. - Mode 0: Send/Out - Mode 1: Recieve/In - References: Type, Village, Mode - ***************************/ function getMovement($type, $village, $mode) { $time = time(); if(!$mode) { @@ -2061,6 +2048,9 @@ class MYSQL_DB { case 7: $q = "SELECT * FROM " . TB_PREFIX . "movement where " . TB_PREFIX . "movement." . $where . " = $village and sort_type = 4 and ref = 0 and proc = 0 ORDER BY endtime ASC"; break; + case 8: + $q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement." . $where . " = $village and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and " . TB_PREFIX . "attacks.attack_type = 1 ORDER BY endtime ASC"; + break; case 34: $q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement." . $where . " = $village and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 or " . TB_PREFIX . "movement." . $where . " = $village and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 4 ORDER BY endtime ASC"; break; diff --git a/GameEngine/Message.php b/GameEngine/Message.php index 3a4247d5..9efb52f2 100644 --- a/GameEngine/Message.php +++ b/GameEngine/Message.php @@ -358,7 +358,7 @@ class Message { $welcomemsg = preg_replace("'%USER%'", $username, $welcomemsg); $welcomemsg = preg_replace("'%START%'", date("y.m.d", COMMENCE), $welcomemsg); $welcomemsg = preg_replace("'%TIME%'", date("H:i", COMMENCE), $welcomemsg); - $welcomemsg = preg_replace("'%PLAYERS%'", $database->countUser()-4, $welcomemsg); + $welcomemsg = preg_replace("'%PLAYERS%'", $database->countUser(), $welcomemsg); $welcomemsg = preg_replace("'%ALLI%'", $database->countAlli(), $welcomemsg); $welcomemsg = preg_replace("'%SERVER_NAME%'", SERVER_NAME, $welcomemsg); $welcomemsg = "[message]".$welcomemsg."[/message]"; diff --git a/Templates/Alliance/Forum/forum_1.tpl b/Templates/Alliance/Forum/forum_1.tpl index 2aeb74fb..84033b47 100644 --- a/Templates/Alliance/Forum/forum_1.tpl +++ b/Templates/Alliance/Forum/forum_1.tpl @@ -55,16 +55,16 @@ function showCheckList() { newTD1.className = 'ally'; newTD2.className = 'tag'; newTD3.className = 'ad'; - newTD1.innerHTML = html_input_1 + 'id="allys_by_id_'+num_fields+'" class="text" maxlength="8" name="allys_by_id['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'allys\')">'; - newTD2.innerHTML = html_input_1 + 'id="allys_by_name_'+num_fields+'" class="text" maxlength="8" name="allys_by_name['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'allys\')">'; + newTD1.innerHTML = html_input_1 + 'id="allys_by_id_'+num_fields+'" class="text" maxlength="15" name="allys_by_id['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'allys\')">'; + newTD2.innerHTML = html_input_1 + 'id="allys_by_name_'+num_fields+'" class="text" maxlength="15" name="allys_by_name['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'allys\')">'; } if(element_id == 'user_list') { newTD1.className = 'id'; newTD2.className = 'pla'; newTD3.className = 'ad'; - newTD1.innerHTML = html_input_1 + 'id="users_by_id_'+num_fields+'" class="text" maxlength="8" name="users_by_id['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'users\')">'; - newTD2.innerHTML = html_input_1 + 'id="users_by_name_'+num_fields+'" class="text" maxlength="15" name="users_by_name['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'users\')">'; + newTD1.innerHTML = html_input_1 + 'id="users_by_id_'+num_fields+'" class="text" maxlength="15" name="users_by_id['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'users\')">'; + newTD2.innerHTML = html_input_1 + 'id="users_by_name_'+num_fields+'" class="text" maxlength="50" name="users_by_name['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'users\')">'; } newTD3.innerHTML = 'add'; @@ -139,10 +139,10 @@ function showCheckList() { - + - + @@ -162,11 +162,11 @@ function showCheckList() { - + - + add diff --git a/Templates/movement.tpl b/Templates/movement.tpl index 6df80feb..ecdd4b71 100644 --- a/Templates/movement.tpl +++ b/Templates/movement.tpl @@ -9,16 +9,28 @@ ## ## ################################################################################# -$aantal=(count($database->getMovement(4,$village->wid,1))+count($database->getMovement(4,$village->wid,0))+count($database->getMovement(3,$village->wid,1))+count($database->getMovement(3,$village->wid,0))+count($database->getMovement(7,$village->wid,1))); +$aantal = (count($database->getMovement(4,$village->wid,1))+count($database->getMovement(4,$village->wid,0))+count($database->getMovement(3,$village->wid,1))+count($database->getMovement(3,$village->wid,0))+count($database->getMovement(7,$village->wid,1))-count($database->getMovement(8,$village->wid,1))); + if($aantal > 0){ echo ''; } $NextArrival = array(); +$NextArrival1 = array(); +$NextArrival2 = array(); +$NextArrival3 = array(); -/* Units coming back from Reinf,attack,raid */ -$aantal = count($database->getMovement(4,$village->wid,1)); +/* Units coming back from Reinf,attack,raid,evasion or reinf to my town */ +$aantal = count($database->getMovement(4,$village->wid,1))+count($database->getMovement(7,$village->wid,1)); $aantal2 = $database->getMovement(4,$village->wid,1); +$aantal3 = $database->getMovement(7,$village->wid,1); +$aantal4 = count($database->getMovement(3,$village->wid,1)); +$lala = $aantal4; +$aantal5 = $database->getMovement(3,$village->wid,1); +for($i=0;$i<$aantal4;$i++){ + if(($aantal5[$i]['attack_type']==1) or ($aantal5[$i]['attack_type']==3) or ($aantal5[$i]['attack_type']==4)) { $lala -= 1; } +} +$aantal = $aantal+$lala; if($aantal > 0){ foreach($aantal2 as $receive) { $action = 'def1'; @@ -27,22 +39,22 @@ if($aantal > 0){ $short = ''.ARRIVING_REINF_TROOPS_SHORT.''; $NextArrival[] = $receive['endtime']; } - echo ' - '; - $timer += 1; -} - -/* Units coming back from evasion */ -$aantal = count($database->getMovement(7,$village->wid,1)); -$aantal2 = $database->getMovement(7,$village->wid,1); -if($aantal > 0){ - foreach($aantal2 as $receive) { + foreach($aantal3 as $receive) { $action = 'def1'; $aclass = 'd1'; $title = ''.ARRIVING_REINF_TROOPS.''; $short = ''.ARRIVING_REINF_TROOPS_SHORT.''; $NextArrival[] = $receive['endtime']; } + foreach($aantal5 as $receive) { + if ($receive['attack_type'] == 2) { + $action = 'def1'; + $aclass = 'd1'; + $title = ''.OWN_REINFORCING_TROOPS.''; + $short = ''.ARRIVING_REINF_TROOPS_SHORT.''; + $NextArrival[] = $receive['endtime']; + } + } echo ''; $timer += 1; @@ -50,20 +62,22 @@ if($aantal > 0){ /* attack/raid on you! */ $aantal = count($database->getMovement(3,$village->wid,1)); +$aantal1 = count($database->getMovement(3,$village->wid,1)); $aantal2 = $database->getMovement(3,$village->wid,1); -for($i=0;$i<$aantal;$i++){ +for($i=0;$i<$aantal1;$i++){ if($aantal2[$i]['attack_type'] == 2) { $aantal -= 1; } if($aantal2[$i]['attack_type'] == 1) { $aantal -= 1; } } + if($aantal > 0){ - if(!empty($NextArrival)) { reset($NextArrival); } + if(!empty($NextArrival1)) { reset($NextArrival1); } foreach($aantal2 as $receive) { - if ($receive['attack_type'] != 2) { + if ($receive['attack_type'] != 2 && $receive['attack_type'] != 1) { $action = 'att1'; $aclass = 'a1'; $title = ''.OWN_ATTACKING_TROOPS.''; $short = ''.ATTACK.''; - $NextArrival[] = $receive['endtime']; + $NextArrival1[] = $receive['endtime']; } } echo ' @@ -73,19 +87,20 @@ if($aantal > 0){ /* on attack, raid */ $aantal = count($database->getMovement(3,$village->wid,0)); +$aantal1 = count($database->getMovement(3,$village->wid,0)); $aantal2 = $database->getMovement(3,$village->wid,0); -for($i=0;$i<$aantal;$i++){ +for($i=0;$i<$aantal1;$i++){ if($aantal2[$i]['attack_type'] == 2) { $aantal -= 1; } } if($aantal > 0){ - if(!empty($NextArrival)) { reset($NextArrival); } + if(!empty($NextArrival2)) { reset($NextArrival2); } foreach($aantal2 as $receive) { if ($receive['attack_type'] != 2) { $action = 'att2'; $aclass = 'a2'; $title = ''.OWN_ATTACKING_TROOPS.''; $short = ''.ATTACK.''; - $NextArrival[] = $receive['endtime']; + $NextArrival2[] = $receive['endtime']; } } echo ' @@ -101,63 +116,17 @@ for($i=0;$i<$aantal;$i++){ if(($aantal2[$i]['attack_type']==1) or ($aantal2[$i]['attack_type']==3) or ($aantal2[$i]['attack_type']==4)) { $lala -= 1; } } if($lala > 0){ - if(!empty($NextArrival)) { reset($NextArrival); } + if(!empty($NextArrival3)) { reset($NextArrival3); } foreach($aantal2 as $receive) { if ($receive['attack_type'] == 2) { $action = 'def2'; $aclass = 'd2'; $title = ''.OWN_REINFORCING_TROOPS.''; $short = ''.ARRIVING_REINF_TROOPS_SHORT.''; - $NextArrival[] = $receive['endtime']; + $NextArrival3[] = $receive['endtime']; } } echo ''; $timer += 1; -} - -/* Units send to reinf. (to my town) */ -$aantal = count($database->getMovement(3,$village->wid,1)); $lala=$aantal; -$aantal2 = $database->getMovement(3,$village->wid,1); -for($i=0;$i<$aantal;$i++){ - if(($aantal2[$i]['attack_type']==1) or ($aantal2[$i]['attack_type']==3) or ($aantal2[$i]['attack_type']==4)) { $lala -= 1; } -} -if($lala > 0){ - if(!empty($NextArrival)) { reset($NextArrival); } - foreach($aantal2 as $receive) { - if ($receive['attack_type'] == 2) { - $action = 'def1'; - $aclass = 'd1'; - $title = ''.OWN_REINFORCING_TROOPS.''; - $short = ''.ARRIVING_REINF_TROOPS_SHORT.''; - $NextArrival[] = $receive['endtime']; - } - } - echo ' - '; - $timer += 1; -} - -/* Units coming back from ATTACK -$gettroops = $database->getMovement(3,$village->wid,1); -for($i=0;$i 0){ - if(!empty($NextArrival)) { reset($NextArrival); } - foreach($aantal2 as $receive) { - $action = 'att1'; - $aclass = 'a1'; - $title = 'Incoming troops'; - $short = 'Attack'; - $NextArrival[] = $receive['endtime']; - } - echo ' - '; - $timer += 1; -} -?> -
'.TROOP_MOVEMENTS.'
'.$title.'»
'.$aantal.' '.$short.'
in '.$generator->getTimeFormat(min($NextArrival)-time()).' '.HOURS.'
'.$title.'»
'.$aantal.' '.$short.'
in '.$generator->getTimeFormat(min($NextArrival)-time()).' '.HOURS.'
'.$title.'»
'.$title.'»
'.$title.'»
'.$lala.' '.$short.'
in '.$generator->getTimeFormat(min($NextArrival)-time()).' '.HOURS.'
'.$title.'»
'.$lala.' '.$short.'
in '.$generator->getTimeFormat(min($NextArrival)-time()).' '.HOURS.'
'.$title.'«
'.$aantal.' '.$short.'
in '.$generator->getTimeFormat(min($NextArrival)-time()).' '.HOURS.'
-*/ \ No newline at end of file +} \ No newline at end of file