mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-31 23:57:13 +00:00
fix forum link + fix send resouces by village name + fix details in attack window for natars
This commit is contained in:
@@ -318,6 +318,16 @@
|
|||||||
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . $session->username . '</a> kicked <a href="spieler.php?uid=' . $post['a_user'] . '">' . $UserData['username'] . '</a>.');
|
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . $session->username . '</a> kicked <a href="spieler.php?uid=' . $post['a_user'] . '">' . $UserData['username'] . '</a>.');
|
||||||
//header("Location: build.php?id=".$post['id']);
|
//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
|
Function to quit from alliance
|
||||||
|
|||||||
@@ -1075,7 +1075,7 @@
|
|||||||
References:
|
References:
|
||||||
*****************************************/
|
*****************************************/
|
||||||
function createAlliance($tag, $name, $uid, $max) {
|
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);
|
mysql_query($q, $this->connection);
|
||||||
return mysql_insert_id($this->connection);
|
return mysql_insert_id($this->connection);
|
||||||
}
|
}
|
||||||
@@ -1285,6 +1285,11 @@
|
|||||||
return mysql_query($q, $this->connection);
|
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) {
|
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";
|
$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);
|
$result = mysql_query($q, $this->connection);
|
||||||
@@ -1485,7 +1490,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function removeNotice($id) {
|
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);
|
return mysql_query($q, $this->connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,13 +95,12 @@ class Market {
|
|||||||
$reqMerc = ceil((array_sum($resource)-0.1)/$this->maxcarry);
|
$reqMerc = ceil((array_sum($resource)-0.1)/$this->maxcarry);
|
||||||
|
|
||||||
if($this->merchantAvail() != 0 && $reqMerc <= $this->merchantAvail()) {
|
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'] != "") {
|
if(isset($post['x']) && isset($post['y']) && $post['x'] != "" && $post['y'] != "") {
|
||||||
$coor = array('x'=>$post['x'], 'y'=>$post['y']);
|
$coor = array('x'=>$post['x'], 'y'=>$post['y']);
|
||||||
$id = $generator->getBaseID($coor['x'],$coor['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)) {
|
if($database->getVillageState($id)) {
|
||||||
$timetaken = $generator->procDistanceTime($coor,$village->coor,$session->tribe,0);
|
$timetaken = $generator->procDistanceTime($coor,$village->coor,$session->tribe,0);
|
||||||
@@ -243,8 +242,9 @@ class Market {
|
|||||||
|
|
||||||
private function tradeResource($post) {
|
private function tradeResource($post) {
|
||||||
global $session,$database,$village;
|
global $session,$database,$village;
|
||||||
|
for($i = 1; $i <= 40; $i++){
|
||||||
$wwvillage = $database->getResourceLevel($village->wid);
|
$wwvillage = $database->getResourceLevel($village->wid);
|
||||||
if($wwvillage['f99t']!=40){
|
if($wwvillage['f99t']!=40 and $wwvillage['f'.$i.'t']!=40){
|
||||||
if($session->userinfo['gold'] >= 3) {
|
if($session->userinfo['gold'] >= 3) {
|
||||||
//kijken of ze niet meer gs invoeren dan ze hebben
|
//kijken of ze niet meer gs invoeren dan ze hebben
|
||||||
if($session->access == BANNED){
|
if($session->access == BANNED){
|
||||||
@@ -264,6 +264,7 @@ class Market {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
$market = new Market;
|
$market = new Market;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if($session->access!=BANNED){
|
|||||||
</thead><tbody>
|
</thead><tbody>
|
||||||
|
|
||||||
<tr><th>URL</th>
|
<tr><th>URL</th>
|
||||||
<td><input class="link text" type="text" name="f_link" value="" maxlength="200"></td>
|
<td><input class="link text" type="text" name="f_link" value="<?php echo $allianceinfo['forumlink']; ?>" maxlength="200"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
if(isset($_GET['aid'])) {
|
if(isset($_GET['aid'])) {
|
||||||
$aid = $_GET['aid'];
|
$aid = $_GET['aid'];
|
||||||
}
|
}
|
||||||
@@ -87,10 +87,17 @@ include("alli_menu.tpl");
|
|||||||
echo "<td><a href='spieler.php?uid=".$member['id']."'>".$name."</td>";
|
echo "<td><a href='spieler.php?uid=".$member['id']."'>".$name."</td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
}?>
|
}
|
||||||
|
if($allianceinfo['forumlink'] != ''){
|
||||||
|
echo "<tr>";
|
||||||
|
echo "<td><a href='".$allianceinfo['forumlink']."'>» to the forum</td>";
|
||||||
|
echo "</tr>";
|
||||||
|
}else{
|
||||||
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="emmty"></td>
|
<td colspan="2" class="emmty"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="desc2" colspan="2"><?php echo nl2br($profiel[0]); ?>
|
<td class="desc2" colspan="2"><?php echo nl2br($profiel[0]); ?>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ if(isset($_POST['ft'])=='check' && $allres!=0 && ($_POST['x']!="" && $_POST['y']
|
|||||||
<input type="hidden" name="id" value="<?php echo $id; ?>">
|
<input type="hidden" name="id" value="<?php echo $id; ?>">
|
||||||
<input type="hidden" name="x" value="<?php echo $_POST['x']; ?>">
|
<input type="hidden" name="x" value="<?php echo $_POST['x']; ?>">
|
||||||
<input type="hidden" name="y" value="<?php echo $_POST['y']; ?>">
|
<input type="hidden" name="y" value="<?php echo $_POST['y']; ?>">
|
||||||
|
<input type="hidden" name="dname" value="<?php echo $_POST['dname']; ?>">
|
||||||
<table id="send_select" class="send_res" cellpadding="1" cellspacing="1">
|
<table id="send_select" class="send_res" cellpadding="1" cellspacing="1">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="ico"><img class="r1" src="img/x.gif" alt="Fa" title="Fa" /></td>
|
<td class="ico"><img class="r1" src="img/x.gif" alt="Fa" title="Fa" /></td>
|
||||||
@@ -67,15 +68,17 @@ if(isset($_POST['ft'])=='check' && $allres!=0 && ($_POST['x']!="" && $_POST['y']
|
|||||||
$getvilowner = $database->getVillageField($getwref, "owner");
|
$getvilowner = $database->getVillageField($getwref, "owner");
|
||||||
$getvilcoor['y'] = $_POST['y'];
|
$getvilcoor['y'] = $_POST['y'];
|
||||||
$getvilcoor['x'] = $_POST['x'];
|
$getvilcoor['x'] = $_POST['x'];
|
||||||
|
$time = $generator->procDistanceTime($getvilcoor,$village->coor,$session->tribe,0);
|
||||||
}
|
}
|
||||||
else if($_POST['dname']!=""){
|
else if($_POST['dname']!=""){
|
||||||
$getwref = $database->getVillageByName($_POST['dname']);
|
$getwref = $database->getVillageByName($_POST['dname']);
|
||||||
$getvilcoor = $database->getCoor($getwref);
|
$getvilcoor = $database->getCoor($getwref);
|
||||||
$getvilname = $database->getVillageField($getwref, "name");
|
$getvilname = $database->getVillageField($getwref, "name");
|
||||||
$getvilowner = $database->getVillageField($getwref, "owner");
|
$getvilowner = $database->getVillageField($getwref, "owner");
|
||||||
|
$time = $generator->procDistanceTime($getvilcoor,$village->coor,$session->tribe,0);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<td><a href="karte.php?d=<?php echo $getwref; ?>&c=<?php echo $generator->getMapCheck($getwref); ?>"><?php echo $getvilname; ?>(<?php echo $getvilcoor['y']; ?>|<?php echo $getvilcoor['x']; ?>)<span class="clear"></span></a></td>
|
<td><a href="karte.php?d=<?php echo $getwref; ?>&c=<?php echo $generator->getMapCheck($getwref); ?>"><?php echo $getvilname; ?>(<?php echo $getvilcoor['x']; ?>|<?php echo $getvilcoor['y']; ?>)<span class="clear"></span></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Player:</th>
|
<th>Player:</th>
|
||||||
@@ -83,7 +86,7 @@ if(isset($_POST['ft'])=='check' && $allres!=0 && ($_POST['x']!="" && $_POST['y']
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>duration:</th>
|
<th>duration:</th>
|
||||||
<td>-</td>
|
<td><?php echo $generator->getTimeFormat($time); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Merchants:</th>
|
<th>Merchants:</th>
|
||||||
@@ -163,7 +166,6 @@ if(isset($_POST['ft'])=='check' && $allres!=0 && ($_POST['x']!="" && $_POST['y']
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="mer">Merchants <?php echo $market->merchantAvail(); ?>/<?php echo $market->merchant; ?></td>
|
<td class="mer">Merchants <?php echo $market->merchantAvail(); ?>/<?php echo $market->merchant; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td class="vil">
|
<td class="vil">
|
||||||
<span>Villages:</span>
|
<span>Villages:</span>
|
||||||
<input class="text" type="text" name="dname" value="" maxlength="20" tabindex="5">
|
<input class="text" type="text" name="dname" value="" maxlength="20" tabindex="5">
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ $actionType = "Raid";
|
|||||||
|
|
||||||
<th>Destination:</th>
|
<th>Destination:</th>
|
||||||
|
|
||||||
<td><a href="karte.php?d=&c="><?php echo $process[1]; ?> (<?php echo $coor['x']; ?>|<?php echo $coor['y']; ?>)</a></td>
|
<td><a href="karte.php?d=<?php echo $process[0]; ?>&c=<?php echo $generator->getMapCheck($process[0]); ?>"><?php echo $process[1]; ?> (<?php echo $coor['x']; ?>|<?php echo $coor['y']; ?>)</a></td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -209,6 +209,7 @@ $actionType = "Raid";
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
<option value="38">Great warehouse</option>
|
<option value="38">Great warehouse</option>
|
||||||
<option value="39">Great granary</option>
|
<option value="39">Great granary</option>
|
||||||
|
<option value="40">Wonder of the World</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if($building->getTypeLevel(16) >= 10) { ?>
|
<?php if($building->getTypeLevel(16) >= 10) { ?>
|
||||||
@@ -262,6 +263,7 @@ $actionType = "Raid";
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
<option value="38">Great warehouse</option>
|
<option value="38">Great warehouse</option>
|
||||||
<option value="39">Great granary</option>
|
<option value="39">Great granary</option>
|
||||||
|
<option value="40">Wonder of the World</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if($building->getTypeLevel(16) >= 10) { ?>
|
<?php if($building->getTypeLevel(16) >= 10) { ?>
|
||||||
@@ -372,7 +374,7 @@ $actionType = "Raid";
|
|||||||
|
|
||||||
<div class="in">in <?php echo $generator->getTimeFormat($time); ?></div>
|
<div class="in">in <?php echo $generator->getTimeFormat($time); ?></div>
|
||||||
|
|
||||||
<div class="at">at <span id="tp2"> <?php echo date("H:i:s",time()+$time)?></span><span> hours</span></div>
|
<div class="at">at <span id="tp2"> <?php echo $generator->procMtime(date('U')+$time,9)?></span><span> hours</span></div>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|||||||
@@ -208,6 +208,7 @@ if($_GET['aid'] or $session->alliance!=0){
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
|
$alliance->setForumLink($_POST);
|
||||||
include ("Templates/Alliance/linkforum.tpl");
|
include ("Templates/Alliance/linkforum.tpl");
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
|
|||||||
@@ -218,6 +218,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%alidata` (
|
|||||||
`Adp` bigint(255) unsigned NOT NULL DEFAULT '0',
|
`Adp` bigint(255) unsigned NOT NULL DEFAULT '0',
|
||||||
`clp` bigint(255) NOT NULL DEFAULT '0',
|
`clp` bigint(255) NOT NULL DEFAULT '0',
|
||||||
`oldrank` bigint(255) unsigned NOT NULL DEFAULT '0',
|
`oldrank` bigint(255) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`forumlink` varchar(150) NOT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user