diff --git a/GameEngine/Alliance.php b/GameEngine/Alliance.php index 664268e3..2b58507b 100644 --- a/GameEngine/Alliance.php +++ b/GameEngine/Alliance.php @@ -318,6 +318,16 @@ $database->insertAlliNotice($session->alliance, '' . $session->username . ' kicked ' . $UserData['username'] . '.'); //header("Location: build.php?id=".$post['id']); } + } + /***************************************** + Function to set forum link + *****************************************/ + public function setForumLink($post) { + global $database, $session; + if(isset($post['f_link'])){ + $database->setAlliForumLink($session->alliance, $post['f_link']); + header("Location: allianz.php?s=5"); + } } /***************************************** Function to quit from alliance diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php index b7ad73dc..b4c797d9 100644 --- a/GameEngine/Database/db_MYSQL.php +++ b/GameEngine/Database/db_MYSQL.php @@ -1075,7 +1075,7 @@ References: *****************************************/ function createAlliance($tag, $name, $uid, $max) { - $q = "INSERT into " . TB_PREFIX . "alidata values (0,'$name','$tag',$uid,0,0,0,'','',$max,'','','','','','','','')"; + $q = "INSERT into " . TB_PREFIX . "alidata values (0,'$name','$tag',$uid,0,0,0,'','',$max,'','','','','','','','','')"; mysql_query($q, $this->connection); return mysql_insert_id($this->connection); } @@ -1285,6 +1285,11 @@ return mysql_query($q, $this->connection); } + function setAlliForumLink($aid, $link) { + $q = "UPDATE " . TB_PREFIX . "alidata SET `forumlink` = '$link' WHERE id = $aid"; + return mysql_query($q, $this->connection); + } + function getUserAlliance($id) { $q = "SELECT " . TB_PREFIX . "alidata.tag from " . TB_PREFIX . "users join " . TB_PREFIX . "alidata where " . TB_PREFIX . "users.alliance = " . TB_PREFIX . "alidata.id and " . TB_PREFIX . "users.id = $id"; $result = mysql_query($q, $this->connection); @@ -1485,7 +1490,7 @@ } function removeNotice($id) { - $q = "UPDATE " . TB_PREFIX . "ndata set del = 1 where id = $id"; + $q = "UPDATE " . TB_PREFIX . "ndata set del = 1,viewed = 1 where id = $id"; return mysql_query($q, $this->connection); } diff --git a/GameEngine/Market.php b/GameEngine/Market.php index 93741ea0..20a89fb8 100644 --- a/GameEngine/Market.php +++ b/GameEngine/Market.php @@ -95,13 +95,12 @@ class Market { $reqMerc = ceil((array_sum($resource)-0.1)/$this->maxcarry); if($this->merchantAvail() != 0 && $reqMerc <= $this->merchantAvail()) { - if(isset($post['dname']) && $post['dname'] != "") { - $id = $database->getVillageByName($post['dname']); - $coor = $database->getCoor($id); - } if(isset($post['x']) && isset($post['y']) && $post['x'] != "" && $post['y'] != "") { $coor = array('x'=>$post['x'], 'y'=>$post['y']); $id = $generator->getBaseID($coor['x'],$coor['y']); + }else if(isset($post['dname']) && $post['dname'] != "") { + $id = $database->getVillageByName($post['dname']); + $coor = $database->getCoor($id); } if($database->getVillageState($id)) { $timetaken = $generator->procDistanceTime($coor,$village->coor,$session->tribe,0); @@ -243,8 +242,9 @@ class Market { private function tradeResource($post) { global $session,$database,$village; + for($i = 1; $i <= 40; $i++){ $wwvillage = $database->getResourceLevel($village->wid); - if($wwvillage['f99t']!=40){ + if($wwvillage['f99t']!=40 and $wwvillage['f'.$i.'t']!=40){ if($session->userinfo['gold'] >= 3) { //kijken of ze niet meer gs invoeren dan ze hebben if($session->access == BANNED){ @@ -264,6 +264,7 @@ class Market { } } } + } }; $market = new Market; diff --git a/Templates/Alliance/linkforum.tpl b/Templates/Alliance/linkforum.tpl index 950ff7e6..daf485a5 100644 --- a/Templates/Alliance/linkforum.tpl +++ b/Templates/Alliance/linkforum.tpl @@ -22,7 +22,7 @@ if($session->access!=BANNED){ URL - + diff --git a/Templates/Alliance/overview.tpl b/Templates/Alliance/overview.tpl index 64d42bdb..e1a09c50 100644 --- a/Templates/Alliance/overview.tpl +++ b/Templates/Alliance/overview.tpl @@ -1,4 +1,4 @@ -".$name.""; echo ""; } - }?> + } + if($allianceinfo['forumlink'] != ''){ + echo ""; + echo "» to the forum"; + echo ""; + }else{ + ?> + diff --git a/Templates/Build/17.tpl b/Templates/Build/17.tpl index 18bae0f3..d5117b02 100644 --- a/Templates/Build/17.tpl +++ b/Templates/Build/17.tpl @@ -30,6 +30,7 @@ if(isset($_POST['ft'])=='check' && $allres!=0 && ($_POST['x']!="" && $_POST['y'] + @@ -67,15 +68,17 @@ if(isset($_POST['ft'])=='check' && $allres!=0 && ($_POST['x']!="" && $_POST['y'] $getvilowner = $database->getVillageField($getwref, "owner"); $getvilcoor['y'] = $_POST['y']; $getvilcoor['x'] = $_POST['x']; + $time = $generator->procDistanceTime($getvilcoor,$village->coor,$session->tribe,0); } else if($_POST['dname']!=""){ $getwref = $database->getVillageByName($_POST['dname']); $getvilcoor = $database->getCoor($getwref); $getvilname = $database->getVillageField($getwref, "name"); $getvilowner = $database->getVillageField($getwref, "owner"); + $time = $generator->procDistanceTime($getvilcoor,$village->coor,$session->tribe,0); } ?> - + @@ -83,7 +86,7 @@ if(isset($_POST['ft'])=='check' && $allres!=0 && ($_POST['x']!="" && $_POST['y'] - + @@ -163,7 +166,6 @@ if(isset($_POST['ft'])=='check' && $allres!=0 && ($_POST['x']!="" && $_POST['y'] - - + @@ -209,6 +209,7 @@ $actionType = "Raid"; + getTypeLevel(16) >= 10) { ?> @@ -262,6 +263,7 @@ $actionType = "Raid"; + getTypeLevel(16) >= 10) { ?> @@ -371,8 +373,8 @@ $actionType = "Raid"; diff --git a/allianz.php b/allianz.php index f72dbc17..dc561dfc 100644 --- a/allianz.php +++ b/allianz.php @@ -208,6 +208,7 @@ if($_GET['aid'] or $session->alliance!=0){ } break; case 5: + $alliance->setForumLink($_POST); include ("Templates/Alliance/linkforum.tpl"); break; case 6: diff --git a/install/data/sql.sql b/install/data/sql.sql index 757c7525..90c2b462 100644 --- a/install/data/sql.sql +++ b/install/data/sql.sql @@ -218,6 +218,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%alidata` ( `Adp` bigint(255) unsigned NOT NULL DEFAULT '0', `clp` bigint(255) NOT NULL DEFAULT '0', `oldrank` bigint(255) unsigned NOT NULL DEFAULT '0', + `forumlink` varchar(150) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
Fa(|)(|)
Player:
duration:-getTimeFormat($time); ?>
Merchants:
Merchants merchantAvail(); ?>/merchant; ?>
Villages: diff --git a/Templates/a2b/attack_5.tpl b/Templates/a2b/attack_5.tpl index aee439c7..075996ff 100644 --- a/Templates/a2b/attack_5.tpl +++ b/Templates/a2b/attack_5.tpl @@ -67,7 +67,7 @@ $actionType = "Raid"; Destination: (|) (|)
in getTimeFormat($time); ?>
- -
at hours
+ +
at procMtime(date('U')+$time,9)?> hours