diff --git a/GameEngine/Database/DatabaseForumQueries.php b/GameEngine/Database/DatabaseForumQueries.php index 81f6da1f..396c9465 100644 --- a/GameEngine/Database/DatabaseForumQueries.php +++ b/GameEngine/Database/DatabaseForumQueries.php @@ -29,7 +29,13 @@ trait DatabaseForumQueries { * @return array Returns all user's shared forums */ - function getSharedForums($uid, $alliance){ + function getSharedForums($uid, $alliance) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $uid = (int) $uid; + $alliance = (int) $alliance; + list($uid, $alliance) = $this->escape_input((int) $uid, (int) $alliance); $allianceForums = $confForums = $closedForums = []; @@ -108,7 +114,13 @@ trait DatabaseForumQueries { * @return int Returns the total amount of the wanted forum */ - function countForums($forumArea, $ally){ + function countForums($forumArea, $ally) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $forumArea = (int) $forumArea; + $ally = (int) $ally; + list($forumArea, $ally) = $this->escape_input((int) $forumArea, (int) $ally); $q = "SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE ".($ally != -1 ? "alliance = $ally AND" : "")." forum_area = $forumArea"; @@ -118,6 +130,11 @@ trait DatabaseForumQueries { // no need to refactor this method function CheckForum($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input((int) $id); $q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "forum_cat where alliance = $id"; @@ -127,6 +144,11 @@ trait DatabaseForumQueries { // no need to refactor this method function CountCat($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); $q = "SELECT count(id) FROM " . TB_PREFIX . "forum_topic where cat = '$id'"; @@ -137,6 +159,11 @@ trait DatabaseForumQueries { // no need to refactor this method function LastTopic($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); $q = "SELECT * from " . TB_PREFIX . "forum_topic where cat = '$id' order by post_date"; @@ -145,6 +172,11 @@ trait DatabaseForumQueries { } function CheckLastTopic($id, $use_cache = true) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); // first of all, check if we should be using cache and whether the field @@ -165,6 +197,11 @@ trait DatabaseForumQueries { } function CheckLastPost($id, $use_cache = true) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); // first of all, check if we should be using cache and whether the field @@ -185,6 +222,11 @@ trait DatabaseForumQueries { } function LastPost($id, $use_cache = true) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); // first of all, check if we should be using cache and whether the field @@ -201,6 +243,11 @@ trait DatabaseForumQueries { } function CountTopic($id, $use_cache = true) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); // first of all, check if we should be using cache and whether the field @@ -223,6 +270,11 @@ trait DatabaseForumQueries { // no need to cache this method function CountPost($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); $q = "SELECT count(id) FROM " . TB_PREFIX . "forum_post where topic = '$id'"; @@ -233,6 +285,12 @@ trait DatabaseForumQueries { // no need to cache this method function ForumCat($id, $mode = 0) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + $mode = (int) $mode; + list($id, $mode) = $this->escape_input($id, $mode); $q = "SELECT * from " . TB_PREFIX . "forum_cat where alliance = '$id' ".(!$mode ? "OR forum_area = 1" : "")." ORDER BY sorting DESC, id"; @@ -242,6 +300,11 @@ trait DatabaseForumQueries { // no need to cache this method function ForumCatEdit($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); $q = "SELECT * from " . TB_PREFIX . "forum_cat where id = '$id'"; @@ -251,6 +314,11 @@ trait DatabaseForumQueries { // no need to cache this method function ForumCatAlliance($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); $q = "SELECT alliance from " . TB_PREFIX . "forum_cat where id = $id LIMIT 1"; @@ -261,6 +329,11 @@ trait DatabaseForumQueries { // no need to cache this method function ForumCatName($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); $q = "SELECT forum_name from " . TB_PREFIX . "forum_cat where id = $id LIMIT 1"; @@ -271,6 +344,11 @@ trait DatabaseForumQueries { // no need to cache this method function CheckCatTopic($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); $q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_topic where cat = $id"; @@ -280,6 +358,11 @@ trait DatabaseForumQueries { // no need to cache this method function CheckResultEdit($alli) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $alli = (int) $alli; + list($alli) = $this->escape_input($alli); $q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_edit where alliance = $alli"; @@ -289,6 +372,11 @@ trait DatabaseForumQueries { // no need to cache this method function CheckCloseTopic($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input((int) $id); $q = "SELECT close from " . TB_PREFIX . "forum_topic where id = '$id' LIMIT 1"; @@ -298,6 +386,11 @@ trait DatabaseForumQueries { } function CheckEditRes($alli, $use_cache = true) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $alli = (int) $alli; + list($alli) = $this->escape_input($alli); // first of all, check if we should be using cache and whether the field @@ -315,6 +408,12 @@ trait DatabaseForumQueries { } function CreatResultEdit($alli, $result) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $alli = (int) $alli; + $result = (int) $result; + list($alli, $result) = $this->escape_input($alli, $result); $q = "INSERT into " . TB_PREFIX . "forum_edit values (0,'$alli','$result')"; @@ -323,6 +422,12 @@ trait DatabaseForumQueries { } function UpdateResultEdit($alli, $result) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $alli = (int) $alli; + $result = (int) $result; + list($alli, $result) = $this->escape_input($alli, $result); $date = time(); @@ -330,7 +435,15 @@ trait DatabaseForumQueries { return mysqli_query($this->dblink,$q); } - function MoveForum($id, $area, $ally, $mode){ + function MoveForum($id, $area, $ally, $mode) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + $area = (int) $area; + $ally = (int) $ally; + $mode = (int) $mode; + list($id, $area, $ally, $mode) = $this->escape_input((int) $id, (int) $area, (int) $ally, $mode); $q = "UPDATE @@ -343,6 +456,12 @@ trait DatabaseForumQueries { } function UpdateEditTopic($id, $title, $cat) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + $cat = (int) $cat; + list($id, $title, $cat) = $this->escape_input((int) $id, $title, $cat); $q = "UPDATE " . TB_PREFIX . "forum_topic set title = '$title', cat = '$cat' where id = $id"; @@ -350,6 +469,11 @@ trait DatabaseForumQueries { } function UpdateEditForum($id, $name, $des, $alliances, $users) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id, $name, $des, $alliances, $users) = $this->escape_input((int) $id, $name, $des, $alliances, $users); $q = "UPDATE " . TB_PREFIX . "forum_cat SET forum_name = '$name', forum_des = '$des', display_to_alliances = '$alliances', display_to_users = '$users' WHERE id = $id"; @@ -357,6 +481,12 @@ trait DatabaseForumQueries { } function StickTopic($id, $mode) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + $mode = (int) $mode; + list($id, $mode) = $this->escape_input((int) $id, (int) $mode); $q = "UPDATE " . TB_PREFIX . "forum_topic SET stick = $mode WHERE id = $id"; @@ -365,6 +495,11 @@ trait DatabaseForumQueries { // no need to cache this method function ForumCatTopic($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); $q = "SELECT * from " . TB_PREFIX . "forum_topic where cat = '$id' AND stick = '' ORDER BY post_date desc"; @@ -374,6 +509,11 @@ trait DatabaseForumQueries { // no need to cache this method function ForumCatTopicStick($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); $q = "SELECT * from " . TB_PREFIX . "forum_topic where cat = '$id' AND stick = '1' ORDER BY post_date desc"; @@ -383,6 +523,11 @@ trait DatabaseForumQueries { // no need to cache this method function ShowTopic($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input((int) $id); $q = "SELECT * from " . TB_PREFIX . "forum_topic where id = $id"; @@ -392,6 +537,11 @@ trait DatabaseForumQueries { // no need to cache this method function ShowPost($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); $q = "SELECT * from " . TB_PREFIX . "forum_post where topic = '$id' ORDER BY id ASC"; @@ -401,6 +551,11 @@ trait DatabaseForumQueries { // no need to cache this method function ShowPostEdit($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input((int) $id); $q = "SELECT * from " . TB_PREFIX . "forum_post where id = $id"; @@ -409,6 +564,13 @@ trait DatabaseForumQueries { } function CreatForum($owner, $alli, $name, $des, $area, $alliances, $users) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $owner = (int) $owner; + $alli = (int) $alli; + $area = (int) $area; + list($owner, $alli, $name, $des, $area, $alliances, $users) = $this->escape_input($owner, $alli, $name, $des, $area, $alliances, $users); $q = "INSERT into " . TB_PREFIX . "forum_cat values (0, 0,'$owner','$alli','$name','$des','$area','$alliances','$users')"; @@ -417,6 +579,14 @@ trait DatabaseForumQueries { } function CreatTopic($title, $post, $cat, $owner, $alli, $ends) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $cat = (int) $cat; + $owner = (int) $owner; + $alli = (int) $alli; + $ends = (int) $ends; + list($title, $post, $cat, $owner, $alli, $ends) = $this->escape_input($title, $post, (int) $cat, (int) $owner, (int) $alli, (int) $ends); $date = time(); @@ -430,6 +600,12 @@ trait DatabaseForumQueries { *************************/ function createSurvey($topic, $title, $option1, $option2, $option3, $option4, $option5, $option6, $option7, $option8, $ends) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $topic = (int) $topic; + $ends = (int) $ends; + list($topic, $title, $option1, $option2, $option3, $option4, $option5, $option6, $option7, $option8, $ends) = $this->escape_input($topic, $title, $option1, $option2, $option3, $option4, $option5, $option6, $option7, $option8, $ends); $q = "INSERT into " . TB_PREFIX . "forum_survey (topic,title,option1,option2,option3,option4,option5,option6,option7,option8,ends) values ('$topic','$title','$option1','$option2','$option3','$option4','$option5','$option6','$option7','$option8','$ends')"; @@ -438,6 +614,11 @@ trait DatabaseForumQueries { // no need to cache this method function getSurvey($topic) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $topic = (int) $topic; + list($topic) = $this->escape_input((int) $topic); $q = "SELECT * FROM " . TB_PREFIX . "forum_survey where topic = $topic LIMIT 1"; @@ -447,6 +628,11 @@ trait DatabaseForumQueries { // no need to cache this method function checkSurvey($topic) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $topic = (int) $topic; + list($topic) = $this->escape_input((int) $topic); $q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "forum_survey where topic = $topic"; @@ -460,6 +646,12 @@ trait DatabaseForumQueries { } function Vote($topic, $num, $text) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $topic = (int) $topic; + $num = (int) $num; + list($topic, $num, $text) = $this->escape_input((int) $topic, (int) $num, $text); $q = "UPDATE " . TB_PREFIX . "forum_survey set vote".$num." = vote".$num." + 1, voted = '$text' where topic = ".$topic.""; @@ -468,6 +660,12 @@ trait DatabaseForumQueries { // no need to cache this method function checkVote($topic, $uid) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $topic = (int) $topic; + $uid = (int) $uid; + list( $topic, $uid ) = $this->escape_input( (int) $topic, $uid ); $q = "SELECT voted FROM " . TB_PREFIX . "forum_survey where topic = $topic LIMIT 1"; @@ -484,6 +682,11 @@ trait DatabaseForumQueries { // no need to cache this method function getVoteSum($topic) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $topic = (int) $topic; + list( $topic ) = $this->escape_input( (int) $topic ); $q = "SELECT * FROM " . TB_PREFIX . "forum_survey where topic = $topic LIMIT 1"; @@ -504,6 +707,13 @@ trait DatabaseForumQueries { *************************/ function CreatPost($post, $tids, $owner, $fid2 = 0) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $tids = (int) $tids; + $owner = (int) $owner; + $fid2 = (int) $fid2; + global $message, $session; list($post, $tids, $owner, $fid2) = $this->escape_input($post, (int) $tids, $owner, (int) $fid2); @@ -546,6 +756,11 @@ trait DatabaseForumQueries { } function UpdatePostDate($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input((int) $id); $date = time(); @@ -554,6 +769,11 @@ trait DatabaseForumQueries { } function EditUpdateTopic($id, $post) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id, $post) = $this->escape_input((int) $id, $post); $q = "UPDATE " . TB_PREFIX . "forum_topic set post = '$post' where id = $id"; @@ -562,6 +782,11 @@ trait DatabaseForumQueries { } function EditUpdatePost($id, $post) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id, $post) = $this->escape_input((int) $id, $post); $q = "UPDATE " . TB_PREFIX . "forum_post set post = '$post' where id = $id"; @@ -569,6 +794,12 @@ trait DatabaseForumQueries { } function LockTopic($id, $mode) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + $mode = (int) $mode; + list($id, $mode) = $this->escape_input((int) $id, $mode); $q = "UPDATE " . TB_PREFIX . "forum_topic set close = '$mode' where id = $id"; @@ -576,6 +807,11 @@ trait DatabaseForumQueries { } function DeleteCat($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); $qs = "DELETE from " . TB_PREFIX . "forum_cat where id = '$id'"; @@ -595,6 +831,11 @@ trait DatabaseForumQueries { } function DeleteSurvey($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + if (!is_array($id)) { $id = [$id]; } @@ -608,6 +849,11 @@ trait DatabaseForumQueries { } function DeleteTopic($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); $qs = "DELETE from " . TB_PREFIX . "forum_topic where id = '$id'"; @@ -615,6 +861,11 @@ trait DatabaseForumQueries { } function DeletePost($id) { + // Identificatorii intra in SQL fara ghilimele ("where id = $id"), + // iar mysqli_real_escape_string nu protejeaza contextul numeric. + // Conversia la intreg e singura care opreste "5 OR 1=1". + $id = (int) $id; + list($id) = $this->escape_input($id); $q = "DELETE from " . TB_PREFIX . "forum_post where id = '$id'"; diff --git a/Templates/Alliance/alli_menu.tpl b/Templates/Alliance/alli_menu.tpl index 2a6c11f7..22b3f768 100644 --- a/Templates/Alliance/alli_menu.tpl +++ b/Templates/Alliance/alli_menu.tpl @@ -1,15 +1,21 @@ ForumCatAlliance($_GET['fid']); + $aid = $database->ForumCatAlliance((int) $_GET['fid']); } else if (isset($_GET['fid2']) && !empty($_GET['fid2'])) { - $aid = $database->ForumCatAlliance($_GET['fid2']); + $aid = $database->ForumCatAlliance((int) $_GET['fid2']); } else { $aid = $session->alliance; } @@ -98,11 +117,11 @@ if ( isset($_POST['thema']) && !empty($_POST['thema']) && Alliance::canAct([ 'aid' => $aid, - 'alliance' => ($topic = reset($database->ShowTopic($_POST['tid'])))['alliance'], + 'alliance' => ($topic = reset($database->ShowTopic((int) $_POST['tid'])))['alliance'], 'forum_perm' => $opt['opt5'], 'admin' => $_GET['admin'], 'owner' => $topic['owner'], - 'forum_owner' => ($forumData = reset($database->ForumCatEdit($_POST['fid'])))['owner'] + 'forum_owner' => ($forumData = reset($database->ForumCatEdit((int) $_POST['fid'])))['owner'] ], 1) && ( ($forumData['forum_area'] != 1 && @@ -130,14 +149,14 @@ if ( isset($_POST['u1']) && !empty($_POST['u1']) && isset($_POST['u2']) && !empty($_POST['u2']) && ( - ($database->ForumCatAlliance($_POST['fid']) == $session->alliance && $opt['opt5'] == 1) + ($database->ForumCatAlliance((int) $_POST['fid']) == $session->alliance && $opt['opt5'] == 1) || $session->access == ADMIN ) ) { $forumViewable['alliances'] = $forumViewable['users'] = ""; - $forumData = reset($database->ForumCatEdit($_POST['fid'])); + $forumData = reset($database->ForumCatEdit((int) $_POST['fid'])); // visibility logic unchanged if ($forumData['forum_area'] != 1) { @@ -172,7 +191,7 @@ if ( !empty($_POST['thema']) && !empty($_POST['text']) && !empty($_POST['fid']) && ( ( - ($forumData = reset($database->ForumCatEdit($_POST['fid'])))['alliance'] == $session->alliance || + ($forumData = reset($database->ForumCatEdit((int) $_POST['fid'])))['alliance'] == $session->alliance || $forumData['forum_area'] == 1 || $alliance->isForumAccessible($_POST['fid']) ) && @@ -240,12 +259,12 @@ if ( !empty($_POST['text']) && !empty($_POST['tid']) && !empty($_POST['fid2']) && ( ( - ($forumData = reset($database->ForumCatEdit($_POST['fid2'])))['alliance'] == $session->alliance || + ($forumData = reset($database->ForumCatEdit((int) $_POST['fid2'])))['alliance'] == $session->alliance || $forumData['forum_area'] == 1 || $alliance->isForumAccessible($_POST['fid2']) ) && ( - ($forumData['forum_area'] != 3 && !reset($database->ShowTopic($_POST['tid']))['close']) + ($forumData['forum_area'] != 3 && !reset($database->ShowTopic((int) $_POST['tid']))['close']) || ($forumData['forum_area'] == 3 && $opt['opt5'] == 1) ) ) @@ -274,7 +293,7 @@ if ( isset($_POST['tid']) && !empty($_POST['tid']) && Alliance::canAct([ 'aid' => $aid, - 'alliance' => ($topic = reset($database->ShowTopic($_POST['tid'])))['alliance'], + 'alliance' => ($topic = reset($database->ShowTopic((int) $_POST['tid'])))['alliance'], 'forum_perm' => $opt['opt5'], 'admin' => (!empty($_GET['admin']) ? $_GET['admin'] : ''), 'owner' => $topic['owner'], @@ -303,7 +322,7 @@ if ( Alliance::canAct([ 'aid' => $aid, 'alliance' => ($topic = reset($database->ShowTopic( - ($post = reset($database->ShowPostEdit($_POST['pod'])))['topic'] + ($post = reset($database->ShowPostEdit((int) $_POST['pod'])))['topic'] )))['alliance'], 'forum_perm' => $opt['opt5'], 'owner' => $post['owner'], @@ -343,13 +362,13 @@ if ( $_GET['admin'] == "pos" && isset($_GET['res'], $_GET['fid']) && !empty($_GET['fid']) && ( - ($database->ForumCatAlliance($_GET['fid']) == $session->alliance && $opt['opt5'] == 1) || - ($forumData = reset($database->ForumCatEdit($_GET['fid'])))['owner'] == $session->uid + ($database->ForumCatAlliance((int) $_GET['fid']) == $session->alliance && $opt['opt5'] == 1) || + ($forumData = reset($database->ForumCatEdit((int) $_GET['fid'])))['owner'] == $session->uid && $session->access == ADMIN ) ) { - $database->moveForum($_GET['fid'], $forumData['forum_area'], $session->alliance, $_GET['res']); + $database->moveForum((int) $_GET['fid'], $forumData['forum_area'], $session->alliance, $_GET['res']); $alliance->redirect($_GET); } @@ -421,14 +440,14 @@ elseif ( isset($_GET['idf']) && !empty($_GET['idf']) && ( ( - ($database->ForumCatAlliance($_GET['idf']) == $session->alliance && $opt['opt5'] == 1) || - ($forumData = reset($database->ForumCatEdit($_GET['idf'])))['owner'] == $session->uid + ($database->ForumCatAlliance((int) $_GET['idf']) == $session->alliance && $opt['opt5'] == 1) || + ($forumData = reset($database->ForumCatEdit((int) $_GET['idf'])))['owner'] == $session->uid ) || ($forumData['alliance'] == 0 && $session->access == ADMIN) ) ) { - $database->DeleteCat($_GET['idf']); + $database->DeleteCat((int) $_GET['idf']); $alliance->redirect($_GET); } @@ -442,15 +461,15 @@ elseif ( !empty($_GET['pod']) && !empty($_GET['tid']) && !empty($_GET['fid2']) && Alliance::canAct([ 'aid' => $aid, - 'alliance' => reset($database->ShowTopic($_GET['tid']))['alliance'], + 'alliance' => reset($database->ShowTopic((int) $_GET['tid']))['alliance'], 'forum_perm' => $opt['opt5'], - 'owner' => reset($database->ShowPostEdit($_GET['pod']))['owner'], + 'owner' => reset($database->ShowPostEdit((int) $_GET['pod']))['owner'], 'admin' => $_GET['admin'], - 'forum_owner' => reset($database->ForumCatEdit($_GET['fid2']))['owner'] + 'forum_owner' => reset($database->ForumCatEdit((int) $_GET['fid2']))['owner'] ], 1) ) { - $database->DeletePost($_GET['pod']); + $database->DeletePost((int) $_GET['pod']); header("Location: allianz.php?s=2&fid2=".$_GET['fid2']."&tid=".$_GET['tid']); exit; @@ -467,11 +486,11 @@ elseif ($_GET['admin'] == "editpost" && !empty($_GET['pod']) && !empty($_GET['tid']) && !empty($_GET['fid']) && Alliance::canAct([ 'aid' => $aid, - 'alliance' => reset($database->ShowTopic($_GET['tid']))['alliance'], + 'alliance' => reset($database->ShowTopic((int) $_GET['tid']))['alliance'], 'forum_perm' => $opt['opt5'], - 'owner' => reset($database->ShowPostEdit($_GET['pod']))['owner'], + 'owner' => reset($database->ShowPostEdit((int) $_GET['pod']))['owner'], 'admin' => $_GET['admin'], - 'forum_owner' => reset($database->ForumCatEdit($_GET['fid']))['owner'] + 'forum_owner' => reset($database->ForumCatEdit((int) $_GET['fid']))['owner'] ], 1) ) include("Forum/forum_10.tpl"); diff --git a/Templates/Alliance/index.php b/Templates/Alliance/index.php index 9fcb4aed..dab55142 100644 --- a/Templates/Alliance/index.php +++ b/Templates/Alliance/index.php @@ -1,11 +1,21 @@ generateRandStr(6); // --- 1. Normalizare trupe t1..t11 (păstrăm exact logica originală) --- diff --git a/Templates/a2b/index.php b/Templates/a2b/index.php index 9fcb4aed..16009bf1 100644 --- a/Templates/a2b/index.php +++ b/Templates/a2b/index.php @@ -2,10 +2,20 @@ ################################################################################# ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## ## --------------------------------------------------------------------------- ## -## Filename index.php ## -## Developed by: aggenkeech ## -## License: TravianZ Project ## -## Copyright: TravianZ (c) 2010-2025. All rights reserved. ## +## Filename : index.php ## +## Type : Directory Access Guard ## +## --------------------------------------------------------------------------- ## +## Developed by : aggenkeech ## +## Refactored by : Shadow ## +## --------------------------------------------------------------------------- ## +## Contact : cata7007@gmail.com ## +## Project : TravianZ ## +## URLs: : https://travianz.org ## +## GitHub : https://github.com/Shadowss/TravianZ ## +## --------------------------------------------------------------------------- ## +## License : TravianZ Project ## +## Copyright : TravianZ (c) 2010-2026. All rights reserved. ## +## --------------------------------------------------------------------------- ## ################################################################################# // prevent direct misuse in weird contexts (optional but safe) diff --git a/Templates/a2b/newdorf.tpl b/Templates/a2b/newdorf.tpl index 02506546..9eb17ec9 100644 --- a/Templates/a2b/newdorf.tpl +++ b/Templates/a2b/newdorf.tpl @@ -1,4 +1,23 @@ unitarray['u' . $session->tribe . '0'] ?? 0); diff --git a/Templates/a2b/search.tpl b/Templates/a2b/search.tpl index 3b9a0aef..aa58337f 100644 --- a/Templates/a2b/search.tpl +++ b/Templates/a2b/search.tpl @@ -1,4 +1,23 @@ getVillage($enforce['from']); $fromcoor = $database->getCoor($enforce['from']); $tocoor = $database->getCoor($enforce['vref']); diff --git a/Templates/a2b/units_1.tpl b/Templates/a2b/units_1.tpl index 01526602..265de301 100644 --- a/Templates/a2b/units_1.tpl +++ b/Templates/a2b/units_1.tpl @@ -1,104 +1,29 @@ -

+ +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Filename : units_1.tpl ## +## Type : Rally Point Troop Selection (Romans) ## +## --------------------------------------------------------------------------- ## +## Developed by : Shadow ## +## --------------------------------------------------------------------------- ## +## Contact : cata7007@gmail.com ## +## Project : TravianZ ## +## URLs: : https://travianz.org ## +## GitHub : https://github.com/Shadowss/TravianZ ## +## --------------------------------------------------------------------------- ## +## License : TravianZ Project ## +## Copyright : TravianZ (c) 2010-2026. All rights reserved. ## +## --------------------------------------------------------------------------- ## +################################################################################# +/** + * Trupele tribului 1 (Romans): u1..u10. + * + * Formularul e identic pentru toate triburile, difera doar blocul de unitati, + * asa ca traieste intr-un singur loc. Fisierul acesta ramane doar ca a2b.php + * sa poata include in continuare "units_" . $session->tribe . ".tpl". + */ - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - } - ?> - -
<?php echo U1; ?> unitarray['u1']<=0) {echo ' disabled="disabled"';}?> name="t1" value="" maxlength="6" type="text"> - unitarray['u1']>0){ - echo "unitarray['u1']."; return false;\">(".$village->unitarray['u1'].")<?php echo U4; ?> unitarray['u4']<=0) {echo ' disabled="disabled"';}?> name="t4" value="" maxlength="6" type="text"> - unitarray['u4']>0){ - echo "unitarray['u4']."; return false;\">(".$village->unitarray['u4'].")<?php echo U7; ?> unitarray['u7']<=0) {echo ' disabled="disabled"';}?> name="t7" value="" maxlength="6" type="text"> - unitarray['u7']>0){ - echo "unitarray['u7']."; return false;\">(".$village->unitarray['u7'].")<?php echo U9; ?> unitarray['u9']<=0) {echo ' disabled="disabled"';}?> name="t9" value="" maxlength="6" type="text"> - unitarray['u9']>0){ - echo "unitarray['u9']."; return false;\">(".$village->unitarray['u9'].")
<?php echo U2; ?> unitarray['u2']<=0) {echo ' disabled="disabled"';}?> name="t2" value="" maxlength="6" type="text"> - unitarray['u2']>0){ - echo "unitarray['u2']."; return false;\">(".$village->unitarray['u2'].")<?php echo U5; ?> unitarray['u5']<=0) {echo ' disabled="disabled"';}?> name="t5" value="" maxlength="6" type="text"> - unitarray['u5']>0){ - echo "unitarray['u5']."; return false;\">(".$village->unitarray['u5'].")<?php echo U8; ?> unitarray['u8']<=0) {echo ' disabled="disabled"';}?> name="t8" value="" maxlength="6" type="text"> - unitarray['u8']>0){ - echo "unitarray['u8']."; return false;\">(".$village->unitarray['u8'].")<?php echo U10; ?> unitarray['u10']<=0) {echo ' disabled="disabled"';}?> name="t10" value="" maxlength="6" type="text"> - unitarray['u10']>0){ - echo "unitarray['u10']."; return false;\">(".$village->unitarray['u10'].")
<?php echo U3; ?> unitarray['u3']<=0) {echo ' disabled="disabled"';}?> name="t3" value="" maxlength="6" type="text"> - unitarray['u3']>0){ - echo "unitarray['u3']."; return false;\">(".$village->unitarray['u3'].")<?php echo U6; ?> unitarray['u6']<=0) {echo ' disabled="disabled"';}?> name="t6" value="" maxlength="6" type="text"> - unitarray['u6']>0){ - echo "unitarray['u6']."; return false;\">(".$village->unitarray['u6'].")unitarray['hero']>0){ - echo "\"Hero\" "; - echo "unitarray['hero']."; return false;\">(".$village->unitarray['hero'].")
- +include("Templates/a2b/units_common.tpl"); diff --git a/Templates/a2b/units_2.tpl b/Templates/a2b/units_2.tpl index f3e5a363..ed15f692 100644 --- a/Templates/a2b/units_2.tpl +++ b/Templates/a2b/units_2.tpl @@ -1,104 +1,29 @@ -

+ +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Filename : units_2.tpl ## +## Type : Rally Point Troop Selection (Teutons) ## +## --------------------------------------------------------------------------- ## +## Developed by : Shadow ## +## --------------------------------------------------------------------------- ## +## Contact : cata7007@gmail.com ## +## Project : TravianZ ## +## URLs: : https://travianz.org ## +## GitHub : https://github.com/Shadowss/TravianZ ## +## --------------------------------------------------------------------------- ## +## License : TravianZ Project ## +## Copyright : TravianZ (c) 2010-2026. All rights reserved. ## +## --------------------------------------------------------------------------- ## +################################################################################# +/** + * Trupele tribului 2 (Teutons): u11..u20. + * + * Formularul e identic pentru toate triburile, difera doar blocul de unitati, + * asa ca traieste intr-un singur loc. Fisierul acesta ramane doar ca a2b.php + * sa poata include in continuare "units_" . $session->tribe . ".tpl". + */ - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - } - ?> - -
<?php echo U11; ?> unitarray['u11']<=0) {echo ' disabled="disabled"';}?> name="t1" value="" maxlength="6" type="text"> - unitarray['u11']>0){ - echo "unitarray['u11']."; return false;\">(".$village->unitarray['u11'].")<?php echo U14; ?> unitarray['u14']<=0) {echo ' disabled="disabled"';}?> name="t4" value="" maxlength="6" type="text"> - unitarray['u14']>0){ - echo "unitarray['u14']."; return false;\">(".$village->unitarray['u14'].")<?php echo U17; ?> unitarray['u17']<=0) {echo ' disabled="disabled"';}?> name="t7" value="" maxlength="6" type="text"> - unitarray['u17']>0){ - echo "unitarray['u17']."; return false;\">(".$village->unitarray['u17'].")<?php echo U19; ?> unitarray['u19']<=0) {echo ' disabled="disabled"';}?> name="t9" value="" maxlength="6" type="text"> - unitarray['u19']>0){ - echo "unitarray['u19']."; return false;\">(".$village->unitarray['u19'].")
<?php echo U12; ?> unitarray['u12']<=0) {echo ' disabled="disabled"';}?> name="t2" value="" maxlength="6" type="text"> - unitarray['u12']>0){ - echo "unitarray['u12']."; return false;\">(".$village->unitarray['u12'].")<?php echo U15; ?> unitarray['u15']<=0) {echo ' disabled="disabled"';}?> name="t5" value="" maxlength="6" type="text"> - unitarray['u15']>0){ - echo "unitarray['u15']."; return false;\">(".$village->unitarray['u15'].")<?php echo U18; ?> unitarray['u18']<=0) {echo ' disabled="disabled"';}?> name="t8" value="" maxlength="6" type="text"> - unitarray['u18']>0){ - echo "unitarray['u18']."; return false;\">(".$village->unitarray['u18'].")<?php echo U10; ?> unitarray['u20']<=0) {echo ' disabled="disabled"';}?> name="t10" value="" maxlength="6" type="text"> - unitarray['u20']>0){ - echo "unitarray['u20']."; return false;\">(".$village->unitarray['u20'].")
<?php echo U13; ?> unitarray['u13']<=0) {echo ' disabled="disabled"';}?> name="t3" value="" maxlength="6" type="text"> - unitarray['u13']>0){ - echo "unitarray['u13']."; return false;\">(".$village->unitarray['u13'].")<?php echo U16; ?> unitarray['u16']<=0) {echo ' disabled="disabled"';}?> name="t6" value="" maxlength="6" type="text"> - unitarray['u16']>0){ - echo "unitarray['u16']."; return false;\">(".$village->unitarray['u16'].")unitarray['hero']>0){ - echo "\"Hero\" "; - echo "unitarray['hero']."; return false;\">(".$village->unitarray['hero'].")
- +include("Templates/a2b/units_common.tpl"); diff --git a/Templates/a2b/units_3.tpl b/Templates/a2b/units_3.tpl index 0ab2c34c..436db44d 100644 --- a/Templates/a2b/units_3.tpl +++ b/Templates/a2b/units_3.tpl @@ -1,104 +1,29 @@ -

+ +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Filename : units_3.tpl ## +## Type : Rally Point Troop Selection (Gauls) ## +## --------------------------------------------------------------------------- ## +## Developed by : Shadow ## +## --------------------------------------------------------------------------- ## +## Contact : cata7007@gmail.com ## +## Project : TravianZ ## +## URLs: : https://travianz.org ## +## GitHub : https://github.com/Shadowss/TravianZ ## +## --------------------------------------------------------------------------- ## +## License : TravianZ Project ## +## Copyright : TravianZ (c) 2010-2026. All rights reserved. ## +## --------------------------------------------------------------------------- ## +################################################################################# +/** + * Trupele tribului 3 (Gauls): u21..u30. + * + * Formularul e identic pentru toate triburile, difera doar blocul de unitati, + * asa ca traieste intr-un singur loc. Fisierul acesta ramane doar ca a2b.php + * sa poata include in continuare "units_" . $session->tribe . ".tpl". + */ - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - } - ?> - -
<?php echo U21; ?> unitarray['u21']<=0) {echo ' disabled="disabled"';}?> name="t1" value="" maxlength="6" type="text"> - unitarray['u21']>0){ - echo "unitarray['u21']."; return false;\">(".$village->unitarray['u21'].")<?php echo U24; ?> unitarray['u24']<=0) {echo ' disabled="disabled"';}?> name="t4" value="" maxlength="6" type="text"> - unitarray['u24']>0){ - echo "unitarray['u24']."; return false;\">(".$village->unitarray['u24'].")<?php echo U17; ?> unitarray['u27']<=0) {echo ' disabled="disabled"';}?> name="t7" value="" maxlength="6" type="text"> - unitarray['u27']>0){ - echo "unitarray['u27']."; return false;\">(".$village->unitarray['u27'].")<?php echo U29; ?> unitarray['u29']<=0) {echo ' disabled="disabled"';}?> name="t9" value="" maxlength="6" type="text"> - unitarray['u29']>0){ - echo "unitarray['u29']."; return false;\">(".$village->unitarray['u29'].")
<?php echo U22; ?> unitarray['u22']<=0) {echo ' disabled="disabled"';}?> name="t2" value="" maxlength="6" type="text"> - unitarray['u22']>0){ - echo "unitarray['u22']."; return false;\">(".$village->unitarray['u22'].")<?php echo U25; ?> unitarray['u25']<=0) {echo ' disabled="disabled"';}?> name="t5" value="" maxlength="6" type="text"> - unitarray['u25']>0){ - echo "unitarray['u25']."; return false;\">(".$village->unitarray['u25'].")<?php echo U28; ?> unitarray['u28']<=0) {echo ' disabled="disabled"';}?> name="t8" value="" maxlength="6" type="text"> - unitarray['u28']>0){ - echo "unitarray['u28']."; return false;\">(".$village->unitarray['u28'].")<?php echo U10; ?> unitarray['u30']<=0) {echo ' disabled="disabled"';}?> name="t10" value="" maxlength="6" type="text"> - unitarray['u30']>0){ - echo "unitarray['u30']."; return false;\">(".$village->unitarray['u30'].")
<?php echo U23; ?> unitarray['u23']<=0) {echo ' disabled="disabled"';}?> name="t3" value="" maxlength="6" type="text"> - unitarray['u23']>0){ - echo "unitarray['u23']."; return false;\">(".$village->unitarray['u23'].")<?php echo U26; ?> unitarray['u26']<=0) {echo ' disabled="disabled"';}?> name="t6" value="" maxlength="6" type="text"> - unitarray['u26']>0){ - echo "unitarray['u26']."; return false;\">(".$village->unitarray['u26'].")unitarray['hero']>0){ - echo "\"Hero\" "; - echo "unitarray['hero']."; return false;\">(".$village->unitarray['hero'].")
- +include("Templates/a2b/units_common.tpl"); diff --git a/Templates/a2b/units_4.tpl b/Templates/a2b/units_4.tpl index 0b0b64ae..249f97a2 100644 --- a/Templates/a2b/units_4.tpl +++ b/Templates/a2b/units_4.tpl @@ -1,104 +1,29 @@ -

+ +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Filename : units_4.tpl ## +## Type : Rally Point Troop Selection (Nature) ## +## --------------------------------------------------------------------------- ## +## Developed by : Shadow ## +## --------------------------------------------------------------------------- ## +## Contact : cata7007@gmail.com ## +## Project : TravianZ ## +## URLs: : https://travianz.org ## +## GitHub : https://github.com/Shadowss/TravianZ ## +## --------------------------------------------------------------------------- ## +## License : TravianZ Project ## +## Copyright : TravianZ (c) 2010-2026. All rights reserved. ## +## --------------------------------------------------------------------------- ## +################################################################################# +/** + * Trupele tribului 4 (Nature): u31..u40. + * + * Formularul e identic pentru toate triburile, difera doar blocul de unitati, + * asa ca traieste intr-un singur loc. Fisierul acesta ramane doar ca a2b.php + * sa poata include in continuare "units_" . $session->tribe . ".tpl". + */ - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - } - ?> - -
<?php echo U31; ?> unitarray['u31']<=0) {echo ' disabled="disabled"';}?> name="t1" value="" maxlength="6" type="text"> - unitarray['u31']>0){ - echo "unitarray['u31']."; return false;\">(".$village->unitarray['u31'].")<?php echo U34; ?> unitarray['u34']<=0) {echo ' disabled="disabled"';}?> name="t4" value="" maxlength="6" type="text"> - unitarray['u34']>0){ - echo "unitarray['u34']."; return false;\">(".$village->unitarray['u34'].")<?php echo U37; ?> unitarray['u37']<=0) {echo ' disabled="disabled"';}?> name="t7" value="" maxlength="6" type="text"> - unitarray['u37']>0){ - echo "unitarray['u37']."; return false;\">(".$village->unitarray['u37'].")<?php echo U39; ?> unitarray['u39']<=0) {echo ' disabled="disabled"';}?> name="t9" value="" maxlength="6" type="text"> - unitarray['u39']>0){ - echo "unitarray['u39']."; return false;\">(".$village->unitarray['u39'].")
<?php echo U32; ?> unitarray['u32']<=0) {echo ' disabled="disabled"';}?> name="t2" value="" maxlength="6" type="text"> - unitarray['u32']>0){ - echo "unitarray['u32']."; return false;\">(".$village->unitarray['u32'].")<?php echo U35; ?> unitarray['u35']<=0) {echo ' disabled="disabled"';}?> name="t5" value="" maxlength="6" type="text"> - unitarray['u35']>0){ - echo "unitarray['u35']."; return false;\">(".$village->unitarray['u35'].")<?php echo U38; ?> unitarray['u38']<=0) {echo ' disabled="disabled"';}?> name="t8" value="" maxlength="6" type="text"> - unitarray['u38']>0){ - echo "unitarray['u38']."; return false;\">(".$village->unitarray['u38'].")<?php echo U40; ?> unitarray['u40']<=0) {echo ' disabled="disabled"';}?> name="t10" value="" maxlength="6" type="text"> - unitarray['u40']>0){ - echo "unitarray['u40']."; return false;\">(".$village->unitarray['u40'].")
<?php echo U33; ?> unitarray['u33']<=0) {echo ' disabled="disabled"';}?> name="t3" value="" maxlength="6" type="text"> - unitarray['u33']>0){ - echo "unitarray['u33']."; return false;\">(".$village->unitarray['u33'].")<?php echo U36; ?> unitarray['u36']<=0) {echo ' disabled="disabled"';}?> name="t6" value="" maxlength="6" type="text"> - unitarray['u36']>0){ - echo "unitarray['u36']."; return false;\">(".$village->unitarray['u36'].")unitarray['hero']>0){ - echo "\"Hero\" "; - echo "unitarray['hero']."; return false;\">(".$village->unitarray['hero'].")
- +include("Templates/a2b/units_common.tpl"); diff --git a/Templates/a2b/units_5.tpl b/Templates/a2b/units_5.tpl index 1368329f..04da978a 100644 --- a/Templates/a2b/units_5.tpl +++ b/Templates/a2b/units_5.tpl @@ -1,99 +1,29 @@ -

+ +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Filename : units_5.tpl ## +## Type : Rally Point Troop Selection (Natars) ## +## --------------------------------------------------------------------------- ## +## Developed by : Shadow ## +## --------------------------------------------------------------------------- ## +## Contact : cata7007@gmail.com ## +## Project : TravianZ ## +## URLs: : https://travianz.org ## +## GitHub : https://github.com/Shadowss/TravianZ ## +## --------------------------------------------------------------------------- ## +## License : TravianZ Project ## +## Copyright : TravianZ (c) 2010-2026. All rights reserved. ## +## --------------------------------------------------------------------------- ## +################################################################################# +/** + * Trupele tribului 5 (Natars): u41..u50. + * + * Formularul e identic pentru toate triburile, difera doar blocul de unitati, + * asa ca traieste intr-un singur loc. Fisierul acesta ramane doar ca a2b.php + * sa poata include in continuare "units_" . $session->tribe . ".tpl". + */ - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - -
<?php echo U41; ?> unitarray['u41']<=0) {echo ' disabled="disabled"';}?> name="t1" value="" maxlength="6" type="text"> - unitarray['u41']>0){ - echo "unitarray['u41']."; return false;\">(".$village->unitarray['u41'].")<?php echo U44; ?> unitarray['u44']<=0) {echo ' disabled="disabled"';}?> name="t4" value="" maxlength="6" type="text"> - unitarray['u44']>0){ - echo "unitarray['u44']."; return false;\">(".$village->unitarray['u44'].")<?php echo U47; ?> unitarray['u47']<=0) {echo ' disabled="disabled"';}?> name="t7" value="" maxlength="6" type="text"> - unitarray['u47']>0){ - echo "unitarray['u47']."; return false;\">(".$village->unitarray['u47'].")<?php echo U49; ?> unitarray['u49']<=0) {echo ' disabled="disabled"';}?> name="t9" value="" maxlength="6" type="text"> - unitarray['u49']>0){ - echo "unitarray['u49']."; return false;\">(".$village->unitarray['u49'].")
<?php echo U42; ?> unitarray['u42']<=0) {echo ' disabled="disabled"';}?> name="t2" value="" maxlength="6" type="text"> - unitarray['u42']>0){ - echo "unitarray['u42']."; return false;\">(".$village->unitarray['u42'].")<?php echo U45; ?> unitarray['u45']<=0) {echo ' disabled="disabled"';}?> name="t5" value="" maxlength="6" type="text"> - unitarray['u45']>0){ - echo "unitarray['u45']."; return false;\">(".$village->unitarray['u45'].")<?php echo U48; ?> unitarray['u48']<=0) {echo ' disabled="disabled"';}?> name="t8" value="" maxlength="6" type="text"> - unitarray['u48']>0){ - echo "unitarray['u48']."; return false;\">(".$village->unitarray['u48'].")<?php echo U50; ?> unitarray['u50']<=0) {echo ' disabled="disabled"';}?> name="t10" value="" maxlength="6" type="text"> - unitarray['u50']>0){ - echo "unitarray['u50']."; return false;\">(".$village->unitarray['u50'].")
<?php echo U43; ?> unitarray['u43']<=0) {echo ' disabled="disabled"';}?> name="t3" value="" maxlength="6" type="text"> - unitarray['u43']>0){ - echo "unitarray['u43']."; return false;\">(".$village->unitarray['u43'].")<?php echo U46; ?> unitarray['u46']<=0) {echo ' disabled="disabled"';}?> name="t6" value="" maxlength="6" type="text"> - unitarray['u46']>0){ - echo "unitarray['u46']."; return false;\">(".$village->unitarray['u46'].")
- +include("Templates/a2b/units_common.tpl"); diff --git a/Templates/a2b/units_6.tpl b/Templates/a2b/units_6.tpl index 439b9d51..f69eb885 100644 --- a/Templates/a2b/units_6.tpl +++ b/Templates/a2b/units_6.tpl @@ -1,104 +1,29 @@ -

+ +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Filename : units_6.tpl ## +## Type : Rally Point Troop Selection (Huns) ## +## --------------------------------------------------------------------------- ## +## Developed by : Shadow ## +## --------------------------------------------------------------------------- ## +## Contact : cata7007@gmail.com ## +## Project : TravianZ ## +## URLs: : https://travianz.org ## +## GitHub : https://github.com/Shadowss/TravianZ ## +## --------------------------------------------------------------------------- ## +## License : TravianZ Project ## +## Copyright : TravianZ (c) 2010-2026. All rights reserved. ## +## --------------------------------------------------------------------------- ## +################################################################################# +/** + * Trupele tribului 6 (Huns): u51..u60. + * + * Formularul e identic pentru toate triburile, difera doar blocul de unitati, + * asa ca traieste intr-un singur loc. Fisierul acesta ramane doar ca a2b.php + * sa poata include in continuare "units_" . $session->tribe . ".tpl". + */ - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - } - ?> - -
<?php echo U51; ?> unitarray['u51']<=0) {echo ' disabled="disabled"';}?> name="t1" value="" maxlength="6" type="text"> - unitarray['u51']>0){ - echo "unitarray['u51']."; return false;\">(".$village->unitarray['u51'].")<?php echo U54; ?> unitarray['u54']<=0) {echo ' disabled="disabled"';}?> name="t4" value="" maxlength="6" type="text"> - unitarray['u54']>0){ - echo "unitarray['u54']."; return false;\">(".$village->unitarray['u54'].")<?php echo U57; ?> unitarray['u57']<=0) {echo ' disabled="disabled"';}?> name="t7" value="" maxlength="6" type="text"> - unitarray['u57']>0){ - echo "unitarray['u57']."; return false;\">(".$village->unitarray['u57'].")<?php echo U59; ?> unitarray['u59']<=0) {echo ' disabled="disabled"';}?> name="t9" value="" maxlength="6" type="text"> - unitarray['u59']>0){ - echo "unitarray['u59']."; return false;\">(".$village->unitarray['u59'].")
<?php echo U52; ?> unitarray['u52']<=0) {echo ' disabled="disabled"';}?> name="t2" value="" maxlength="6" type="text"> - unitarray['u52']>0){ - echo "unitarray['u52']."; return false;\">(".$village->unitarray['u52'].")<?php echo U55; ?> unitarray['u55']<=0) {echo ' disabled="disabled"';}?> name="t5" value="" maxlength="6" type="text"> - unitarray['u55']>0){ - echo "unitarray['u55']."; return false;\">(".$village->unitarray['u55'].")<?php echo U58; ?> unitarray['u58']<=0) {echo ' disabled="disabled"';}?> name="t8" value="" maxlength="6" type="text"> - unitarray['u58']>0){ - echo "unitarray['u58']."; return false;\">(".$village->unitarray['u58'].")<?php echo U60; ?> unitarray['u60']<=0) {echo ' disabled="disabled"';}?> name="t10" value="" maxlength="6" type="text"> - unitarray['u60']>0){ - echo "unitarray['u60']."; return false;\">(".$village->unitarray['u60'].")
<?php echo U53; ?> unitarray['u53']<=0) {echo ' disabled="disabled"';}?> name="t3" value="" maxlength="6" type="text"> - unitarray['u53']>0){ - echo "unitarray['u53']."; return false;\">(".$village->unitarray['u53'].")<?php echo U56; ?> unitarray['u56']<=0) {echo ' disabled="disabled"';}?> name="t6" value="" maxlength="6" type="text"> - unitarray['u56']>0){ - echo "unitarray['u56']."; return false;\">(".$village->unitarray['u56'].")unitarray['hero']>0){ - echo "\"Hero\" "; - echo "unitarray['hero']."; return false;\">(".$village->unitarray['hero'].")
- +include("Templates/a2b/units_common.tpl"); diff --git a/Templates/a2b/units_7.tpl b/Templates/a2b/units_7.tpl index fd0a6464..50643f26 100644 --- a/Templates/a2b/units_7.tpl +++ b/Templates/a2b/units_7.tpl @@ -1,104 +1,29 @@ -

+ +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Filename : units_7.tpl ## +## Type : Rally Point Troop Selection (Egyptians) ## +## --------------------------------------------------------------------------- ## +## Developed by : Shadow ## +## --------------------------------------------------------------------------- ## +## Contact : cata7007@gmail.com ## +## Project : TravianZ ## +## URLs: : https://travianz.org ## +## GitHub : https://github.com/Shadowss/TravianZ ## +## --------------------------------------------------------------------------- ## +## License : TravianZ Project ## +## Copyright : TravianZ (c) 2010-2026. All rights reserved. ## +## --------------------------------------------------------------------------- ## +################################################################################# +/** + * Trupele tribului 7 (Egyptians): u61..u70. + * + * Formularul e identic pentru toate triburile, difera doar blocul de unitati, + * asa ca traieste intr-un singur loc. Fisierul acesta ramane doar ca a2b.php + * sa poata include in continuare "units_" . $session->tribe . ".tpl". + */ - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - } - ?> - -
<?php echo U61; ?> unitarray['u61']<=0) {echo ' disabled="disabled"';}?> name="t1" value="" maxlength="6" type="text"> - unitarray['u61']>0){ - echo "unitarray['u61']."; return false;\">(".$village->unitarray['u61'].")<?php echo U64; ?> unitarray['u64']<=0) {echo ' disabled="disabled"';}?> name="t4" value="" maxlength="6" type="text"> - unitarray['u64']>0){ - echo "unitarray['u64']."; return false;\">(".$village->unitarray['u64'].")<?php echo U67; ?> unitarray['u67']<=0) {echo ' disabled="disabled"';}?> name="t7" value="" maxlength="6" type="text"> - unitarray['u67']>0){ - echo "unitarray['u67']."; return false;\">(".$village->unitarray['u67'].")<?php echo U69; ?> unitarray['u69']<=0) {echo ' disabled="disabled"';}?> name="t9" value="" maxlength="6" type="text"> - unitarray['u69']>0){ - echo "unitarray['u69']."; return false;\">(".$village->unitarray['u69'].")
<?php echo U62; ?> unitarray['u62']<=0) {echo ' disabled="disabled"';}?> name="t2" value="" maxlength="6" type="text"> - unitarray['u62']>0){ - echo "unitarray['u62']."; return false;\">(".$village->unitarray['u62'].")<?php echo U65; ?> unitarray['u65']<=0) {echo ' disabled="disabled"';}?> name="t5" value="" maxlength="6" type="text"> - unitarray['u65']>0){ - echo "unitarray['u65']."; return false;\">(".$village->unitarray['u65'].")<?php echo U68; ?> unitarray['u68']<=0) {echo ' disabled="disabled"';}?> name="t8" value="" maxlength="6" type="text"> - unitarray['u68']>0){ - echo "unitarray['u68']."; return false;\">(".$village->unitarray['u68'].")<?php echo U70; ?> unitarray['u70']<=0) {echo ' disabled="disabled"';}?> name="t10" value="" maxlength="6" type="text"> - unitarray['u70']>0){ - echo "unitarray['u70']."; return false;\">(".$village->unitarray['u70'].")
<?php echo U63; ?> unitarray['u63']<=0) {echo ' disabled="disabled"';}?> name="t3" value="" maxlength="6" type="text"> - unitarray['u63']>0){ - echo "unitarray['u63']."; return false;\">(".$village->unitarray['u63'].")<?php echo U66; ?> unitarray['u66']<=0) {echo ' disabled="disabled"';}?> name="t6" value="" maxlength="6" type="text"> - unitarray['u66']>0){ - echo "unitarray['u66']."; return false;\">(".$village->unitarray['u66'].")unitarray['hero']>0){ - echo "\"Hero\" "; - echo "unitarray['hero']."; return false;\">(".$village->unitarray['hero'].")
- +include("Templates/a2b/units_common.tpl"); diff --git a/Templates/a2b/units_8.tpl b/Templates/a2b/units_8.tpl index 7777c2b4..12a619e9 100644 --- a/Templates/a2b/units_8.tpl +++ b/Templates/a2b/units_8.tpl @@ -1,104 +1,29 @@ -

+ +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Filename : units_8.tpl ## +## Type : Rally Point Troop Selection (Spartans) ## +## --------------------------------------------------------------------------- ## +## Developed by : Shadow ## +## --------------------------------------------------------------------------- ## +## Contact : cata7007@gmail.com ## +## Project : TravianZ ## +## URLs: : https://travianz.org ## +## GitHub : https://github.com/Shadowss/TravianZ ## +## --------------------------------------------------------------------------- ## +## License : TravianZ Project ## +## Copyright : TravianZ (c) 2010-2026. All rights reserved. ## +## --------------------------------------------------------------------------- ## +################################################################################# +/** + * Trupele tribului 8 (Spartans): u71..u80. + * + * Formularul e identic pentru toate triburile, difera doar blocul de unitati, + * asa ca traieste intr-un singur loc. Fisierul acesta ramane doar ca a2b.php + * sa poata include in continuare "units_" . $session->tribe . ".tpl". + */ - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - } - ?> - -
<?php echo U71; ?> unitarray['u71']<=0) {echo ' disabled="disabled"';}?> name="t1" value="" maxlength="6" type="text"> - unitarray['u71']>0){ - echo "unitarray['u71']."; return false;\">(".$village->unitarray['u71'].")<?php echo U74; ?> unitarray['u74']<=0) {echo ' disabled="disabled"';}?> name="t4" value="" maxlength="6" type="text"> - unitarray['u74']>0){ - echo "unitarray['u74']."; return false;\">(".$village->unitarray['u74'].")<?php echo U77; ?> unitarray['u77']<=0) {echo ' disabled="disabled"';}?> name="t7" value="" maxlength="6" type="text"> - unitarray['u77']>0){ - echo "unitarray['u77']."; return false;\">(".$village->unitarray['u77'].")<?php echo U79; ?> unitarray['u79']<=0) {echo ' disabled="disabled"';}?> name="t9" value="" maxlength="6" type="text"> - unitarray['u79']>0){ - echo "unitarray['u79']."; return false;\">(".$village->unitarray['u79'].")
<?php echo U72; ?> unitarray['u72']<=0) {echo ' disabled="disabled"';}?> name="t2" value="" maxlength="6" type="text"> - unitarray['u72']>0){ - echo "unitarray['u72']."; return false;\">(".$village->unitarray['u72'].")<?php echo U75; ?> unitarray['u75']<=0) {echo ' disabled="disabled"';}?> name="t5" value="" maxlength="6" type="text"> - unitarray['u75']>0){ - echo "unitarray['u75']."; return false;\">(".$village->unitarray['u75'].")<?php echo U78; ?> unitarray['u78']<=0) {echo ' disabled="disabled"';}?> name="t8" value="" maxlength="6" type="text"> - unitarray['u78']>0){ - echo "unitarray['u78']."; return false;\">(".$village->unitarray['u78'].")<?php echo U80; ?> unitarray['u80']<=0) {echo ' disabled="disabled"';}?> name="t10" value="" maxlength="6" type="text"> - unitarray['u80']>0){ - echo "unitarray['u80']."; return false;\">(".$village->unitarray['u80'].")
<?php echo U73; ?> unitarray['u73']<=0) {echo ' disabled="disabled"';}?> name="t3" value="" maxlength="6" type="text"> - unitarray['u73']>0){ - echo "unitarray['u73']."; return false;\">(".$village->unitarray['u73'].")<?php echo U76; ?> unitarray['u76']<=0) {echo ' disabled="disabled"';}?> name="t6" value="" maxlength="6" type="text"> - unitarray['u76']>0){ - echo "unitarray['u76']."; return false;\">(".$village->unitarray['u76'].")unitarray['hero']>0){ - echo "\"Hero\" "; - echo "unitarray['hero']."; return false;\">(".$village->unitarray['hero'].")
- +include("Templates/a2b/units_common.tpl"); diff --git a/Templates/a2b/units_9.tpl b/Templates/a2b/units_9.tpl index 6d0bd213..0cd53473 100644 --- a/Templates/a2b/units_9.tpl +++ b/Templates/a2b/units_9.tpl @@ -1,104 +1,29 @@ -

+ +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Filename : units_9.tpl ## +## Type : Rally Point Troop Selection (Vikings) ## +## --------------------------------------------------------------------------- ## +## Developed by : Shadow ## +## --------------------------------------------------------------------------- ## +## Contact : cata7007@gmail.com ## +## Project : TravianZ ## +## URLs: : https://travianz.org ## +## GitHub : https://github.com/Shadowss/TravianZ ## +## --------------------------------------------------------------------------- ## +## License : TravianZ Project ## +## Copyright : TravianZ (c) 2010-2026. All rights reserved. ## +## --------------------------------------------------------------------------- ## +################################################################################# +/** + * Trupele tribului 9 (Vikings): u81..u90. + * + * Formularul e identic pentru toate triburile, difera doar blocul de unitati, + * asa ca traieste intr-un singur loc. Fisierul acesta ramane doar ca a2b.php + * sa poata include in continuare "units_" . $session->tribe . ".tpl". + */ - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - - - "; - }else{ - echo "(0)"; - } - ?> - "; - }else{ - echo "(0)"; - } - ?> - "; - } - ?> - -
<?php echo U81; ?> unitarray['u81']<=0) {echo ' disabled="disabled"';}?> name="t1" value="" maxlength="6" type="text"> - unitarray['u81']>0){ - echo "unitarray['u81']."; return false;\">(".$village->unitarray['u81'].")<?php echo U84; ?> unitarray['u84']<=0) {echo ' disabled="disabled"';}?> name="t4" value="" maxlength="6" type="text"> - unitarray['u84']>0){ - echo "unitarray['u84']."; return false;\">(".$village->unitarray['u84'].")<?php echo U87; ?> unitarray['u87']<=0) {echo ' disabled="disabled"';}?> name="t7" value="" maxlength="6" type="text"> - unitarray['u87']>0){ - echo "unitarray['u87']."; return false;\">(".$village->unitarray['u87'].")<?php echo U89; ?> unitarray['u89']<=0) {echo ' disabled="disabled"';}?> name="t9" value="" maxlength="6" type="text"> - unitarray['u89']>0){ - echo "unitarray['u89']."; return false;\">(".$village->unitarray['u89'].")
<?php echo U82; ?> unitarray['u82']<=0) {echo ' disabled="disabled"';}?> name="t2" value="" maxlength="6" type="text"> - unitarray['u82']>0){ - echo "unitarray['u82']."; return false;\">(".$village->unitarray['u82'].")<?php echo U85; ?> unitarray['u85']<=0) {echo ' disabled="disabled"';}?> name="t5" value="" maxlength="6" type="text"> - unitarray['u85']>0){ - echo "unitarray['u85']."; return false;\">(".$village->unitarray['u85'].")<?php echo U88; ?> unitarray['u88']<=0) {echo ' disabled="disabled"';}?> name="t8" value="" maxlength="6" type="text"> - unitarray['u88']>0){ - echo "unitarray['u88']."; return false;\">(".$village->unitarray['u88'].")<?php echo U90; ?> unitarray['u90']<=0) {echo ' disabled="disabled"';}?> name="t10" value="" maxlength="6" type="text"> - unitarray['u90']>0){ - echo "unitarray['u90']."; return false;\">(".$village->unitarray['u90'].")
<?php echo U83; ?> unitarray['u83']<=0) {echo ' disabled="disabled"';}?> name="t3" value="" maxlength="6" type="text"> - unitarray['u83']>0){ - echo "unitarray['u83']."; return false;\">(".$village->unitarray['u83'].")<?php echo U86; ?> unitarray['u86']<=0) {echo ' disabled="disabled"';}?> name="t6" value="" maxlength="6" type="text"> - unitarray['u86']>0){ - echo "unitarray['u86']."; return false;\">(".$village->unitarray['u86'].")unitarray['hero']>0){ - echo "\"Hero\" "; - echo "unitarray['hero']."; return false;\">(".$village->unitarray['hero'].")
- +include("Templates/a2b/units_common.tpl"); diff --git a/Templates/a2b/units_common.tpl b/Templates/a2b/units_common.tpl new file mode 100644 index 00000000..1d8e2699 --- /dev/null +++ b/Templates/a2b/units_common.tpl @@ -0,0 +1,155 @@ + u1..u10, tribul 2 -> u11..u20, tribul 9 -> u81..u90 + * deci primul indice e (trib - 1) * 10 + 1. + * + * Fisierele units_N.tpl au ramas, ca sa nu se schimbe modul de includere din + * a2b.php, dar acum doar apeleaza acest sablon. + */ + +$a2bTribe = isset($session->tribe) ? (int) $session->tribe : 1; + +if ($a2bTribe < 1 || $a2bTribe > 9) { + $a2bTribe = 1; +} + +$a2bFirstUnit = ($a2bTribe - 1) * 10 + 1; + +// Natarii nu au erou, deci nu li se arata casuta lui. +$a2bShowHero = ($a2bTribe !== 5) && !empty($village->unitarray['hero']); + +/** + * Deseneaza o casuta de unitate. + * + * @param int $slot pozitia in formular (1..10) - devine numele campului tN + * @param int $unitId identificatorul real al unitatii (u1..u90) + * @param string $class clasele celulei din tabel + */ +if (!function_exists('a2b_unit_cell')) { + function a2b_unit_cell($slot, $unitId, $class) + { + global $village; + + $have = isset($village->unitarray['u' . $unitId]) + ? (int) $village->unitarray['u' . $unitId] : 0; + $label = defined('U' . $unitId) ? constant('U' . $unitId) : ('u' . $unitId); + $field = 't' . (int) $slot; + + echo ''; + echo '' . htmlspecialchars($label, ENT_QUOTES, 'UTF-8') . ''; + echo ' '; + + if ($have > 0) { + echo ' (' . $have . ')'; + } else { + echo ' (0)'; + } + + echo ''; + } +} +?> +

+ +
+ + + + + + + + + + + + + + si + * dupa blocul PHP. Cand eroul era in sat se generau DOUA + * inchideri, iar tabelul iesea stricat. Acum celula se inchide + * o singura data, pe ambele ramuri. + */ + if ($a2bShowHero) { + $heroCount = (int) $village->unitarray['hero']; + $heroLabel = defined('TZ_HERO') ? TZ_HERO : 'Hero'; + ?> + + + + + + + + +
+ <?php echo htmlspecialchars($heroLabel, ENT_QUOTES, 'UTF-8'); ?> + + () +
+. Daca inchidem + * formularul aici, butonul ramane in afara lui si trimiterea trupelor nu mai + * face nimic - fara niciun mesaj de eroare. + */ +?>