diff --git a/GameEngine/Account.php b/GameEngine/Account.php index bcca54a7..858ba917 100644 --- a/GameEngine/Account.php +++ b/GameEngine/Account.php @@ -109,7 +109,7 @@ class Account { } } else { - $uid = $database->register($_POST['name'],md5($_POST['pw']),$_POST['email'],$_POST['vid'],$_POST['kid'],$act); + $uid = $database->register($_POST['name'],md5($_POST['pw']),$_POST['email'],$_POST['vid'],$act); if($uid) { setcookie("COOKUSR",$_POST['name'],time()+COOKIE_EXPIRE,COOKIE_PATH); setcookie("COOKEMAIL",$_POST['email'],time()+COOKIE_EXPIRE,COOKIE_PATH); @@ -131,7 +131,7 @@ class Account { $result = mysql_query($q, $database->connection); $dbarray = mysql_fetch_array($result); if($dbarray['act'] == $_POST['id']) { - $uid = $database->register($dbarray['username'],$dbarray['password'],$dbarray['email'],$dbarray['tribe'],$dbarray['location'],""); + $uid = $database->register($dbarray['username'],$dbarray['password'],$dbarray['email'],$dbarray['tribe'],""); if($uid) { $database->unreg($dbarray['username']); $this->generateBase($dbarray['kid'],$uid,$dbarray['username']); @@ -188,8 +188,13 @@ class Account { header("Location: login.php"); } else { + $userid = $database->getUserArray($_POST['user'], 0); + if($database->login($_POST['user'],$_POST['pw'])){ + $database->UpdateOnline("login" ,$_POST['user'],time(),$userid['id']); + }else if($database->sitterLogin($_POST['user'],$_POST['pw'])){ + $database->UpdateOnline("sitter" ,$_POST['user'],time(),$userid['id']); + } setcookie("COOKUSR",$_POST['user'],time()+COOKIE_EXPIRE,COOKIE_PATH); - $database->UpdateOnline("login" ,$_POST['user'],time()); $session->login($_POST['user']); } } diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 22f22c99..8417009b 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -548,6 +548,7 @@ class Automation { $isoasis = $database->isVillageOases($data['to']); $AttackArrivalTime = $data['endtime']; $AttackerWref = $data['from']; + $DefenderWref = $data['to']; if ($isoasis == 0){ $Attacker['id'] = $database->getUserField($database->getVillageField($data['from'],"owner"),"id",0); $Defender['id'] = $database->getUserField($database->getVillageField($data['to'],"owner"),"id",0); @@ -810,7 +811,7 @@ class Automation { if(!isset($Defender['hero'])){ $Defender['hero'] = '0'; } else { - if($Defender['hero']=='' or $Defender['hero']<='0'){ + if($Defender['hero']=='' or $Defender['hero']<'0'){ $Defender['hero'] = '0'; } } @@ -896,7 +897,8 @@ class Automation { $stonemason = "1"; } - $battlepart = $battle->calculateBattle($Attacker,$Defender,$def_wall,$att_tribe,$def_tribe,$residence,$attpop,$defpop,$type,$def_ab,$att_ab,$tblevel,$stonemason,$walllevel,$AttackerID,$DefenderID,$AttackerWref); + if(PEACE == False || $targettribe == 4 || $targettribe == 5){ + $battlepart = $battle->calculateBattle($Attacker,$Defender,$def_wall,$att_tribe,$def_tribe,$residence,$attpop,$defpop,$type,$def_ab,$att_ab,$tblevel,$stonemason,$walllevel,$AttackerID,$DefenderID,$AttackerWref,$DefenderWref); //units attack string for battleraport $unitssend_att = ''.$data['t1'].','.$data['t2'].','.$data['t3'].','.$data['t4'].','.$data['t5'].','.$data['t6'].','.$data['t7'].','.$data['t8'].','.$data['t9'].','.$data['t10'].''; @@ -948,8 +950,8 @@ class Automation { } $dead['hero']='0'; if($unitlist){ - $dead['hero']+=round($battlepart[2]*$unitlist[0]['hero']); - $database->modifyUnit($data['to'],array("hero"),array(round($battlepart[2]*$unitlist[0]['hero'])),array(0)); + $dead['hero']+=$battlepart['deadherodef']; + $database->modifyUnit($data['to'],array("hero"),array($battlepart['deadherodef']),array(0)); } //kill other defence in village if(count($database->getEnforceVillage($data['to'],0)) > 0) { @@ -971,8 +973,8 @@ class Automation { $dead[$i]='0'; } if($enforce['hero']>'0'){ - $database->modifyEnforce($enforce['id'],"hero",round($battlepart[2]*$enforce['hero']),0); - $dead['hero']+=round($battlepart[2]*$enforce['hero']); + $database->modifyEnforce($enforce['id'],"hero",$battlepart['deadheroref'][$enforce['id']],0); + $dead['hero']+=$battlepart['deadheroref'][$enforce['id']]; if($dead['hero']!=$enforce['hero']){ $wrong='1'; } @@ -1089,13 +1091,13 @@ class Automation { $heroxp = $totaldead_def; $database->modifyHeroXp("experience",$heroxp,$from['owner']); } - $Defender1 = $database->getUnit($data['to']); + $Defender1 = $database->getUnit($to['wref']); if($Defender1['hero'] > 0){ - $defheroowner = $database->getVillageField($Defender1['vref'],"owner"); + $defheroowner = $database->getVillageField($to['wref'],"owner"); $defheroxp = $totaldead_att; $database->modifyHeroXp("experience",$defheroxp,$defheroowner); } - $enforcementarray1 = $database->getEnforceVillage($data['to'],0); + $enforcementarray1 = $database->getEnforceVillage($to['wref'],0); if(count($enforcementarray1) > 0) { foreach($enforcementarray1 as $enforce1) { if($enforce1['hero'] > 0){ @@ -2100,6 +2102,42 @@ $crannyimg = "addGeneralAttack($totalattackdead); } + }else{ + //units attack string for battleraport + $unitssend_att = ''.$data['t1'].','.$data['t2'].','.$data['t3'].','.$data['t4'].','.$data['t5'].','.$data['t6'].','.$data['t7'].','.$data['t8'].','.$data['t9'].','.$data['t10'].''; + $herosend_att = $data['t11']; + if ($herosend_att>0){ + $unitssend_att_check=$unitssend_att.','.$data['t11']; + }else{ + $unitssend_att_check=$unitssend_att; + } + + $speeds = array(); + + //find slowest unit. + for($i=1;$i<=10;$i++) + { + if ($data['t'.$i] > 0) { + if($unitarray) { reset($unitarray); } + $unitarray = $GLOBALS["u".(($owntribe-1)*10+$i)]; + $speeds[] = $unitarray['speed']; + } + } + if ($herosend_att>0){ + $qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$from['owner'].""; + $resulth = mysql_query($qh); + $hero_f=mysql_fetch_array($resulth); + $hero_unit=$hero_f['unit']; + $speeds[] = $GLOBALS['u'.$hero_unit]['speed']; + } + $endtime = $this->procDistanceTime($from,$to,min($speeds),1) + time(); + $database->setMovementProc($data['moveid']); + $database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],time(),$endtime); + + $data2 = ''.$from['owner'].','.$from['wref'].','.$to['owner'].','.$owntribe.','.$unitssend_att_check.''; + $database->addNotice($from['owner'],$to['wref'],$ownally,22,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,time()); + $database->addNotice($to['owner'],$to['wref'],$targetally,22,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,time()); + } unset($Attacker); unset($Defender); unset($enforce); @@ -2119,7 +2157,6 @@ $crannyimg = "calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],$post['ktyp']+3,$def_ab,$att_ab,$post['kata'],1,0,0,0); + return $this->calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],$post['ktyp']+3,$def_ab,$att_ab,$post['kata'],1,0,0,0,0); else - return $this->calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],1,$def_ab,$att_ab,$post['kata'],1,0,0,0); + return $this->calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],1,$def_ab,$att_ab,$post['kata'],1,0,0,0,0); } public function getTypeLevel($tid,$vid) { @@ -207,7 +207,7 @@ class Battle { } //1 raid 0 normal - function calculateBattle($Attacker,$Defender,$def_wall,$att_tribe,$def_tribe,$residence,$attpop,$defpop,$type,$def_ab,$att_ab,$tblevel,$stonemason,$walllevel,$AttackerID,$DefenderID,$AttackerWref) { + function calculateBattle($Attacker,$Defender,$def_wall,$att_tribe,$def_tribe,$residence,$attpop,$defpop,$type,$def_ab,$att_ab,$tblevel,$stonemason,$walllevel,$AttackerID,$DefenderID,$AttackerWref,$DefenderWref) { global $database,$bid34,$bid35; // Definieer de array met de eenheden $calvary = array(4,5,6,15,16,23,24,25,26,35,36,45,46); @@ -592,12 +592,13 @@ class Battle { if ($hero_health<=$damage_health or $damage_health>90) { //hero die - $result['casualties_defender']['11'] = 1; + $result['deadherodef'] = 1; mysql_query("update " . TB_PREFIX . "hero set `dead`='1' where `heroid`='".$hero_id."'"); mysql_query("update " . TB_PREFIX . "hero set `health`='0' where `heroid`='".$hero_id."'"); } else { + $result['deadherodef'] = 0; mysql_query("update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'"); } unset($_result); @@ -605,8 +606,8 @@ class Battle { unset($hero_id); unset($hero_health); unset($damage_health); - - $DefendersAll = $database->getEnforceVillage($data['to'],0); + + $DefendersAll = $database->getEnforceVillage($DefenderWref,0); if(!empty($DefendersAll)){ foreach($DefendersAll as $defenders) { if($defenders['hero'] == 1) { @@ -622,12 +623,13 @@ class Battle { if ($hero_health<=$damage_health or $damage_health>90) { //hero die - $result['casualties_defender']['11'] = 1; + $result['deadheroref'][$defenders['id']] = 1; mysql_query("update " . TB_PREFIX . "hero set `dead`='1' where `heroid`='".$hero_id."'"); mysql_query("update " . TB_PREFIX . "hero set `health`='0' where `heroid`='".$hero_id."'"); } else { + $result['deadheroref'][$defenders['id']] = 0; mysql_query("update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'"); } } diff --git a/GameEngine/Building.php b/GameEngine/Building.php index cb3ef8d7..bff630e3 100644 --- a/GameEngine/Building.php +++ b/GameEngine/Building.php @@ -48,7 +48,7 @@ class Building { $this->constructBuilding($get['id'],$get['a']); } if(isset($get['buildingFinish'])) { - if($session->gold >= 2) { + if($session->gold >= 2 && $session->sit == 0) { $this->finishAll(); } } diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php index cb13958d..7c16ce5c 100644 --- a/GameEngine/Database/db_MYSQL.php +++ b/GameEngine/Database/db_MYSQL.php @@ -18,10 +18,10 @@ mysql_select_db(SQL_DB, $this->connection) or die(mysql_error()); } - function register($username, $password, $email, $tribe, $locate, $act) { + function register($username, $password, $email, $tribe, $act) { $time = time(); $timep = (time() + PROTECTION); - $q = "INSERT INTO " . TB_PREFIX . "users (username,password,access,email,timestamp,tribe,location,act,protect,lastupdate,regtime) VALUES ('$username', '$password', " . USER . ", '$email', $time, $tribe, $locate, '$act', $timep, $time, $time)"; + $q = "INSERT INTO " . TB_PREFIX . "users (username,password,access,email,timestamp,tribe,act,protect,lastupdate,regtime) VALUES ('$username', '$password', " . USER . ", '$email', $time, $tribe, '$act', $timep, $time, $time)"; if(mysql_query($q, $this->connection)) { return mysql_insert_id($this->connection); } else { @@ -203,12 +203,12 @@ $q2 = "SELECT password FROM " . TB_PREFIX . "users where id = " . $dbarray['sit1'] . " and access != " . BANNED; $result2 = mysql_query($q2, $this->connection); $dbarray2 = mysql_fetch_array($result2); - } else - if($dbarray['sit2'] != 0) { + } + if($dbarray['sit2'] != 0) { $q3 = "SELECT password FROM " . TB_PREFIX . "users where id = " . $dbarray['sit2'] . " and access != " . BANNED; $result3 = mysql_query($q3, $this->connection); $dbarray3 = mysql_fetch_array($result3); - } + } if($dbarray['sit1'] != 0 || $dbarray['sit2'] != 0) { if($dbarray2['password'] == md5($password) || $dbarray3['password'] == md5($password)) { return true; @@ -314,10 +314,20 @@ return mysql_query($q, $this->connection); } - function UpdateOnline($mode, $name = "", $time = "") { + function GetOnline($uid) { + $q = "SELECT sit FROM " . TB_PREFIX . "online where uid = $uid"; + $result = mysql_query($q, $this->connection); + $dbarray = mysql_fetch_array($result); + return $dbarray['sit']; + } + + function UpdateOnline($mode, $name = "", $time = "", $uid = 0) { global $session; if($mode == "login") { - $q = "INSERT IGNORE INTO " . TB_PREFIX . "online (name, time) VALUES ('$name', " . time() . ")"; + $q = "INSERT IGNORE INTO " . TB_PREFIX . "online (name, uid, time, sit) VALUES ('$name', '$uid', " . time() . ", 0)"; + return mysql_query($q, $this->connection); + } else if($mode == "sitter") { + $q = "INSERT IGNORE INTO " . TB_PREFIX . "online (name, uid, time, sit) VALUES ('$name', '$uid', " . time() . ", 1)"; return mysql_query($q, $this->connection); } else { $q = "DELETE FROM " . TB_PREFIX . "online WHERE name ='" . $session->username . "'"; @@ -1692,7 +1702,7 @@ } } if(($jobLoopconID >= 0) && ($jobs[$jobDeleted]['loopcon'] != 1)) { - if(($jobs[$jobLoopconID]['field'] <= 18 && $jobs[$jobDeleted]['field'] <= 18) || ($jobs[$jobLoopconID]['field'] >= 19 && $jobs[$jobDeleted]['field'] >= 19)) { + if(($jobs[$jobLoopconID]['field'] <= 18 && $jobs[$jobDeleted]['field'] <= 18) || ($jobs[$jobLoopconID]['field'] >= 19 && $jobs[$jobDeleted]['field'] >= 19) || sizeof($jobs) < 3) { $uprequire = $building->resourceRequired($jobs[$jobLoopconID]['field'], $jobs[$jobLoopconID]['type']); $x = "UPDATE " . TB_PREFIX . "bdata SET loopcon=0,timestamp=" . (time() + $uprequire['time']) . " WHERE wid=" . $jobs[$jobDeleted]['wid'] . " AND loopcon=1 AND master=0"; mysql_query($x, $this->connection) or die(mysql_error()); @@ -1743,6 +1753,15 @@ return $this->mysql_fetch_all($result); } + function FinishWoodcutter($wid) { + $time = time()-1; + $q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and type = 1 order by timestamp ASC"; + $result = mysql_query($q); + $dbarray = mysql_fetch_array($result); + $q = "UPDATE ".TB_PREFIX."bdata SET timestamp = $time WHERE id = '".$dbarray['id']."'"; + $this->query($q); + } + function getMasterJobs($wid) { $q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and master = 1 order by master,timestamp ASC"; $result = mysql_query($q, $this->connection); diff --git a/GameEngine/Lang/en.php b/GameEngine/Lang/en.php index 922ca971..c0ffae9a 100644 --- a/GameEngine/Lang/en.php +++ b/GameEngine/Lang/en.php @@ -79,7 +79,7 @@ define("NEXT_PROD","Production at level "); //BUILDINGS define("B1","Woodcutter"); -define("B1_DESC","The Woodcutter cuts down trees in order to produce lumber. The further you extend the bid1 the more lumber is produced by him."); +define("B1_DESC","The Woodcutter cuts down trees in order to produce lumber. The further you extend the woodcutter the more lumber is produced by him."); define("B2","Clay Pit"); define("B2_DESC","Clay is produced here. By increasing its level you increase its clay production."); define("B3","Iron Mine"); diff --git a/GameEngine/Message.php b/GameEngine/Message.php index fa0db955..eb6e48f6 100644 --- a/GameEngine/Message.php +++ b/GameEngine/Message.php @@ -347,7 +347,7 @@ $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(), $welcomemsg); + $welcomemsg = preg_replace("'%PLAYERS%'", $database->countUser()-4, $welcomemsg); $welcomemsg = preg_replace("'%ALLI%'", $database->countAlli(), $welcomemsg); return $database->sendMessage($uid, 5, WEL_TOPIC, $welcomemsg, 0); } diff --git a/GameEngine/Session.php b/GameEngine/Session.php index 88cddc93..631501ab 100644 --- a/GameEngine/Session.php +++ b/GameEngine/Session.php @@ -146,6 +146,7 @@ class Session { $this->alliance = $_SESSION['alliance_user'] = $this->userarray['alliance']; $this->checker = $_SESSION['checker']; $this->mchecker = $_SESSION['mchecker']; + $this->sit = $database->GetOnline($this->uid); $this->sit1 = $this->userarray['sit1']; $this->sit2 = $this->userarray['sit2']; $this->cp = floor($this->userarray['cp']); diff --git a/GameEngine/Units.php b/GameEngine/Units.php index 3b010fa6..0e968952 100644 --- a/GameEngine/Units.php +++ b/GameEngine/Units.php @@ -26,7 +26,7 @@ class Units { break; case "2": - if (isset($post['a'])&& $post['a']==533374){ + if (isset($post['a'])&& $post['a']==533374 && $post['disabledr'] == ""){ $this->sendTroops($post); }else{ $post = $this->loadUnits($post); @@ -39,7 +39,7 @@ class Units { break; case "3": - if (isset($post['a'])&& $post['a']==533374){ + if (isset($post['a'])&& $post['a']==533374 && $post['disabled'] == ""){ $this->sendTroops($post); }else{ $post = $this->loadUnits($post); @@ -70,6 +70,12 @@ class Units { global $database,$village,$session,$generator,$logging,$form; // Busqueda por nombre de pueblo // Confirmamos y buscamos las coordenadas por nombre de pueblo + if($post['disabledr'] != ""){ + $form->addError("error","You can't reinforce this village/oasis"); + } + if($post['disabled'] != ""){ + $form->addError("error","You can't attack this village/oasis with normal attack"); + } if( !$post['t1'] && !$post['t2'] && !$post['t3'] && !$post['t4'] && !$post['t5'] && !$post['t6'] && !$post['t7'] && !$post['t8'] && !$post['t9'] && !$post['t10'] && !$post['t11']){ $form->addError("error","You need to mark min. one troop"); diff --git a/Templates/Ajax/quest_core.tpl b/Templates/Ajax/quest_core.tpl index ef7ddd7f..98f7c334 100644 --- a/Templates/Ajax/quest_core.tpl +++ b/Templates/Ajax/quest_core.tpl @@ -51,13 +51,7 @@ if (isset($qact)){ $database->updateUserField($_SESSION['username'],'quest','2',0); $_SESSION['qst']= 2; //Give Reward - if(!$session->plus){ - mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysql_error()); - } else { - $plus=$database->getUserField($_SESSION['username'],'plus','username'); - $plus+=86400; - $database->updateUserField($_SESSION['username'],'plus',$plus,0); - } + $database->FinishWoodcutter($session->villages[0]); break; case '3': @@ -65,7 +59,13 @@ if (isset($qact)){ $_SESSION['qst']= 3; //Give Reward - $database->modifyResource($session->villages[0],50,60,30,10,1); + if(!$session->plus){ + mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysql_error()); + } else { + $plus=$database->getUserField($_SESSION['username'],'plus','username'); + $plus+=86400; + $database->updateUserField($_SESSION['username'],'plus',$plus,0); + } break; case '4': diff --git a/Templates/Alliance/alli_menu.tpl b/Templates/Alliance/alli_menu.tpl index d66ed91e..0619593b 100644 --- a/Templates/Alliance/alli_menu.tpl +++ b/Templates/Alliance/alli_menu.tpl @@ -6,8 +6,17 @@ | >Chat | >Attacks | >News - +sit == 0){ +?> | >Options + + | Options + = 1){ echo "".$enforce['hero'].""; } echo " - Upkeep
".$technology->getUpkeep($enforce,$tribe)."\"Crop\"per hour
Send back
"; + Upkeep
".$technology->getUpkeep($enforce,$tribe)."\"Crop\"per hour
Send back
"; echo ""; } diff --git a/Templates/Build/avaliable/availupgrade.tpl b/Templates/Build/avaliable/availupgrade.tpl index c5f8f4bf..2f0f6907 100644 --- a/Templates/Build/avaliable/availupgrade.tpl +++ b/Templates/Build/avaliable/availupgrade.tpl @@ -19,7 +19,7 @@ $mastertime = $uprequire['time']; The workers are already at work."; - if($session->goldclub){ + if($session->goldclub == 1){ ?>
gold >= 1 && $village->master == 0){ @@ -33,7 +33,7 @@ $mastertime = $uprequire['time']; } else if($bindicator == 3) { echo "The workers are already at work. (waiting loop)"; - if($session->goldclub){ + if($session->goldclub == 1){ ?>
gold >= 1 && $village->master == 0){ @@ -57,7 +57,7 @@ $mastertime = $uprequire['time']; else if($bindicator == 7) { $neededtime = $building->calculateAvaliable($id,$bid); echo "Enough resources ".$neededtime[0]." at ".$neededtime[1].""; - if($session->goldclub){ + if($session->goldclub == 1){ ?>
gold >= 1 && $village->master == 0){ diff --git a/Templates/Build/avaliable/wwavailupgrade.tpl b/Templates/Build/avaliable/wwavailupgrade.tpl index ff325574..52351ef2 100644 --- a/Templates/Build/avaliable/wwavailupgrade.tpl +++ b/Templates/Build/avaliable/wwavailupgrade.tpl @@ -16,7 +16,7 @@ $uprequire = $building->resourceRequired(99,$bid); The workers are already at work."; - if($session->goldclub){ + if($session->goldclub == 1){ ?>
gold >= 1){ @@ -30,7 +30,7 @@ $uprequire = $building->resourceRequired(99,$bid); } else if($bindicator == 3) { echo "The workers are already at work. (waiting loop)"; - if($session->goldclub){ + if($session->goldclub == 1){ ?>
gold >= 1){ @@ -54,7 +54,7 @@ $uprequire = $building->resourceRequired(99,$bid); else if($bindicator == 7) { $neededtime = $building->calculateAvaliable(99,$bid); echo "Enough resources ".$neededtime[0]." at ".$neededtime[1].""; - if($session->goldclub){ + if($session->goldclub == 1){ ?>
gold >= 1){ diff --git a/Templates/Build/upgrade.tpl b/Templates/Build/upgrade.tpl index 6911756f..46171c31 100644 --- a/Templates/Build/upgrade.tpl +++ b/Templates/Build/upgrade.tpl @@ -22,7 +22,7 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) { The workers are already at work."; - if($session->goldclub){ + if($session->goldclub == 1){ ?>
userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) { } else if($bindicate == 3) { echo "The workers are already at work. (waiting loop)"; - if($session->goldclub){ + if($session->goldclub == 1){ ?>
userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) { else if($bindicate == 7) { $neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master); echo "Enough resources ".$neededtime[0]." at ".$neededtime[1].""; - if($session->goldclub){ + if($session->goldclub == 1){ ?>
userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) { The workers are already at work."; - if($session->goldclub){ + if($session->goldclub == 1){ ?>
userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) { } else if($bindicate == 3) { echo "The workers are already at work. (waiting loop)"; - if($session->goldclub){ + if($session->goldclub == 1){ ?>
userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) { else if($bindicate == 7) { $neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master); echo "Enough resources ".$neededtime[0]." at ".$neededtime[1].""; - if($session->goldclub){ + if($session->goldclub == 1){ ?>
"; -if($type==18 or $type==19 or $type==20 or $type==21){ +if($type==18 or $type==19 or $type==20 or $type==21 or $type==22){ echo "\"".$topic."\""; }else{ echo " "; @@ -402,7 +402,7 @@ while($row = mysql_fetch_array($result)){ $dataarray = explode(",",$row['data']); $type = $row['ntype']; echo ""; -if($type==18 or $type==19 or $type==20 or $type==21){ +if($type==18 or $type==19 or $type==20 or $type==21 or $type==22){ echo "\"".$topic."\""; }else{ echo " "; diff --git a/Templates/Notice/1.tpl b/Templates/Notice/1.tpl index a7b35f88..a09aad47 100644 --- a/Templates/Notice/1.tpl +++ b/Templates/Notice/1.tpl @@ -150,8 +150,8 @@ for($i=45;$i<=54;$i++) { } } if($targettribe == '1' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -205,8 +205,8 @@ for($i=66;$i<=75;$i++) { } } if($targettribe == '2' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -259,8 +259,8 @@ for($i=87;$i<=96;$i++) { } } if($targettribe == '3' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -314,8 +314,8 @@ for($i=108;$i<=117;$i++) { } } if($targettribe == '4' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -369,8 +369,8 @@ for($i=129;$i<=138;$i++) { } } if($targettribe == '5' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> diff --git a/Templates/Notice/1x.tpl b/Templates/Notice/1x.tpl index eccb29b8..c80ac752 100644 --- a/Templates/Notice/1x.tpl +++ b/Templates/Notice/1x.tpl @@ -152,8 +152,8 @@ for($i=45;$i<=54;$i++) { } } if($targettribe == '1' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -207,8 +207,8 @@ for($i=66;$i<=75;$i++) { } } if($targettribe == '2' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -261,8 +261,8 @@ for($i=87;$i<=96;$i++) { } } if($targettribe == '3' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -316,8 +316,8 @@ for($i=108;$i<=117;$i++) { } } if($targettribe == '4' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -371,8 +371,8 @@ for($i=129;$i<=138;$i++) { } } if($targettribe == '5' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> diff --git a/Templates/Notice/2.tpl b/Templates/Notice/2.tpl index a7b35f88..a09aad47 100644 --- a/Templates/Notice/2.tpl +++ b/Templates/Notice/2.tpl @@ -150,8 +150,8 @@ for($i=45;$i<=54;$i++) { } } if($targettribe == '1' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -205,8 +205,8 @@ for($i=66;$i<=75;$i++) { } } if($targettribe == '2' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -259,8 +259,8 @@ for($i=87;$i<=96;$i++) { } } if($targettribe == '3' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -314,8 +314,8 @@ for($i=108;$i<=117;$i++) { } } if($targettribe == '4' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -369,8 +369,8 @@ for($i=129;$i<=138;$i++) { } } if($targettribe == '5' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> diff --git a/Templates/Notice/22.tpl b/Templates/Notice/22.tpl new file mode 100644 index 00000000..33b28f4d --- /dev/null +++ b/Templates/Notice/22.tpl @@ -0,0 +1,60 @@ +readingNotice['data']); +if(isset($dataarray[14]) and $dataarray[14]!=0){$colspan="11";}else{$colspan="10";} +?> + + + + + + + + + procMtime($message->readingNotice['time']); ?> + + + + + + +
Subject:readingNotice['topic']; ?>
Sent:on at ".$date[1]; ?> hour
+ + + + + + + + + +getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" />"; +} +if(isset($dataarray[14]) and $dataarray[14]!=0){ + echo ""; +} +echo ""; +for($i=4;$i<=13;$i++) { + if($dataarray[$i] == 0) { + echo ""; + } + else { + echo ""; + } +} +if(isset($dataarray[14]) and $dataarray[14]!=0){ + echo ""; +} +?> + + +
Attacker">getUserField($dataarray[0],"username",0); ?> from the village getVillageField($dataarray[1],"name"); ?>
 \"Hero\"
Troops0".$dataarray[$i]."$dataarray[14]
Information + Peace + getUserField($dataarray[0],"username",0)." visited ".$database->getUserField($dataarray[2],"username",0)."'s troops" ?> +
+
\ No newline at end of file diff --git a/Templates/Notice/2x.tpl b/Templates/Notice/2x.tpl index eccb29b8..c80ac752 100644 --- a/Templates/Notice/2x.tpl +++ b/Templates/Notice/2x.tpl @@ -152,8 +152,8 @@ for($i=45;$i<=54;$i++) { } } if($targettribe == '1' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -207,8 +207,8 @@ for($i=66;$i<=75;$i++) { } } if($targettribe == '2' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -261,8 +261,8 @@ for($i=87;$i<=96;$i++) { } } if($targettribe == '3' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -316,8 +316,8 @@ for($i=108;$i<=117;$i++) { } } if($targettribe == '4' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -371,8 +371,8 @@ for($i=129;$i<=138;$i++) { } } if($targettribe == '5' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> diff --git a/Templates/Notice/4.tpl b/Templates/Notice/4.tpl index a7b35f88..a09aad47 100644 --- a/Templates/Notice/4.tpl +++ b/Templates/Notice/4.tpl @@ -150,8 +150,8 @@ for($i=45;$i<=54;$i++) { } } if($targettribe == '1' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -205,8 +205,8 @@ for($i=66;$i<=75;$i++) { } } if($targettribe == '2' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -259,8 +259,8 @@ for($i=87;$i<=96;$i++) { } } if($targettribe == '3' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -314,8 +314,8 @@ for($i=108;$i<=117;$i++) { } } if($targettribe == '4' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -369,8 +369,8 @@ for($i=129;$i<=138;$i++) { } } if($targettribe == '5' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> diff --git a/Templates/Notice/4x.tpl b/Templates/Notice/4x.tpl index eccb29b8..c80ac752 100644 --- a/Templates/Notice/4x.tpl +++ b/Templates/Notice/4x.tpl @@ -152,8 +152,8 @@ for($i=45;$i<=54;$i++) { } } if($targettribe == '1' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -207,8 +207,8 @@ for($i=66;$i<=75;$i++) { } } if($targettribe == '2' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -261,8 +261,8 @@ for($i=87;$i<=96;$i++) { } } if($targettribe == '3' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -316,8 +316,8 @@ for($i=108;$i<=117;$i++) { } } if($targettribe == '4' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -371,8 +371,8 @@ for($i=129;$i<=138;$i++) { } } if($targettribe == '5' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> diff --git a/Templates/Notice/5.tpl b/Templates/Notice/5.tpl index a7b35f88..a09aad47 100644 --- a/Templates/Notice/5.tpl +++ b/Templates/Notice/5.tpl @@ -150,8 +150,8 @@ for($i=45;$i<=54;$i++) { } } if($targettribe == '1' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -205,8 +205,8 @@ for($i=66;$i<=75;$i++) { } } if($targettribe == '2' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -259,8 +259,8 @@ for($i=87;$i<=96;$i++) { } } if($targettribe == '3' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -314,8 +314,8 @@ for($i=108;$i<=117;$i++) { } } if($targettribe == '4' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -369,8 +369,8 @@ for($i=129;$i<=138;$i++) { } } if($targettribe == '5' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> diff --git a/Templates/Notice/5x.tpl b/Templates/Notice/5x.tpl index eccb29b8..c80ac752 100644 --- a/Templates/Notice/5x.tpl +++ b/Templates/Notice/5x.tpl @@ -152,8 +152,8 @@ for($i=45;$i<=54;$i++) { } } if($targettribe == '1' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -207,8 +207,8 @@ for($i=66;$i<=75;$i++) { } } if($targettribe == '2' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -261,8 +261,8 @@ for($i=87;$i<=96;$i++) { } } if($targettribe == '3' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -316,8 +316,8 @@ for($i=108;$i<=117;$i++) { } } if($targettribe == '4' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -371,8 +371,8 @@ for($i=129;$i<=138;$i++) { } } if($targettribe == '5' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> diff --git a/Templates/Notice/6.tpl b/Templates/Notice/6.tpl index a7b35f88..a09aad47 100644 --- a/Templates/Notice/6.tpl +++ b/Templates/Notice/6.tpl @@ -150,8 +150,8 @@ for($i=45;$i<=54;$i++) { } } if($targettribe == '1' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -205,8 +205,8 @@ for($i=66;$i<=75;$i++) { } } if($targettribe == '2' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -259,8 +259,8 @@ for($i=87;$i<=96;$i++) { } } if($targettribe == '3' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -314,8 +314,8 @@ for($i=108;$i<=117;$i++) { } } if($targettribe == '4' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -369,8 +369,8 @@ for($i=129;$i<=138;$i++) { } } if($targettribe == '5' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> diff --git a/Templates/Notice/6x.tpl b/Templates/Notice/6x.tpl index eccb29b8..c80ac752 100644 --- a/Templates/Notice/6x.tpl +++ b/Templates/Notice/6x.tpl @@ -152,8 +152,8 @@ for($i=45;$i<=54;$i++) { } } if($targettribe == '1' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -207,8 +207,8 @@ for($i=66;$i<=75;$i++) { } } if($targettribe == '2' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -261,8 +261,8 @@ for($i=87;$i<=96;$i++) { } } if($targettribe == '3' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -316,8 +316,8 @@ for($i=108;$i<=117;$i++) { } } if($targettribe == '4' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> @@ -371,8 +371,8 @@ for($i=129;$i<=138;$i++) { } } if($targettribe == '5' and isset($dataarray[149]) and $dataarray[149]!=0){ - if ($dataarray[150]==0){$tdclass='class="none"';} - echo "$dataarray[150]"; + if ($dataarray[150]==0){$tdclass1='class="none"';} + echo "$dataarray[150]"; } ?> diff --git a/Templates/Notice/all.tpl b/Templates/Notice/all.tpl index 6523e051..b4dd99cf 100644 --- a/Templates/Notice/all.tpl +++ b/Templates/Notice/all.tpl @@ -1,5 +1,5 @@
"; - }else if($type==18 or $type==19 or $type==20 or $type==21){ + }else if($type==18 or $type==19 or $type==20 or $type==21 or $type==22){ echo "\"".$noticeClass[$type]."\""; }else{ echo "\"".$noticeClass[$type]."\""; diff --git a/Templates/Plus/10.tpl b/Templates/Plus/10.tpl index 03d3e8ff..b23a1578 100644 --- a/Templates/Plus/10.tpl +++ b/Templates/Plus/10.tpl @@ -15,7 +15,7 @@ if($session->access != BANNED){ $goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error()); $today = date("mdHi"); - +if($session->sit == 0) { if (mysql_num_rows($MyGold)) { if($golds['6'] > 2) { @@ -41,6 +41,7 @@ $done1 = "nothing has been done"; $done1 = "You need more gold"; } } +} diff --git a/Templates/Plus/11.tpl b/Templates/Plus/11.tpl index 3bd144ae..077b4132 100644 --- a/Templates/Plus/11.tpl +++ b/Templates/Plus/11.tpl @@ -15,7 +15,7 @@ if($session->access != BANNED){ $goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error()); $today = date("mdHi"); - +if($session->sit == 0) { if (mysql_num_rows($MyGold)) { if($golds['6'] > 2) { @@ -41,6 +41,7 @@ $done1 = "nothing has been done"; $done1 = "You need more gold"; } } +} diff --git a/Templates/Plus/12.tpl b/Templates/Plus/12.tpl index 74c8bc64..2b0e566e 100644 --- a/Templates/Plus/12.tpl +++ b/Templates/Plus/12.tpl @@ -15,7 +15,7 @@ if($session->access != BANNED){ $goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error()); $today = date("mdHi"); - +if($session->sit == 0) { if (mysql_num_rows($MyGold)) { if($golds['6'] > 2) { @@ -41,6 +41,7 @@ $done1 = "nothing has been done"; $done1 = "You need more gold"; } } +} diff --git a/Templates/Plus/13.tpl b/Templates/Plus/13.tpl index b5b750d7..9983bfe8 100644 --- a/Templates/Plus/13.tpl +++ b/Templates/Plus/13.tpl @@ -20,6 +20,7 @@ "; mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-1)." where `username`='".$session->username."'") or die(mysql_error()); */ +} ?> diff --git a/Templates/Plus/15.tpl b/Templates/Plus/15.tpl index 81b62e4a..b6682978 100644 --- a/Templates/Plus/15.tpl +++ b/Templates/Plus/15.tpl @@ -1,7 +1,7 @@ access != BANNED){ -if($session->gold >= 100) { +if($session->gold >= 100 && $session->sit == 0) { mysql_query("UPDATE ".TB_PREFIX."users set goldclub = 1, gold = gold - 100 where `username`='".$session->username."'"); } header("Location: plus.php?id=3"); diff --git a/Templates/Plus/7.tpl b/Templates/Plus/7.tpl index 2a2ef554..6eb7216a 100644 --- a/Templates/Plus/7.tpl +++ b/Templates/Plus/7.tpl @@ -17,7 +17,7 @@ if($session->access != BANNED){ $goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error()); $today = date("mdHi"); - +if($session->sit == 0) { if (mysql_num_rows($MyGold)) { if($golds['6'] > 2) { @@ -41,6 +41,7 @@ $done1 = "   Nothing has been Completed"; $done1 = "  You need more Gold"; } } +} diff --git a/Templates/Plus/8.tpl b/Templates/Plus/8.tpl index 26b3307e..7417d433 100644 --- a/Templates/Plus/8.tpl +++ b/Templates/Plus/8.tpl @@ -15,7 +15,7 @@ if($session->access != BANNED){ $goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error()); $today = date("mdHi"); - +if($session->sit == 0) { if (mysql_num_rows($MyGold)) { if($golds['6'] > 2) { @@ -42,6 +42,7 @@ $done1 = "nothing has been done"; $done1 = "  You need more gold"; } } +} diff --git a/Templates/Plus/9.tpl b/Templates/Plus/9.tpl index a696e26f..433749a1 100644 --- a/Templates/Plus/9.tpl +++ b/Templates/Plus/9.tpl @@ -15,7 +15,7 @@ if($session->access != BANNED){ $goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error()); $today = date("mdHi"); - +if($session->sit == 0) { if (mysql_num_rows($MyGold)) { if($golds['6'] > 2) { @@ -41,6 +41,7 @@ $done1 = "nothing has been done"; $done1 = "You need more gold"; } } +} diff --git a/Templates/Profile/menu2.tpl b/Templates/Profile/menu2.tpl new file mode 100644 index 00000000..736564d1 --- /dev/null +++ b/Templates/Profile/menu2.tpl @@ -0,0 +1,14 @@ +
+ >Overview + | Profile + | Preferences + | Account + + | Graphic pack + + +
\ No newline at end of file diff --git a/Templates/Profile/overview.tpl b/Templates/Profile/overview.tpl index d40139b2..3ac94ca0 100644 --- a/Templates/Profile/overview.tpl +++ b/Templates/Profile/overview.tpl @@ -27,8 +27,15 @@ foreach($varray as $vil) { ?>

Player profile

-uid) { include("menu.tpl"); } ?> +uid) { +if($session->sit == 0){ +include("menu.tpl"); +}else{ +include("menu2.tpl"); +} +} +?>
sit == 0) { /* $MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `username`='".$session->username."'") or die(mysql_error()); $golds = mysql_fetch_array($MyGold); @@ -35,6 +36,7 @@ echo "
@@ -118,7 +125,11 @@ if($_GET['uid'] == $session->uid) { include("menu.tpl"); } ?> uid) { + if($session->sit == 0){ echo ""; + }else{ + echo ""; + } } else { echo ""; } diff --git a/Templates/a2b/search.tpl b/Templates/a2b/search.tpl index dcaf7118..7c1b335a 100644 --- a/Templates/a2b/search.tpl +++ b/Templates/a2b/search.tpl @@ -1,4 +1,6 @@
» Change profile » Change profile » Write message
+ + @@ -27,7 +29,7 @@ diff --git a/a2b.php b/a2b.php index 9531a63a..1b8e25dc 100644 --- a/a2b.php +++ b/a2b.php @@ -48,10 +48,21 @@ if(isset($_GET['o'])) { $o = $_GET['o']; $oid = $_GET['z']; $too = $database->getOasisField($oid,"conqured"); - if($too['conqured'] == 0){$disabledr ="disabled=disabled";}else{ + if($too['conqured'] == 0){$disabledr ="disabled=disabled"; $disabled ="disabled=disabled";}else{ $disabledr =""; + if($session->sit == 0){ + $disabled =""; + }else{ + $disabled ="disabled=disabled"; + } } $checked ="checked=checked"; +}else{ + if($session->sit == 0){ + $disabled =""; + }else{ + $disabled ="disabled=disabled"; + } } $process = $units->procUnits($_POST); $automation->isWinner(); diff --git a/allianz.php b/allianz.php index 58375755..ae1607b7 100644 --- a/allianz.php +++ b/allianz.php @@ -168,6 +168,7 @@ if($_GET['aid'] or $session->alliance!=0){ } if(isset($_GET['s'])) { + if($_GET['s'] != 5 or $session->sit == 0){ switch($_GET['s']) { case 2: include ("Templates/Alliance/forum.tpl"); @@ -190,7 +191,9 @@ if($_GET['aid'] or $session->alliance!=0){ break; } // Options - } elseif(isset($_POST['o'])) { + }else{ + header("Location: allianz.php"); + }} elseif(isset($_POST['o'])) { switch($_POST['o']) { case 1: if(isset($_POST['s']) == 5 && isset($_POST['a_user'])) { diff --git a/gpack/travian_default/img/scouts/22.gif b/gpack/travian_default/img/scouts/22.gif new file mode 100644 index 00000000..f6cc1d98 Binary files /dev/null and b/gpack/travian_default/img/scouts/22.gif differ diff --git a/install/data/constant_format.tpl b/install/data/constant_format.tpl index e995b62b..4c7b9f77 100644 --- a/install/data/constant_format.tpl +++ b/install/data/constant_format.tpl @@ -114,7 +114,8 @@ define("TS_THRESHOLD",%TS_THRESHOLD%); // ***** Register open/close define("REG_OPEN",%REG_OPEN%); - +// ***** Peace system +define("PEACE",%PEACE%); ////////////////////////////////// // **** LOG SETTINGS **** // diff --git a/install/data/sql.sql b/install/data/sql.sql index cd4aa5f9..19d1a23f 100644 --- a/install/data/sql.sql +++ b/install/data/sql.sql @@ -1027,7 +1027,9 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%odata` ( CREATE TABLE IF NOT EXISTS `%PREFIX%online` ( `name` varchar(32) NOT NULL, + `uid` int(10) unsigned NOT NULL, `time` varchar(32) NOT NULL, + `sit` tinyint(1) unsigned NOT NULL, UNIQUE KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/install/process.php b/install/process.php index 3bd191d7..cdedd3a4 100644 --- a/install/process.php +++ b/install/process.php @@ -93,6 +93,7 @@ $text = preg_replace("'%WW%'", $_POST['ww'], $text); $text = preg_replace("'%T4_COMING%'", $_POST['t4_coming'], $text); $text = preg_replace("'%REG_OPEN%'", $_POST['reg_open'], $text); + $text = preg_replace("'%PEACE%'", $_POST['peace'], $text); fwrite($fh, $text); diff --git a/install/templates/config.tpl b/install/templates/config.tpl index 4be7fc39..692615c0 100644 --- a/install/templates/config.tpl +++ b/install/templates/config.tpl @@ -89,7 +89,13 @@ echo "
Error creating constant.php -
+ +
@@ -16,7 +18,7 @@
Peace system: + +

diff --git a/spieler.php b/spieler.php index f9e619d1..3696668b 100644 --- a/spieler.php +++ b/spieler.php @@ -146,7 +146,7 @@ else if (isset($_GET['s'])) { if($_GET['s'] == 4) { include("Templates/Profile/graphic.tpl"); } - if($_GET['s'] > 4) { + if($_GET['s'] > 4 or $session->sit == 1) { header("Location: ".$_SERVER['PHP_SELF']."?uid=".$session->uid); } }