very big update

This commit is contained in:
unknown
2012-04-19 17:41:33 +03:00
parent e74c7a9518
commit f597c070d5
55 changed files with 1789 additions and 694 deletions
+47 -9
View File
@@ -466,10 +466,10 @@
}
function populateOasisUnitsLow() {
$q2 = "SELECT * FROM " . TB_PREFIX . "wdata where oasistype != 0";
$q2 = "SELECT * FROM " . TB_PREFIX . "odata where conqured == 0";
$result2 = mysql_query($q2, $this->connection);
while($row = mysql_fetch_array($result2)) {
$wid = $row['id'];
$wid = $row['wref'];
$basearray = $this->getMInfo($wid);
//each Troop is a Set for oasis type like mountains have rats spiders and snakes fields tigers elphants clay wolves so on stonger one more not so less
switch($basearray['oasistype']) {
@@ -522,10 +522,10 @@
}
function populateOasisUnitsHigh() {
$q2 = "SELECT * FROM " . TB_PREFIX . "wdata where oasistype != 0";
$q2 = "SELECT * FROM " . TB_PREFIX . "odata where conqured == 0";
$result2 = mysql_query($q2, $this->connection);
while($row = mysql_fetch_array($result2)) {
$wid = $row['id'];
$wid = $row['wref'];
$basearray = $this->getMInfo($wid);
//each Troop is a Set for oasis type like mountains have rats spiders and snakes fields tigers elphants clay wolves so on stonger one more not so less
switch($basearray['oasistype']) {
@@ -1202,7 +1202,42 @@
}
return $text;
}
function getAllianceWar($aid){
$q = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE alli1 = '$aid' AND type = '3'";
$result = mysql_query($q, $this->connection);
if(mysql_num_rows($result) == 0){
$q2 = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE alli2 = '$aid' AND type = '3' AND accepted = '1'";
$result2 = mysql_query($q2, $this->connection);
while($row = mysql_fetch_array($result2)){
$alliance = $this->getAlliance($row['alli1']);
$text = "";
$text .= "<a href=allianz.php?aid=".$alliance['id'].">".$alliance['tag']."</a><br> ";
}
}else{
while($row = mysql_fetch_array($result)){
$alliance = $this->getAlliance($row['alli2']);
$text = "";
$text .= "<a href=allianz.php?aid=".$alliance['id'].">".$alliance['tag']."</a><br> ";
}
}
if(strlen($text) == 0){
$text = "-<br>";
}
return $text;
}
function getAllianceAlly($aid, $type){
$q = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE (alli1 = '$aid' or alli2 = '$aid') AND (type = '$type' AND accepted = '1')";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getAllianceWar2($aid){
$q = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE alli2 = '$aid' or alli1 = '$aid' AND accepted = '1'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function diplomacyExistingRelationships($session_alliance) {
$q = "SELECT * FROM " . TB_PREFIX . "diplomacy WHERE alli2 = $session_alliance AND accepted = 1";
$result = mysql_query($q, $this->connection);
@@ -1280,10 +1315,13 @@
}
function setVillageName($vid, $name) {
$q = "UPDATE " . TB_PREFIX . "vdata set name = '$name' where wref = $vid";
return mysql_query($q, $this->connection);
}
function setVillageName($vid, $name) {
if(!empty($name))
{
$q = "UPDATE " . TB_PREFIX . "vdata set name = '$name' where wref = $vid";
return mysql_query($q, $this->connection);
}
}
function modifyPop($vid, $pop, $mode) {
if(!$mode) {