finish hero_full.php

This commit is contained in:
yi12345
2013-06-16 10:38:34 +03:00
commit 98e94af807
2800 changed files with 115529 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
+4
View File
@@ -0,0 +1,4 @@
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
+147
View File
@@ -0,0 +1,147 @@
<?php
session_start();
include('GameEngine/config.php');
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
mysql_select_db(SQL_DB) or die(mysql_error());
include("GameEngine/Generator.php");
include("GameEngine/Database/db_MYSQL.php");
//include("GameEngine/Session.php");
if($y < $yy) {$y = $y + (($yy - $y) /2);}
else {$y = $yy + (($y - $yy) /2);}
$x = $x - (($x - $xx) / 2);
$x = ($x < -WORLD_MAX)? $x+WORLD_MAX*2+1 : $x;
$x = ($x > WORLD_MAX)? $x-WORLD_MAX*2-1 : $x;
$y = ($y < -WORLD_MAX)? $y+WORLD_MAX*2+1 : $y;
$y = ($y > WORLD_MAX)? $y-WORLD_MAX*2-1 : $y;
$xm3 = ($x-3) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-2 : $x-3;
$xm2 = ($x-2) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-1 : $x-2;
$xm1 = ($x-1) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX : $x-1;
$xp1 = ($x+1) > WORLD_MAX? $x-WORLD_MAX-WORLD_MAX : $x+1;
$xp2 = ($x+2) > WORLD_MAX? $x-WORLD_MAX-WORLD_MAX+1 : $x+2;
$xp3 = ($x+3) > WORLD_MAX? $x-WORLD_MAX-WORLD_MAX+2: $x+3;
$ym3 = ($y-3) < -WORLD_MAX? $y+WORLD_MAX+WORLD_MAX-2 : $y-3;
$ym2 = ($y-2) < -WORLD_MAX? $y+WORLD_MAX+WORLD_MAX-1 : $y-2;
$ym1 = ($y-1) < -WORLD_MAX? $y+WORLD_MAX+WORLD_MAX : $y-1;
$yp1 = ($y+1) > WORLD_MAX? $y-WORLD_MAX-WORLD_MAX : $y+1;
$yp2 = ($y+2) > WORLD_MAX? $y-WORLD_MAX-WORLD_MAX+1 : $y+2;
$yp3 = ($y+3) > WORLD_MAX? $y-WORLD_MAX-WORLD_MAX+2: $y+3;
$xarray = array($xm3,$xm2,$xm1,$x,$xp1,$xp2,$xp3);
$yarray = array($ym3,$ym2,$ym1,$y,$yp1,$yp2,$yp3);
$maparray = array();
$xcount = 0;
$maparray = '';
$maparray2 = '';
for($i=0; $i<=6; $i++){
if($xcount != 7){
$maparray .= '\''.$generator->getBaseID($xarray[$xcount],$yarray[$i]).'\',';
$maparray2 .= $generator->getBaseID($xarray[$xcount],$yarray[$i]).',';
if($i==6){
$i = -1;
$xcount +=1;
}
}
}
header("Content-Type: application/json;");
$maparray = (substr($maparray, 0, -1));
$query2 = "SELECT
".TB_PREFIX."wdata.id AS map_id,
".TB_PREFIX."wdata.fieldtype AS map_fieldtype,
".TB_PREFIX."wdata.oasistype AS map_oasis,
".TB_PREFIX."wdata.x AS map_x,
".TB_PREFIX."wdata.y AS map_y,
".TB_PREFIX."wdata.occupied AS map_occupied,
".TB_PREFIX."wdata.image AS map_image,
".TB_PREFIX."odata.conqured AS oasis_conqured,
info_user_oasis.username AS oasis_user,
info_user_oasis.tribe AS oasis_tribe,
info_alliance_oasis.tag AS oasis_alli_name,
".TB_PREFIX."vdata.wref AS ville_id,
".TB_PREFIX."vdata.owner AS ville_user,
".TB_PREFIX."vdata.name AS ville_name,
".TB_PREFIX."vdata.capital AS ville_capital,
".TB_PREFIX."vdata.pop AS ville_pop,
".TB_PREFIX."users.id AS user_id,
".TB_PREFIX."users.username AS user_username,
".TB_PREFIX."users.tribe AS user_tribe,
".TB_PREFIX."users.alliance AS user_alliance,
".TB_PREFIX."alidata.id AS aliance_id,
".TB_PREFIX."alidata.tag AS aliance_name
FROM ((((((".TB_PREFIX."wdata
LEFT JOIN ".TB_PREFIX."vdata ON ".TB_PREFIX."vdata.wref = ".TB_PREFIX."wdata.id )
LEFT JOIN ".TB_PREFIX."odata ON ".TB_PREFIX."odata.wref = ".TB_PREFIX."wdata.id )
LEFT JOIN ".TB_PREFIX."users AS info_user_oasis ON info_user_oasis.id = ".TB_PREFIX."odata.owner )
LEFT JOIN ".TB_PREFIX."alidata AS info_alliance_oasis ON info_alliance_oasis.id = info_user_oasis.alliance )
LEFT JOIN ".TB_PREFIX."users ON ".TB_PREFIX."users.id = ".TB_PREFIX."vdata.owner )
LEFT JOIN ".TB_PREFIX."alidata ON ".TB_PREFIX."alidata.id = ".TB_PREFIX."users.alliance )
where ".TB_PREFIX."wdata.id IN ($maparray)
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
$result2 = mysql_query($query2) or die(mysql_error());
$i=0;
//Load coor array
$yrow = 0;
$map_js ='';
while ($donnees = mysql_fetch_assoc($result2)){
$targetalliance=$donnees["aliance_id"];
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
$neutralarray=$database->getAllianceAlly($donnees["aliance_id"],2);
$enemyarray=$database->getAllianceWar2($donnees["aliance_id"]);
$friend = (($friendarray[0]['alli1']>0 and $friendarray[0]['alli2']>0 and $donnees["aliance_id"]>0) and ($friendarray[0]['alli1']==$_SESSION['alliance_user'] or $friendarray[0]['alli2']==$_SESSION['alliance_user']) and ($_SESSION['alliance_user'] != $targetalliance and $_SESSION['alliance_user'] and $targetalliance)) ? '1':'0';
$war = (($enemyarray[0]['alli1']>0 and $enemyarray[0]['alli2']>0 and $donnees["aliance_id"]>0) and ($enemyarray[0]['alli1']==$_SESSION['alliance_user'] or $enemyarray[0]['alli2']==$_SESSION['alliance_user']) and ($_SESSION['alliance_user'] != $targetalliance and $_SESSION['alliance_user'] and $targetalliance)) ? '1':'0';
$neutral = (($neutralarray[0]['alli1']>0 and $neutralarray[0]['alli2']>0 and $donnees["aliance_id"]>0) and ($neutralarray[0]['alli1']==$_SESSION['alliance_user'] or $neutralarray[0]['alli2']==$_SESSION['alliance_user']) and ($_SESSION['alliance_user'] != $targetalliance and $_SESSION['alliance_user'] and $targetalliance)) ? '1':'0';
$image = ($donnees['map_occupied'] == 1 && $donnees['map_fieldtype'] > 0)?(($donnees['ville_user'] == $_SESSION['id_user'])? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b30': 'b20' :'b10' : 'b00') : (($targetalliance != 0)? ($friend==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b31': 'b21' :'b11' : 'b01') : ($war==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b32': 'b22' :'b12' : 'b02') : ($neutral==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b35': 'b25' :'b15' : 'b05') : ($targetalliance == $_SESSION['alliance_user']? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b33': 'b23' :'b13' : 'b03') : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))))) : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))) : $donnees['map_image'];
if($donnees['ville_user']==3 && $donnees['ville_name']=='WW Buildingplan'){
$image = "o99";
}
//Javascript map info
if($yrow!=7){
$map_js .= "[".$donnees['map_x'].",".$donnees['map_y'].",".$donnees['map_fieldtype'].",". ((!empty($donnees['map_oasis'])) ? $donnees['map_oasis'] : 0) .",\"d=".$donnees['map_id']."&c=".$generator->getMapCheck($donnees['map_id'])."\",\"".$image."\"";
if($donnees['map_occupied']){
if($donnees['map_fieldtype'] != 0){
$map_js.= ",\"".$donnees['ville_name']."\",\"".$donnees['user_username']."\",\"".$donnees['ville_pop']."\",\"".$donnees['aliance_name']."\",\"".$donnees['user_tribe']."\"]\n";
}
}
elseif($donnees['map_oasis'] != 0){
if ($donnees['oasis_conqured'] != 0){
$map_js.= ",\"\",\"".$donnees['oasis_user']."\",\"-\",\"".$donnees['oasis_alli_name']."\",\"".$donnees['oasis_tribe']."\"]";
}
else{
$map_js.="]";
}
}
else{$map_js .= "]";}
if($i == 6 && $yrow !=6){
$i = -1;
$yrow +=1;
$map_js .= "],[";
}
else {
if($yrow == 6 && $i == 6) {$map_js .= "]";}
else {$map_js .= ",";}
}
$regcount += 1;
}
else {$map_js .= "]";}
++$i;
}
echo '[['.$map_js.']';
+164
View File
@@ -0,0 +1,164 @@
<?php
session_start();
include('GameEngine/config.php');
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
mysql_select_db(SQL_DB) or die(mysql_error());
include("GameEngine/Generator.php");
include("GameEngine/Database/db_MYSQL.php");
header("Content-Type: application/json;");
//include("GameEngine/Session.php");
if($y < $yy) {$y = $y + (($yy - $y) /2);}
else {$y = $yy + (($y - $yy) /2);}
$x = $x - (($x - $xx) / 2);
$x = ($x < -WORLD_MAX)? $x+WORLD_MAX*2+1 : $x;
$x = ($x > WORLD_MAX)? $x-WORLD_MAX*2-1 : $x;
$y = ($y < -WORLD_MAX)? $y+WORLD_MAX*2+1 : $y;
$y = ($y > WORLD_MAX)? $y-WORLD_MAX*2-1 : $y;
$xm6 = ($x-6) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-5 : $x-6;
$xm5 = ($x-5) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-4 : $x-5;
$xm4 = ($x-4) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-3 : $x-4;
$xm3 = ($x-3) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-2 : $x-3;
$xm2 = ($x-2) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-1 : $x-2;
$xm1 = ($x-1) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX : $x-1;
$xp1 = ($x+1) > WORLD_MAX? $x-WORLD_MAX-WORLD_MAX : $x+1;
$xp2 = ($x+2) > WORLD_MAX? $x-WORLD_MAX-WORLD_MAX+1 : $x+2;
$xp3 = ($x+3) > WORLD_MAX? $x-WORLD_MAX-WORLD_MAX+2: $x+3;
$xp4 = ($x+4) > WORLD_MAX? $x-WORLD_MAX-WORLD_MAX+3 : $x+4;
$xp5 = ($x+5) > WORLD_MAX? $x-WORLD_MAX-WORLD_MAX+4 : $x+5;
$xp6 = ($x+6) > WORLD_MAX? $x-WORLD_MAX-WORLD_MAX+5: $x+6;
$ym6 = ($y-6) < -WORLD_MAX? $y+WORLD_MAX+WORLD_MAX-5 : $y-6;
$ym5 = ($y-5) < -WORLD_MAX? $y+WORLD_MAX+WORLD_MAX-4 : $y-5;
$ym4 = ($y-4) < -WORLD_MAX? $y+WORLD_MAX+WORLD_MAX-3 : $y-4;
$ym3 = ($y-3) < -WORLD_MAX? $y+WORLD_MAX+WORLD_MAX-2 : $y-3;
$ym2 = ($y-2) < -WORLD_MAX? $y+WORLD_MAX+WORLD_MAX-1 : $y-2;
$ym1 = ($y-1) < -WORLD_MAX? $y+WORLD_MAX+WORLD_MAX : $y-1;
$yp1 = ($y+1) > WORLD_MAX? $y-WORLD_MAX-WORLD_MAX : $y+1;
$yp2 = ($y+2) > WORLD_MAX? $y-WORLD_MAX-WORLD_MAX+1 : $y+2;
$yp3 = ($y+3) > WORLD_MAX? $y-WORLD_MAX-WORLD_MAX+2: $y+3;
$yp4 = ($y+4) > WORLD_MAX? $y-WORLD_MAX-WORLD_MAX+3: $y+4;
$yp5 = ($y+5) > WORLD_MAX? $y-WORLD_MAX-WORLD_MAX+4 : $y+5;
$yp6 = ($y+6) > WORLD_MAX? $y-WORLD_MAX-WORLD_MAX+5: $y+6;
$xarray = array($xm6,$xm5,$xm4,$xm3,$xm2,$xm1,$x,$xp1,$xp2,$xp3,$xp4,$xp5,$xp6);
$yarray = array($ym6,$ym5,$ym4,$ym3,$ym2,$ym1,$y,$yp1,$yp2,$yp3,$yp4,$yp5,$yp6);
$maparray = array();
$xcount = 0;
$maparray = '';
$maparray2 = '';
for($i=0; $i<=12; $i++){
if($xcount != 13){
$maparray .= '\''.$generator->getBaseID($xarray[$xcount],$yarray[$i]).'\',';
$maparray2 .= $generator->getBaseID($xarray[$xcount],$yarray[$i]).',';
if($i==12){
$i = -1;
$xcount +=1;
}
}
}
$maparray = (substr($maparray, 0, -1));
$maparray2 = (substr($maparray2, 0, -1));
//echo $maparray;
$query2 = "SELECT
".TB_PREFIX."wdata.id AS map_id,
".TB_PREFIX."wdata.fieldtype AS map_fieldtype,
".TB_PREFIX."wdata.oasistype AS map_oasis,
".TB_PREFIX."wdata.x AS map_x,
".TB_PREFIX."wdata.y AS map_y,
".TB_PREFIX."wdata.occupied AS map_occupied,
".TB_PREFIX."wdata.image AS map_image,
".TB_PREFIX."odata.conqured AS oasis_conqured,
info_user_oasis.username AS oasis_user,
info_user_oasis.tribe AS oasis_tribe,
info_alliance_oasis.tag AS oasis_alli_name,
".TB_PREFIX."vdata.wref AS ville_id,
".TB_PREFIX."vdata.owner AS ville_user,
".TB_PREFIX."vdata.name AS ville_name,
".TB_PREFIX."vdata.capital AS ville_capital,
".TB_PREFIX."vdata.pop AS ville_pop,
".TB_PREFIX."users.id AS user_id,
".TB_PREFIX."users.username AS user_username,
".TB_PREFIX."users.tribe AS user_tribe,
".TB_PREFIX."users.alliance AS user_alliance,
".TB_PREFIX."alidata.id AS aliance_id,
".TB_PREFIX."alidata.tag AS aliance_name
FROM ((((((".TB_PREFIX."wdata
LEFT JOIN ".TB_PREFIX."vdata ON ".TB_PREFIX."vdata.wref = ".TB_PREFIX."wdata.id )
LEFT JOIN ".TB_PREFIX."odata ON ".TB_PREFIX."odata.wref = ".TB_PREFIX."wdata.id )
LEFT JOIN ".TB_PREFIX."users AS info_user_oasis ON info_user_oasis.id = ".TB_PREFIX."odata.owner )
LEFT JOIN ".TB_PREFIX."alidata AS info_alliance_oasis ON info_alliance_oasis.id = info_user_oasis.alliance )
LEFT JOIN ".TB_PREFIX."users ON ".TB_PREFIX."users.id = ".TB_PREFIX."vdata.owner )
LEFT JOIN ".TB_PREFIX."alidata ON ".TB_PREFIX."alidata.id = ".TB_PREFIX."users.alliance )
where ".TB_PREFIX."wdata.id IN ($maparray)
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
//echo $query2;
$result2 = mysql_query($query2) or die(mysql_error());
$i=0;
$i2=0;
$yrow = 0;
$row = 0;
$coorindex = 0;
$map_js ='';
while ($donnees = mysql_fetch_assoc($result2)){
$targetalliance=$donnees["aliance_id"];
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
$neutralarray=$database->getAllianceAlly($donnees["aliance_id"],2);
$enemyarray=$database->getAllianceWar2($donnees["aliance_id"]);
$friend = (($friendarray[0]['alli1']>0 and $friendarray[0]['alli2']>0 and $donnees["aliance_id"]>0) and ($friendarray[0]['alli1']==$_SESSION['alliance_user'] or $friendarray[0]['alli2']==$_SESSION['alliance_user']) and ($_SESSION['alliance_user'] != $targetalliance and $_SESSION['alliance_user'] and $targetalliance)) ? '1':'0';
$war = (($enemyarray[0]['alli1']>0 and $enemyarray[0]['alli2']>0 and $donnees["aliance_id"]>0) and ($enemyarray[0]['alli1']==$_SESSION['alliance_user'] or $enemyarray[0]['alli2']==$_SESSION['alliance_user']) and ($_SESSION['alliance_user'] != $targetalliance and $_SESSION['alliance_user'] and $targetalliance)) ? '1':'0';
$neutral = (($neutralarray[0]['alli1']>0 and $neutralarray[0]['alli2']>0 and $donnees["aliance_id"]>0) and ($neutralarray[0]['alli1']==$_SESSION['alliance_user'] or $neutralarray[0]['alli2']==$_SESSION['alliance_user']) and ($_SESSION['alliance_user'] != $targetalliance and $_SESSION['alliance_user'] and $targetalliance)) ? '1':'0';
$image = ($donnees['map_occupied'] == 1 && $donnees['map_fieldtype'] > 0)?(($donnees['ville_user'] == $_SESSION['id_user'])? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b30': 'b20' :'b10' : 'b00') : (($targetalliance != 0)? ($friend==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b31': 'b21' :'b11' : 'b01') : ($war==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b32': 'b22' :'b12' : 'b02') : ($neutral==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b35': 'b25' :'b15' : 'b05') : ($targetalliance == $_SESSION['alliance_user']? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b33': 'b23' :'b13' : 'b03') : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))))) : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))) : $donnees['map_image'];
if($donnees['ville_user']==3 && $donnees['ville_name']=='WW Buildingplan'){
$image = "o99";
}
//Javascript map info
if($yrow!=13){
$map_js .= "[".$donnees['map_x'].",".$donnees['map_y'].",".$donnees['map_fieldtype'].",". ((!empty($donnees['map_oasis'])) ? $donnees['map_oasis'] : 0) .",\"d=".$donnees['map_id']."&c=".$generator->getMapCheck($donnees['map_id'])."\",\"".$image."\"";
if($donnees['map_occupied']){
if($donnees['map_fieldtype'] != 0){
$map_js.= ",\"".$donnees['ville_name']."\",\"".$donnees['user_username']."\",\"".$donnees['ville_pop']."\",\"".$donnees['aliance_name']."\",\"".$donnees['user_tribe']."\"]\n";
}
}
elseif($donnees['map_oasis'] != 0){
if ($donnees['oasis_conqured'] != 0){
$map_js.= ",\"\",\"".$donnees['oasis_user']."\",\"-\",\"".$donnees['oasis_alli_name']."\",\"".$donnees['oasis_tribe']."\"]";
}
else{
$map_js.="]";
}
}
else{$map_js .= "]";}
if($i == 12 && $yrow !=12){
$i = -1;
$yrow +=1;
$map_js .= "],[";
}
else {
if($yrow == 12 && $i == 12) {$map_js .= "]";}
else {$map_js .= ",";}
}
$regcount += 1;
}
else {$map_js .= "]";}
++$i;
}
echo '[['.$map_js.']';
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+4
View File
@@ -0,0 +1,4 @@
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
+4
View File
@@ -0,0 +1,4 @@
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
+186
View File
@@ -0,0 +1,186 @@
<!-- //////////////// made by TTMTT //////////////// -->
<?php
if($session->access!=BANNED){
?>
<script language="JavaScript" type="text/javascript">
function showCheckList() {
bid = document.getElementById('bid');
if(bid.value == 2) {
document.getElementById('conf_list').className = '';
document.getElementById('ally_list').className = '';
document.getElementById('user_list').className = 'hide';
}
else if (bid.value == 3) {
document.getElementById('conf_list').className = 'hide';
document.getElementById('ally_list').className = 'hide';
document.getElementById('user_list').className = '';
}
else {
document.getElementById('conf_list').className = 'hide';
document.getElementById('ally_list').className = 'hide';
document.getElementById('user_list').className = 'hide';
}
}
</script>
<script language="JavaScript" type="text/javascript">
function addRow(element_id) {
// element_id: user_list, ally_list
liste = document.getElementById(element_id);
liste = liste.getElementsByTagName('tbody')[0];
var anzahl_trs = liste.getElementsByTagName('tr').length;
var num_fields = anzahl_trs;
var num_last_tr = anzahl_trs -1;
lastTR = liste.getElementsByTagName('tr')[num_last_tr];
lastTD = lastTR.getElementsByTagName('td')[2];
lastIMG = lastTD.getElementsByTagName('img')[0];
lastTD.removeChild(lastIMG);
newTR = document.createElement('tr');
newTD1 = document.createElement('td');
newTD2 = document.createElement('td');
newTD3 = document.createElement('td');
newTR.appendChild(newTD1);
newTR.appendChild(newTD2);
newTR.appendChild(newTD3);
liste.appendChild(newTR);
var html_input_1 = '<input class="text" type="text" ';
if(element_id == 'ally_list') {
newTD1.className = 'ally';
newTD2.className = 'tag';
newTD3.className = 'ad';
newTD1.innerHTML = html_input_1 + 'id="allys_by_id_'+num_fields+'" class="text" maxlength="15" name="allys_by_id['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'allys\')">';
newTD2.innerHTML = html_input_1 + 'id="allys_by_name_'+num_fields+'" class="text" maxlength="15" name="allys_by_name['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'allys\')">';
}
if(element_id == 'user_list') {
newTD1.className = 'id';
newTD2.className = 'pla';
newTD3.className = 'ad';
newTD1.innerHTML = html_input_1 + 'id="users_by_id_'+num_fields+'" class="text" maxlength="15" name="users_by_id['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'users\')">';
newTD2.innerHTML = html_input_1 + 'id="users_by_name_'+num_fields+'" class="text" maxlength="50" name="users_by_name['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'users\')">';
}
newTD3.innerHTML = '<img class="add" src="img/x.gif" title="add" alt="add" onclick="addRow(\''+element_id+'\')">';
}
</script>
<script language="JavaScript" type="text/javascript">
function checkInputs(id, typ) {
id_field = document.getElementById(typ+'_by_id_'+id);
name_field = document.getElementById(typ+'_by_name_'+id);
//alert(id_field.value);
//alert(name_field.value);
if (id_field.value != '' && id_field.disabled == false) {
name_field.disabled = true;
name_field.style.border = '1px solid #999';
}
else {
name_field.disabled = false;
name_field.style.border = '1px solid #71D000';
}
if (name_field.value != '' && name_field.disabled == false) {
id_field.disabled = true;
id_field.style.border = '1px solid #999';
}
else {
id_field.disabled = false;
id_field.style.border = '1px solid #71D000';
}
}
</script><form method="post" action="allianz.php?s=2">
<input type="hidden" name="new" value="1">
<input type="hidden" name="newforum" value="1">
<input type="hidden" name="admin" value="1">
<table cellpadding="1" cellspacing="1" id="new_forum"><thead>
<tr>
<th colspan="2">New forum</th>
</tr>
</thead><tbody>
<tr>
<th>Forum name</th>
<td><input class="text" type="text" name="u1" value="" maxlength="20"></td>
</tr>
<tr>
<th>Description</th>
<td><input class="text" type="text" name="u2" value="" maxlength="38"></td>
</tr>
<tr>
<th>Forum type</th>
<td><select class="dropdown" id="bid" name="bid" onchange="showCheckList();"><option value="1">Public Forum</option><option value="2">Confederation Forum</option><option value="0"selected>Alliance Forum</option><option value="3">Closed Forum</option></select></td>
</tr>
</tbody></table><table cellpadding="1" cellspacing="1" id="ally_list"><thead>
<tr>
<th colspan="3">Open for more alliances</th>
</tr>
<tr>
<td>Alliance ID</td>
<td>Tag:</td>
<td>Add</td>
</tr>
</thead><tbody>
<tr>
<td class="ally">
<input class="text" type="text" id="allys_by_id_0" maxlength="15" name="allys_by_id[0]" onkeyup="checkInputs(0,'allys');" />
</td>
<td class="tag">
<input class="text" type="text" id="allys_by_name_0" maxlength="15" name="allys_by_name[0]" onkeyup="checkInputs(0,'allys');" />
</td>
<td class="ad">
<img class="add" src="img/x.gif" title="add" alt="add" onclick="addRow('ally_list')" />
</td>
</tr>
</table><table cellpadding="1" cellspacing="1" id="user_list"><thead>
<tr>
<th colspan="3">Open forum for the following players</th>
</tr>
<tr>
<td>User ID</td>
<td>Name:</td>
<td>Add</td>
</tr>
</thead><tbody>
<tr>
<td class="id">
<input class="text" type="text" id="users_by_id_0" maxlength="15" name="users_by_id[0]" onkeyup="checkInputs(0,'users');" />
</td>
<td class="pla">
<input class="text" type="text" id="users_by_name_0" maxlength="50" name="users_by_name[0]" onkeyup="checkInputs(0,'users');" />
</td>
<td class="ad">
<img class="add" src="img/x.gif" title="add" alt="add" onclick="addRow('user_list')" />
</td>
</tr>
</tbody></table>
<script language="JavaScript" type="text/javascript">
showCheckList();
</script>
<p class="btn"><input type="image" id="fbtn_ok" value="ok" name="s1" class="dynamic_img" src="img/x.gif" alt="OK" /></p></form>
<?php }else{
header("Location: banned.php");
}
?>
File diff suppressed because one or more lines are too long
+234
View File
@@ -0,0 +1,234 @@
<?php
//////////////// made by TTMTT ////////////////
if($session->access!=BANNED){
$displayarray = $database->getUserArray($session->uid,1);
$forumcat = $database->ForumCat(htmlspecialchars($displayarray['alliance']));
$forum_cat = $database->ForumCat;
$ally = $session->alliance;
$public = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 1");
$public1 = mysql_num_rows($public);
$cofederation = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 2");
$cofederation1 = mysql_num_rows($cofederation);
$alliance = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 0");
$alliance1 = mysql_num_rows($alliance);
$closed = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 3");
$closed1 = mysql_num_rows($closed);
if($public1 != 0){
?>
<table cellpadding="1" cellspacing="1" id="public"><thead>
<tr>
<th colspan="4">Public Forum</th>
</tr>
<tr>
<td></td>
<td>Forum name</td>
<td>&nbsp;Threads&nbsp;</td>
<td>&nbsp;Last post&nbsp;</td>
</tr></thead><tbody>
<?php
foreach($forumcat as $arr) {
if($arr['forum_area']==1){
$countop = $database->CountCat($arr['id']);
$ltopic = $database->LastTopic($arr['id']);
foreach($ltopic as $las) {
}
$lpos = $database->LastPost($las['id']);
foreach($lpos as $pos) {
}
if($database->CheckLastTopic($arr['id'])){
if($database->CheckLastPost($las['id'])){
$lpost = date('m/d/y H:i a',$pos['date']);
$owner = $database->getUserArray($pos['owner'],1);
}else{
$lpost = date('m/d/y H:i a',$las[date]);
$owner = $database->getUserArray($las['owner'],1);
}
}else{
$lpost = "";
$owner = "";
}
echo '<tr><td class="ico">';
if($database->CheckEditRes($aid)=="1"){
echo '<a class="up_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=-1" title="To top"><img src="img/x.gif" alt="To top" /></a><a class="edit" href="allianz.php?s=2&idf='.$arr['id'].'&admin=editforum" title="edit"><img src="img/x.gif" alt="edit" /></a><br /><a class="down_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=1" title="To bottom"><img src="img/x.gif" alt="To bottom" /></a><a class="fdel" href="allianz.php?s=2&idf='.$arr['id'].'&admin=delforum" onClick="return confirm(\'confirm delete?\');" title="delete"><img src="img/x.gif" alt="delete" /></a>';
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.stripslashes($arr['forum_name']).'">'.stripslashes($arr['forum_name']).'</a><br />'.stripslashes($arr['forum_des']).'</td>
<td class="cou">'.$countop.'</td>
<td class="last">'.$lpost.'</span><span><br /><a href="spieler.php?uid='.$owner['id'].'">'.$owner['username'].'</a> <img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></td>
</tr>';
}
}
?>
</tbody></table>
<?php
}if($cofederation1 != 0){
?>
<table cellpadding="1" cellspacing="1" id="confederation"><thead>
<tr>
<th colspan="4">Confederation Forum</th>
</tr>
<tr>
<td></td>
<td>Forum name</td>
<td>&nbsp;Threads&nbsp;</td>
<td>&nbsp;Last post&nbsp;</td>
</tr></thead><tbody>
<?php
foreach($forumcat as $arr) {
if($arr['forum_area']==2){
$countop = $database->CountCat($arr['id']);
$ltopic = $database->LastTopic($arr['id']);
foreach($ltopic as $las) {
}
$lpos = $database->LastPost($las['id']);
foreach($lpos as $pos) {
}
if($database->CheckLastTopic($arr['id'])){
if($database->CheckLastPost($las['id'])){
$lpost = date('m/d/y H:i a',$pos['date']);
$owner = $database->getUserArray($pos['owner'],1);
}else{
$lpost = date('m/d/y H:i a',$las[date]);
$owner = $database->getUserArray($las['owner'],1);
}
}else{
$lpost = "";
$owner = "";
}
echo '<tr><td class="ico">';
if($database->CheckEditRes($aid)=="1"){
echo '<a class="up_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=-1" title="To top"><img src="img/x.gif" alt="To top" /></a><a class="edit" href="allianz.php?s=2&idf='.$arr['id'].'&admin=editforum" title="edit"><img src="img/x.gif" alt="edit" /></a><br /><a class="down_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=1" title="To bottom"><img src="img/x.gif" alt="To bottom" /></a><a class="fdel" href="allianz.php?s=2&idf='.$arr['id'].'&admin=delforum" onClick="return confirm(\'confirm delete?\');" title="delete"><img src="img/x.gif" alt="delete" /></a>';
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.stripslashes($arr['forum_name']).'">'.stripslashes($arr['forum_name']).'</a><br />'.stripslashes($arr['forum_des']).'</td>
<td class="cou">'.$countop.'</td>
<td class="last">'.$lpost.'</span><span><br /><a href="spieler.php?uid='.$owner['id'].'">'.$owner['username'].'</a> <img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></td>
</tr>';
}
}
?>
</tbody></table>
<?php
}if($alliance1 != 0){
?>
<table cellpadding="1" cellspacing="1" id="alliance"><thead>
<tr>
<th colspan="4">Alliance Forum</th>
</tr>
<tr>
<td></td>
<td>Forum name</td>
<td>&nbsp;Threads&nbsp;</td>
<td>&nbsp;Last post&nbsp;</td>
</tr></thead><tbody>
<?php
foreach($forumcat as $arr) {
if($arr['forum_area']==0){
$countop = $database->CountCat($arr['id']);
$ltopic = $database->LastTopic($arr['id']);
foreach($ltopic as $las) {
}
$lpos = $database->LastPost($las['id']);
foreach($lpos as $pos) {
}
if($database->CheckLastTopic($arr['id'])){
if($database->CheckLastPost($las['id'])){
$lpost = date('m/d/y H:i a',$pos['date']);
$owner = $database->getUserArray($pos['owner'],1);
}else{
$lpost = date('m/d/y H:i a',$las[date]);
$owner = $database->getUserArray($las['owner'],1);
}
}else{
$lpost = "";
$owner = "";
}
echo '<tr><td class="ico">';
if($database->CheckEditRes($aid)=="1"){
echo '<a class="up_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=-1" title="To top"><img src="img/x.gif" alt="To top" /></a><a class="edit" href="allianz.php?s=2&idf='.$arr['id'].'&admin=editforum" title="edit"><img src="img/x.gif" alt="edit" /></a><br /><a class="down_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=1" title="To bottom"><img src="img/x.gif" alt="To bottom" /></a><a class="fdel" href="allianz.php?s=2&idf='.$arr['id'].'&admin=delforum" onClick="return confirm(\'confirm delete?\');" title="delete"><img src="img/x.gif" alt="delete" /></a>';
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.stripslashes($arr['forum_name']).'">'.stripslashes($arr['forum_name']).'</a><br />'.stripslashes($arr['forum_des']).'</td>
<td class="cou">'.$countop.'</td>
<td class="last">'.$lpost.'</span><span><br /><a href="spieler.php?uid='.$owner['id'].'">'.$owner['username'].'</a> <img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></td>
</tr>';
}
}
?>
</tbody></table>
<?php
}if($closed1 != 0){
?>
<table cellpadding="1" cellspacing="1" id="closed"><thead>
<tr>
<th colspan="4">Closed Forum</th>
</tr>
<tr>
<td></td>
<td>Forum name</td>
<td>&nbsp;Threads&nbsp;</td>
<td>&nbsp;Last post&nbsp;</td>
</tr></thead><tbody>
<?php
foreach($forumcat as $arr) {
if($arr['forum_area']==3){
$countop = $database->CountCat($arr['id']);
$ltopic = $database->LastTopic($arr['id']);
foreach($ltopic as $las) {
}
$lpos = $database->LastPost($las['id']);
foreach($lpos as $pos) {
}
if($database->CheckLastTopic($arr['id'])){
if($database->CheckLastPost($las['id'])){
$lpost = date('m/d/y H:i a',$pos['date']);
$owner = $database->getUserArray($pos['owner'],1);
}else{
$lpost = date('m/d/y H:i a',$las[date]);
$owner = $database->getUserArray($las['owner'],1);
}
}else{
$lpost = "";
$owner = "";
}
echo '<tr><td class="ico">';
if($database->CheckEditRes($aid)=="1"){
echo '<a class="up_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=-1" title="To top"><img src="img/x.gif" alt="To top" /></a><a class="edit" href="allianz.php?s=2&idf='.$arr['id'].'&admin=editforum" title="edit"><img src="img/x.gif" alt="edit" /></a><br /><a class="down_arr" href="allianz.php?s=2&fid='.$arr['id'].'&bid=0&admin=pos&res=1" title="To bottom"><img src="img/x.gif" alt="To bottom" /></a><a class="fdel" href="allianz.php?s=2&idf='.$arr['id'].'&admin=delforum" onClick="return confirm(\'confirm delete?\');" title="delete"><img src="img/x.gif" alt="delete" /></a>';
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.stripslashes($arr['forum_name']).'">'.stripslashes($arr['forum_name']).'</a><br />'.stripslashes($arr['forum_des']).'</td>
<td class="cou">'.$countop.'</td>
<td class="last">'.$lpost.'</span><span><br /><a href="spieler.php?uid='.$owner['id'].'">'.$owner['username'].'</a> <img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></td>
</tr>';
}
}
?>
</tbody></table>
<?php
}
?>
<p>
<?php
$opt = $database->getAlliPermissions($session->uid, $aid);
if($opt['opt5'] == 1){
echo '<a href="allianz.php?s=2&admin=newforum"><img id="fbtn_newforum" class="dynamic_img" src="img/x.gif" alt="New forum" /></a>
<a href="allianz.php?s='.$ids.'&admin=switch_admin" title="Toggle Admin mode"><img class="switch_admin dynamic_img" src="img/x.gif" alt="Toggle Admin mode" /></a>';
}
?>
</p>
<?php }else{
header("Location: banned.php");
}
?>
+46
View File
@@ -0,0 +1,46 @@
<?php
//////////////// made by TTMTT ////////////////
if($session->access!=BANNED){
$topic_id = $_GET['idt'];
$show_topic = $database->ShowTopic($topic_id);
foreach($show_topic as $topi) {
$title = stripslashes($topi['title']);
}
?>
<form method="post" action="allianz.php?s=2&fid=<?php echo $_GET['idf']; ?>&pid=<?php echo $aid; ?>">
<input type="hidden" name="s" value="2">
<input type="hidden" name="tid" value="<?php echo $topic_id; ?>">
<input type="hidden" name="edittopic" value="1">
<table cellpadding="1" cellspacing="1" id="edit_topic"><thead>
<tr>
<th colspan="2">Edit topic</td>
</tr>
</thead><tbody>
<tr>
<th>Thread</th>
<td><input class="text" type="Text" name="thema" value="<?php echo $title; ?>" maxlength="35"></td>
</tr>
<tr>
<th>Move topic</td>
<td><select class="dropdown" name="fid">
<?php
$show_cat = $database->ForumCat($session->alliance);
foreach($show_cat as $cats) {
if($cats['id'] == $_GET['idf']){
echo '<option value="'.$cats['id'].'" selected>'.stripslashes($cats['forum_name']).'</option>';
}else{
echo '<option value="'.$cats['id'].'">'.stripslashes($cats['forum_name']).'</option>';
}
}
?>
</select></td>
</tr>
</tbody></table>
<p class="btn"><input type="image" id="fbtn_ok" value="ok" name="s1" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p>
<?php }else{
header("Location: banned.php");
}
?>
+107
View File
@@ -0,0 +1,107 @@
<?php
//////////////// made by TTMTT ////////////////
if($session->access!=BANNED){
$cat_id = $_GET['fid'];
$CatName = stripslashes($database->ForumCatName($cat_id));
$ChckTopic = $database->CheckCatTopic($cat_id);
$Topics = $database->ForumCatTopic($cat_id);
$TopicsStick = $database->ForumCatTopicStick($cat_id);
?>
<h4><a href="allianz.php?s=2">Alliance</a> -> <a href="allianz.php?s=2&pid=<?php echo $_GET['pid']; ?>&fid=<?php echo $cat_id; ?>"><?php echo $CatName; ?></a></h4><table cellpadding="1" cellspacing="1" id="topics"><thead>
<tr>
<th colspan="4"><?php echo $CatName; ?></th>
</tr>
<tr>
<td></td>
<td>Threads</td>
<td>Replies</td>
<td>Last post</td>
</tr></thead><tbody>
<?php
if($ChckTopic){
foreach($TopicsStick as $arrs) {
$CountPosts = $database->CountPost($arrs['id']);
$lposts = $database->LastPost($arrs['id']);
foreach($lposts as $post) {
}
if($database->CheckLastPost($arrs[id])){
$post_dates = date('m/d/y, H:i a',$post['date']);
$owner_topics = $database->getUserArray($post['owner'],1);
}else{
$post_dates = date('m/d/y, H:i a',$arrs['date']);
$owner_topics = $database->getUserArray($arrs['owner'],1);
}
echo '<tr><td class="ico">';
if($database->CheckEditRes($aid)=="1"){
if($database->CheckCloseTopic($arrs['id']) == 1){
$locks = '<a class="unlock" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=unlock" title="open topic"><img src="img/x.gif" alt="open topic" /></a>';
}else{
$locks = '<a class="lock" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=lock" title="close topic"><img src="img/x.gif" alt="close topic" /></a>';
}
echo ''.$locks.'<a class="edit" href="?s=2&idf='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=edittopic" title="edit"><img src="img/x.gif" alt="edit" /></a><br /><a class="unpin" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=unpin" title="stick topic"><img src="img/x.gif" alt="stick topic" /></a><a class="fdel" href="?s=2&fid='.$_GET['fid'].'&idt='.$arrs['id'].'&admin=deltopic" title="delete"><img src="img/x.gif" alt="delete" onClick="return confirm(\'confirm delete?\');" /></a>';
}elseif($arrs['close']=="1"){
echo '<img class="folder_sticky_lock" src="img/x.gif" alt="Closed Thread without new posts" title="Closed Thread without new posts" />';
}else{
echo '<img class="folder_sticky" src="img/x.gif" alt="Important Thread without new posts" title="Important Thread without new posts" />';
}
echo '</td>
<td class="tit"><a href="allianz.php?s=2&fid2='.$arrs['cat'].'&pid='.$aid.'&tid='.$arrs['id'].'">'.stripslashes($arrs['title']).'</a><br></td>
<td class="cou">'.$CountPosts.'</td>
<td class="last">'.$post_dates.'<br /><a href="spieler.php?uid='.$arrs[owner].'">'.$owner_topics['username'].'</a> <a href="allianz.php?s=2&fid2='.$arrs['cat'].'&pid='.$aid.'&tid='.$arrs['id'].'&seite=max"><img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></a>
</td></tr>';
}
foreach($Topics as $arr) {
$CountPost = $database->CountPost($arr['id']);
$lpost = $database->LastPost($arr['id']);
foreach($lpost as $pos) {
}
if($database->CheckLastPost($arr['id'])){
$post_date = date('m/d/y, H:i a',$pos['date']);
$owner_topic = $database->getUserArray($pos['owner'],1);
}else{
$post_date = date('m/d/y, H:i a',$arr['date']);
$owner_topic = $database->getUserArray($arr['owner'],1);
}
echo '<tr><td class="ico">';
if($database->CheckEditRes($aid)=="1"){
if($database->CheckCloseTopic($arr['id']) == 1){
$lock = '<a class="unlock" href="?s=2&fid='.$_GET['fid'].'&idt='.$arr['id'].'&admin=unlock" title="open topic"><img src="img/x.gif" alt="open topic" /></a>';
}else{
$lock = '<a class="lock" href="?s=2&fid='.$_GET['fid'].'&idt='.$arr['id'].'&admin=lock" title="close topic"><img src="img/x.gif" alt="close topic" /></a>';
}
echo ''.$lock.'<a class="edit" href="?s=2&idf='.$_GET['fid'].'&idt='.$arr['id'].'&admin=edittopic" title="edit"><img src="img/x.gif" alt="edit" /></a><br /><a class="pin" href="?s=2&fid='.$_GET['fid'].'&idt='.$arr['id'].'&admin=pin" title="stick topic"><img src="img/x.gif" alt="stick topic" /></a><a class="fdel" href="?s=2&fid='.$_GET['fid'].'&idt='.$arr['id'].'&admin=deltopic" title="delete"><img src="img/x.gif" alt="delete" onClick="return confirm(\'confirm delete?\');" /></a>';
}elseif($arr['close']=="1"){
echo '<img class="folder_lock" src="img/x.gif" alt="Closed Thread without new posts" title="Closed Thread without new posts" />';
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td>
<td class="tit"><a href="allianz.php?s=2&fid2='.$arr['cat'].'&pid='.$aid.'&tid='.$arr['id'].'">'.stripslashes($arr['title']).'</a><br></td>
<td class="cou">'.$CountPost.'</td>
<td class="last">'.$post_date.'<br /><a href="spieler.php?uid='.$arr['owner'].'">'.$owner_topic['username'].'</a> <a href="allianz.php?s=2&aid='.$aid.'&tid='.$arr['id'].'&seite=max"><img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></a>
</td></tr>';
}
}else{
echo '<tr>
<td class="none" colspan="4">No topic yet</td>
</tr>';
}
?>
</tbody></table><p>
<a href="allianz.php?s=2&pid=<?php echo $aid; ?>&fid=<?php echo $cat_id; ?>&ac=newtopic"><img id="fbtn_post" class="dynamic_img" src="img/x.gif" alt="Post new thread" /></a>
<?php
$opt = $database->getAlliPermissions($session->uid, $aid);
if($opt[opt5] == 1){
echo '<a href="allianz.php?s=2&fid='.$cat_id.'&seite=1&admin=switch_admin" title="Toggle Admin mode"><img class="switch_admin dynamic_img" src="img/x.gif" alt="Toggle Admin mode" /></a>';
}
?>
</p>
<?php }else{
header("Location: banned.php");
}
?>
File diff suppressed because one or more lines are too long
+121
View File
@@ -0,0 +1,121 @@
<?php
//////////////// made by TTMTT ////////////////
if($session->access!=BANNED){
$tid = $_GET['tid'];
$opt = $database->getAlliPermissions($session->uid, $aid);
$topics = $database->ShowTopic($tid);
$posts = $database->ShowPost($tid);
foreach($topics as $arr) {
$cat_id = $arr['cat'];
$owner = $database->getUserArray($arr['owner'],1);
$CatName = stripslashes($database->ForumCatName($cat_id));
$allianceinfo = $database->getAlliance($owner['alliance']);
}
$date = date('m/d/y H:i a',$arr['date']);
$varray = $database->getProfileVillages($arr['owner']);
$totalpop = 0;
foreach($varray as $vil) {
$totalpop += $vil['pop'];
}
$countAu = $database->CountTopic($arr['owner']);
$displayarray = $database->getUserArray($arr['owner'],1);
if($displayarray['tribe'] == 1) {
$trip = "Fire";
}else if($displayarray['tribe'] == 2) {
$trip = "Water";
}else if($displayarray['tribe'] == 3) {
$trip = "Earth";
}else if($displayarray['tribe'] == 4) {
$trip = "Air";
}else if($displayarray['tribe'] == 5) {
$trip = "Lightning";
}
$input = $arr['post'];
$alliance = $arr['alliance0'];
$player = $arr['player0'];
$coor = $arr['coor0'];
$report = $arr['report0'];
$bbcoded = $input;
include("GameEngine/BBCode.php");
$bbcode_topic = stripslashes(nl2br($bbcoded));
?>
<h4><a href="allianz.php?s=2&pid=<?php echo $arr['alliance']; ?>">Alliance</a> -> <a href="allianz.php?s=2&pid=<?php echo $arr['alliance']; ?>&fid=<?php echo $arr['cat']; ?>"><?php echo $CatName; ?></a></h4><table cellpadding="1" cellspacing="1" id="posts"><thead>
<tr>
<th colspan="2"><?php echo stripslashes($arr['title']); ?></th>
</tr><tr>
<td>Author</td>
<td>Message</td>
</tr></thead><tbody>
<tr><td class="pinfo"><a class="name" href="spieler.php?uid=<?php echo $arr['owner']; ?>"><?php echo $owner['username']; ?></a><br /><a href="allianz.php?aid=<?php echo $allianceinfo['id']; ?>"><?php echo $allianceinfo['tag']; ?></a><br />
Posts: <?php echo $countAu; ?><br />
<br />
Pop.: <?php echo $totalpop; ?><br />
Villages: <?php echo count($varray);?><br />
<?php echo $trip; ?>
</td>
<td class="pcontent"><div class="posted">created: <?php echo $date; ?></div>
<?php
if($database->CheckEditRes($aid)=="1"){
echo '<div class="admin"><a class="edit" href="allianz.php?s=2&pid='.$arr['alliance'].'&idf='.$arr['cat'].'&idt='.$arr['id'].'&admin=editans"><img src="img/x.gif" title="edit" alt="edit" /></a><a class="fdel" href="?s=2&pid='.$arr['alliance'].'&tid='.$arr['id'].'&admin=deltopic" onClick="return confirm(\'confirm delete?\');"><img src="img/x.gif" title="delete" alt="delete" /></a></div><br />';
}
?>
<div class="clear dotted"></div><div class="text"><?php echo $bbcode_topic; ?></div></td>
</tr>
<?php
foreach($posts as $po) {
$date = date('m/d/y H:i a',$po['date']);
$countAu = $database->CountTopic($po['owner']);
$varray = $database->getProfileVillages($po['owner']);
$totalpop = 0;
foreach($varray as $vil) {
$totalpop += $vil['pop'];
}
$displayarray = $database->getUserArray($po['owner'],1);
if($displayarray['tribe'] == 1) {
$trip = "Roman";
}else if($displayarray['tribe'] == 2) {
$trip = "Teutons";
}else if($displayarray['tribe'] == 3) {
$trip = "Gauls";
}
$owner = $database->getUserArray($po['owner'],1);
$allianceinfo = $database->getAlliance($owner['alliance']);
$input = $po['post'];
$alliance = $po['alliance0'];
$player = $po['player0'];
$coor = $po['coor0'];
$report = $po['report0'];
include("GameEngine/BBCode.php");
$bbcode_post = stripslashes(nl2br($bbcoded));
echo '<tr><td class="pinfo"><a class="name" href="spieler.php?uid='.$po['owner'].'">'.$owner['username'].'</a><br /><a href="allianz.php?aid='.$allianceinfo['id'].'">'.$allianceinfo['tag'].'</a><br />
Posts: '.$countAu.'<br />
<br />
Inhbs.: '.$totalpop.'<br />
Villages: '.count($varray).'<br />
'.$trip.'
</td>
<td class="pcontent"><div class="posted">created: '.$date.'</div>';
if($database->CheckEditRes($aid)=="1"){
echo '<div class="admin"><a class="edit" href="allianz.php?s=2&pid='.$arr['alliance'].'&idt='.$_GET['tid'].'&pod='.$po['id'].'&admin=editpost"><img src="img/x.gif" title="edit" alt="edit" /></a><a class="fdel" href="?s=2&pid='.$arr['alliance'].'&pod='.$po['id'].'&tid='.$_GET['tid'].'&admin=delpost" onClick="return confirm(\'confirm delete?\');"><img src="img/x.gif" title="delete" alt="delete" /></a></div><br />';
}
echo '<div class="clear dotted"></div><div class="text">'.$bbcode_post.'</div></td>
</tr>';
}
?>
</tbody></table><div style="margin-top: 15px;">
<?php
if(empty($arr[close])){
echo '<a href="allianz.php?s=2&fid2='.$arr['cat'].'&pid='.$arr['alliance'].'&tid='.$arr['id'].'&ac=newpost"><img id="fbtn_reply" class="dynamic_img"src="img/x.gif" alt="Replies" /></a>';
}
if($opt[opt5] == 1){
echo '<a href="allianz.php?s=2&pid='.$aid.'&tid='.$arr['id'].'&admin=switch_admin" title="Toggle Admin mode"><img class="switch_admin dynamic_img" src="img/x.gif" alt="Toggle Admin mode" /></a>';
}
echo '</div>';
}else{
header("Location: banned.php");
}
?>
File diff suppressed because one or more lines are too long
+110
View File
@@ -0,0 +1,110 @@
<?php
//////////////// made by TTMTT ////////////////
if($session->access!=BANNED){
$forum_data = $database->ForumCatEdit($_GET['idf']);
foreach($forum_data as $cats) {
$cat_name = stripslashes($cats['forum_name']);
$cat_des = stripslashes($cats['forum_des']);
}
?>
<script language="JavaScript" type="text/javascript">
function addRow(element_id) {
// element_id: user_list, ally_list
liste = document.getElementById(element_id);
liste = liste.getElementsByTagName('tbody')[0];
var anzahl_trs = liste.getElementsByTagName('tr').length;
var num_fields = anzahl_trs;
var num_last_tr = anzahl_trs -1;
lastTR = liste.getElementsByTagName('tr')[num_last_tr];
lastTD = lastTR.getElementsByTagName('td')[2];
lastIMG = lastTD.getElementsByTagName('img')[0];
lastTD.removeChild(lastIMG);
newTR = document.createElement('tr');
newTD1 = document.createElement('td');
newTD2 = document.createElement('td');
newTD3 = document.createElement('td');
newTR.appendChild(newTD1);
newTR.appendChild(newTD2);
newTR.appendChild(newTD3);
liste.appendChild(newTR);
var html_input_1 = '<input class="text" type="text" ';
if(element_id == 'ally_list') {
newTD1.className = 'ally';
newTD2.className = 'tag';
newTD3.className = 'ad';
newTD1.innerHTML = html_input_1 + 'id="allys_by_id_'+num_fields+'" class="text" maxlength="8" name="allys_by_id['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'allys\')">';
newTD2.innerHTML = html_input_1 + 'id="allys_by_name_'+num_fields+'" class="text" maxlength="8" name="allys_by_name['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'allys\')">';
}
if(element_id == 'user_list') {
newTD1.className = 'id';
newTD2.className = 'pla';
newTD3.className = 'ad';
newTD1.innerHTML = html_input_1 + 'id="users_by_id_'+num_fields+'" class="text" maxlength="8" name="users_by_id['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'users\')">';
newTD2.innerHTML = html_input_1 + 'id="users_by_name_'+num_fields+'" class="text" maxlength="15" name="users_by_name['+num_fields+']" onkeyup="checkInputs('+num_fields+',\'users\')">';
}
newTD3.innerHTML = '<img class="add" src="img/x.gif" title="add" alt="add" onclick="addRow(\''+element_id+'\')">';
}
</script>
<script language="JavaScript" type="text/javascript">
function checkInputs(id, typ) {
id_field = document.getElementById(typ+'_by_id_'+id);
name_field = document.getElementById(typ+'_by_name_'+id);
//alert(id_field.value);
//alert(name_field.value);
if (id_field.value != '' && id_field.disabled == false) {
name_field.disabled = true;
name_field.style.border = '1px solid #999';
}
else {
name_field.disabled = false;
name_field.style.border = '1px solid #71D000';
}
if (name_field.value != '' && name_field.disabled == false) {
id_field.disabled = true;
id_field.style.border = '1px solid #999';
}
else {
id_field.disabled = false;
id_field.style.border = '1px solid #71D000';
}
}
</script><form method="post" action="allianz.php?s=2">
<input type="hidden" name="s" value="2">
<input type="hidden" name="fid" value="<?php echo $_GET['idf']; ?>">
<input type="hidden" name="editforum" value="1">
<table cellpadding="1" cellspacing="1" id="edit_forum"><thead>
<tr>
<th colspan="2">edit forum</th>
</tr>
</thead><tbody>
<tr>
<th>Forum name</th>
<td><input class="text" type="text" name="u1" value="<?php echo $cat_name; ?>" maxlength="30"></td>
</tr>
<tr>
<th>Description</th>
<td><input class="text" type="text" name="u2" value="<?php echo $cat_des; ?>" maxlength="38"></td>
</tr>
</table><p class="btn"><input type="image" value="ok" name="s1" id="fbtn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p>
<?php }else{
header("Location: banned.php");
}
?>
File diff suppressed because one or more lines are too long
+23
View File
@@ -0,0 +1,23 @@
<?php if($session->alliance == $aid) {
?>
<div id="textmenu">
<a href="allianz.php" <?php if(!isset($_GET['s'])) { echo "class=\"selected\""; } ?>>Overview</a>
| <a href="allianz.php?s=2" <?php if(isset($_GET['s']) && $_GET['s'] == 2) { echo "class=\"selected\""; } ?>>Forum</a>
| <a href="allianz.php?s=6" <?php if(isset($_GET['s']) && $_GET['s'] == 6) { echo "class=\"selected\""; } ?>>Chat</a>
| <a href="allianz.php?s=3" <?php if(isset($_GET['s']) && $_GET['s'] == 3) { echo "class=\"selected\""; } ?>>Attacks</a>
| <a href="allianz.php?s=4" <?php if(isset($_GET['s']) && $_GET['s'] == 4) { echo "class=\"selected\""; } ?>>News</a>
<?php
if($session->sit == 0){
?>
| <a href="allianz.php?s=5" <?php if(isset($_GET['s']) && $_GET['s'] == 5) { echo "class=\"selected\""; } ?>>Options</a>
<?php
}else{
?>
| <span class=none><b>Options</b></span>
<?php
}
?>
</div>
<?php
}
?>
+57
View File
@@ -0,0 +1,57 @@
<?php
if(!is_numeric($_SESSION['search'])) {
?>
<center><font color=orange size=2><p class=\"error\">The alliance <b>"<?php echo $_SESSION['search']; ?>"</b> does not exist.</p></font></center>
<?php
$search = $session->alliance;
}
else {
$search = $_SESSION['search'];
}
?>
<table cellpadding="1" cellspacing="1" id="alliance" class="row_table_data">
<thead>
<tr>
<th colspan="5">
The largest alliances <div id="submenu"><a title="Top 10" href="statistiken.php?id=43"><img class="btn_top10" src="img/x.gif" alt="Top 10"></a><a title="defender" href="statistiken.php?id=42"><img class="btn_def" src="img/x.gif" alt="defender"></a><a title="attacker" href="statistiken.php?id=41"><img class="btn_off" src="img/x.gif" alt="attacker"></a></div>
</th>
</tr>
<tr><td></td><td>Alliance</td><td>Player</td><td>&Oslash;</td><td>Points</td></tr>
</thead><tbody>
<?php
if(isset($_GET['rank'])){
$multiplier = 1;
if(is_numeric($_GET['rank'])) {
if($_GET['rank'] > count($ranking->getRank())) {
$_GET['rank'] = count($ranking->getRank())-1;
}
while($_GET['rank'] > (20*$multiplier)) {
$multiplier +=1;
}
$start = 20*$multiplier-19;
} else { $start = ($_SESSION['start']+1); }
} else { $start = ($_SESSION['start']+1); }
if(count($ranking->getRank()) > 0) {
$ranking = $ranking->getRank();
for($i=$start;$i<($start+20);$i++) {
if(isset($ranking[$i]['name']) && $ranking[$i] != "pad") {
if($i == $search) {
echo "<tr class=\"hl\"><td class=\"ra fc\" >";
}
else {
echo "<tr><td class=\"ra \" >";
}
echo $i.".</td><td class=\"al \" ><a href=\"allianz.php?aid=".$ranking[$i]['id']."\">".$ranking[$i]['tag']."</a></td><td class=\"pla \" >";
echo $ranking[$i]['players']."</td><td class=\"av \" >".$ranking[$i]['avg']."</td><td class=\"po \">".$ranking[$i]['totalpop']."</td></tr>";
}
}
}
else {
echo "<td class=\"none\" colspan=\"5\">No alliance's found</td>";
}
?>
</tbody>
</table>
<?php
include("ranksearch.tpl");
?>
+136
View File
@@ -0,0 +1,136 @@
<?php
if(isset($aid)) {
$aid = $aid;
}
else {
$aid = $session->alliance;
}
$varmedal = $database->getProfileMedalAlly($aid);
$allianceinfo = $database->getAlliance($aid);
$memberlist = $database->getAllMember($aid);
$totalpop = 0;
foreach($memberlist as $member) {
$totalpop += $database->getVSumField($member['id'],"pop");
}
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
?>
<table cellpadding="1" cellspacing="1" id="edit"><thead>
<form method="post" action="allianz.php">
<input type="hidden" name="a" value="3">
<input type="hidden" name="o" value="3">
<input type="hidden" name="s" value="5">
<tr>
<th colspan="3">Alliance</th>
</tr><tr>
<td colspan="2">Details</td>
<td>Description</td>
</tr></thead>
<tbody>
<tr><td colspan="2"></td><td class="empty"></td></tr>
<tr>
<th>Tag</td><td class="s7"><?php echo $allianceinfo['tag']; ?></th>
<td rowspan="8" class="desc1"><textarea tabindex="1" name="be1"><?php echo stripslashes($allianceinfo['desc']); ?></textarea></td>
</tr>
<tr>
<th>Name</th><td><?php echo $allianceinfo['name']; ?></td>
</tr>
<tr><td colspan="2" class="empty"></td></tr>
<tr>
<th>Rank</th><td><?php echo $ranking->getAllianceRank($aid); ?>.</td>
</tr>
<tr>
<th>Points</th><td><?php echo $totalpop; ?></td>
</tr>
<tr>
<th>Members</th><td><?php echo count($memberlist); ?></td>
</tr>
<tr><td colspan="2" class="empty"></td></tr>
<tr><td colspan="2" class="desc2"><textarea tabindex="2" name="be2"><?php echo stripslashes($allianceinfo['notice']); ?></textarea></td></tr>
<p>
<table cellspacing="1" cellpadding="2" class="tbg">
<tr><td class="rbg" colspan="4">Medals</td></tr>
<tr>
<td>Category</td>
<td>Rang</td>
<td>Week</td>
<td>BB-Code</td>
</tr>
<?php
/******************************
INDELING CATEGORIEEN:
===============================
== 1. Aanvallers top 10 ==
== 2. Defence top 10 ==
== 3. Klimmers top 10 ==
== 4. Overvallers top 10 ==
== 5. In att en def tegelijk ==
== 6. in top 3 - aanval ==
== 7. in top 3 - verdediging ==
== 8. in top 3 - klimmers ==
== 9. in top 3 - overval ==
******************************/
foreach($varmedal as $medal) {
$titel="Bonus";
switch ($medal['categorie']) {
case "1":
$titel="Attacker of the Week";
break;
case "2":
$titel="Defender of the Week";
break;
case "3":
$titel="Climber of the week";
break;
case "4":
$titel="Robber of the week";
break;
case "5":
$titel="Top 10 of both attacckers and defenders";
break;
case "6":
$titel="Top 3 of Attackers of week ".$medal['points']." in a row";
break;
case "7":
$titel="Top 3 of Defenders of week ".$medal['points']." in a row";
break;
case "8":
$titel="Top 3 of Pop climbers of week ".$medal['points']." in a row";
break;
case "9":
$titel="Top 3 of Robbers of week ".$medal['points']." in a row";
break;
case "10":
$titel="Rank Climber of the week";
break;
case "11":
$titel="Top 3 of Rank climbers of week ".$medal['points']." in a row";
break;
case "12":
$titel="Top 10 of Rank Attackers of week ".$medal['points']." in a row";
break;
}
echo"<tr>
<td> ".$titel."</td>
<td>".$medal['plaats']."</td>
<td>".$medal['week']."</td>
<td>[#".$medal['id']."]</td>
</tr>";
} ?>
</table></p>
</table>
<p class="btn"><input tabindex="3" type="image" value="" name="s1" id="btn_save" class="dynamic_img" src="img/x.gif" alt="save" /></p></form>
+51
View File
@@ -0,0 +1,51 @@
<?php
if(isset($aid)) {
$aid = $aid;
}
else {
$aid = $session->alliance;
}
$allianceinfo = $database->getAlliance($aid);
$memberlist = $database->getAllMember($aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
if($session->access!=BANNED){
?>
<form method="post" action="allianz.php">
<table cellpadding="1" cellspacing="1" id="position" class="small_option">
<thead>
<tr>
<th colspan="2">Assign to position</th>
</tr>
</thead>
<tbody>
<tr>
<th colspan="2">Here you can grant the players from your alliance rights & positions.</th>
</tr>
<tr>
<th>Name</th>
<td>
<select name="a_user" class="name dropdown">
<?php
foreach($memberlist as $member) {
echo "<option value=".$member['id'].">".$member['username']."</option>";
}
?>
</select>
</td>
</tr>
</tbody>
</table>
<p>
<input type="hidden" name="o" value="1">
<input type="hidden" name="s" value="5">
<input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" />
</p>
</form>
<p class="error"></p>
<?php
}else{
header("Location: banned.php");
}
?>
+75
View File
@@ -0,0 +1,75 @@
<?php
$prefix = "".TB_PREFIX."ndata";
$limit = "ntype!=0 AND ntype!=4 AND ntype!=5 AND ntype!=6 AND ntype!=7 AND ntype!=8 AND ntype!=9 AND ntype!=10 AND ntype!=11 AND ntype!=12 AND ntype!=13 AND ntype!=14 AND ntype!=15 AND ntype!=16 AND ntype!=17 AND ntype!=20 AND ntype!=21";
$sql = mysql_query("SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
$query = mysql_num_rows($sql);
$outputList = '';
$name = 1;
if($query == 0) {
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
}else{
while($row = mysql_fetch_array($sql)){
$dataarray = explode(",",$row['data']);
$id = $row["id"];
$uid = $row["uid"];
$ally = $row["ally"];
$topic = $row["topic"];
$ntype = $row["ntype"];
$data = $row["data"];
$time = $row["time"];
$viewed = $row["viewed"];
$archive = $row["archive"];
$outputList .= "<tr>";
$outputList .= "<td class=\"sub\">";
if($ntype==4 || $ntype==5 || $ntype==6 || $ntype==7){
$type2 = '32';
}else{
$type2 = '31';
}
$outputList .= "<a href=\"allianz.php?s=3&f=".$type2."\">";
$type = (isset($_GET['t']) && $_GET['t'] == 5)? $archive : $ntype;
if($type==18 or $type==19){
$outputList .= "<img src=\"gpack/travian_default/img/scouts/$type.gif\" title=\"".$topic."\" />";
}else{
$outputList .= "<img src=\"img/x.gif\" class=\"iReport iReport$type\" title=\"".$topic."\">";
}
$outputList .= "</a>";
$outputList .= "<div><a href=\"berichte.php?id=".$id."&aid=".$ally."\">";
if($ntype==0){ $nn = " scouts "; }else{ $nn = " attacks "; }
$outputList .= $database->getUserField($dataarray[0],username,0);
$outputList .= $nn;
$outputList .= $database->getUserField($dataarray[28],username,0);
$getUserAlly = $database->getUserField($dataarray[28],alliance,0);
$getAllyName = $database->getAllianceName($getUserAlly);
if($getUserAlly==$session->alliance || !$getUserAlly){
$allyName = "-";
}else{
$allyName = "<a href=\"allianz.php?aid=".$getUserAlly."\">".$getAllyName."</a>";
}
$outputList .= "<td class=\"al\">".$allyName."</td>";
$date = $generator->procMtime($time);
$outputList .= "<td class=\"dat\">".$date[0]." ".date('H:i',$time)."</td>";
$outputList .= "</tr>";
$name++;
}
}
?>
<table cellpadding="1" cellspacing="1" id="offs">
<thead>
<tr>
<td>Player</td>
<td>Alliance</td>
<td>Date</td>
</tr>
</thead>
<tbody>
<?php echo $outputList; ?>
</tbody>
</table>
+76
View File
@@ -0,0 +1,76 @@
<?php
$prefix = "".TB_PREFIX."ndata";
$limit = "ntype!=1 AND ntype!=2 AND ntype!=3 AND ntype!=8 AND ntype!=9 AND ntype!=10 AND ntype!=11 AND ntype!=12 AND ntype!=13 AND ntype!=14 AND ntype!=15 AND ntype!=16 AND ntype!=17 AND ntype!=18 AND ntype!=19";
$sql = mysql_query("SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
$query = mysql_num_rows($sql);
$outputList = '';
$name = 1;
if($query == 0) {
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
}else{
while($row = mysql_fetch_array($sql)){
$dataarray = explode(",",$row['data']);
$id = $row["id"];
$uid = $row["uid"];
$toWref = $row["toWref"];
$ally = $row["ally"];
$topic = $row["topic"];
$ntype = $row["ntype"];
$data = $row["data"];
$time = $row["time"];
$viewed = $row["viewed"];
$archive = $row["archive"];
$outputList .= "<tr>";
$outputList .= "<td class=\"sub\">";
if($ntype==4 || $ntype==5 || $ntype==6 || $ntype==7){
$type2 = '32';
}else{
$type2 = '31';
}
$outputList .= "<a href=\"allianz.php?s=3&f=".$type2."\">";
$type = (isset($_GET['t']) && $_GET['t'] == 5)? $archive : $ntype;
if($type==20 or $type==21){
$outputList .= "<img src=\"gpack/travian_default/img/scouts/$type.gif\" title=\"".$topic."\" />";
}else{
$outputList .= "<img src=\"img/x.gif\" class=\"iReport iReport$type\" title=\"".$topic."\">";
}
$outputList .= "</a>";
$outputList .= "<div><a href=\"berichte.php?id=".$id."&aid=".$ally."\">";
if($ntype==0){ $nn = " scouts "; }else{ $nn = " attacks "; }
$outputList .= $database->getUserField($dataarray[0],username,0);
$outputList .= $nn;
$outputList .= $database->getUserField($dataarray[28],username,0);
$getUserAlly = $database->getUserField($dataarray[0],alliance,0);
$getAllyName = $database->getAllianceName($getUserAlly);
if($getUserAlly==$session->alliance || !$getUserAlly){
$allyName = "-";
}else{
$allyName = "<a href=\"allianz.php?aid=".$getUserAlly."\">".$getAllyName."</a>";
}
$outputList .= "<td class=\"al\">".$allyName."</td>";
$date = $generator->procMtime($time);
$outputList .= "<td class=\"dat\">".$date[0]." ".date('H:i',$time)."</td>";
$outputList .= "</tr>";
$name++;
}
}
?>
<table cellpadding="1" cellspacing="1" id="offs">
<thead>
<tr>
<td>Player</td>
<td>Alliance</td>
<td>Date</td>
</tr>
</thead>
<tbody>
<?php echo $outputList; ?>
</tbody>
</table>
+124
View File
@@ -0,0 +1,124 @@
<?php
if(isset($aid)) {
$aid = $aid;
}
else {
$aid = $session->alliance;
}
$allianceinfo = $database->getAlliance($aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
?>
<div class="clear"></div>
<h4 class="chartHeadline">Military events</h4>
<div id="submenu">
<a href="allianz.php?s=3&f=32">
<img src="img/x.gif" class="btn_def" alt="Defender" title="Defender" />
</a>
<a href="allianz.php?s=3&f=31">
<img src="img/x.gif" class="btn_off" alt="Attacker" title="Attacker" />
</a>
</div>
<?php
if($_GET['f']==31){
include "Templates/Alliance/attack-attacker.tpl";
}elseif($_GET['f']==32){
include "Templates/Alliance/attack-defender.tpl";
}else{
$prefix = "".TB_PREFIX."ndata";
$limit = "ntype!=8 AND ntype!=9 AND ntype!=10 AND ntype!=11 AND ntype!=12 AND ntype!=13 AND ntype!=14 AND ntype!=15 AND ntype!=16 AND ntype!=17";
$sql = mysql_query("SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
$query = mysql_num_rows($sql);
$outputList = '';
$name = 1;
if($query == 0) {
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
}else{
while($row = mysql_fetch_array($sql)){
$dataarray = explode(",",$row['data']);
$id = $row["id"];
$uid = $row["uid"];
$toWref = $row["toWref"];
$ally = $row["ally"];
$topic = $row["topic"];
$ntype = $row["ntype"];
$data = $row["data"];
$time = $row["time"];
$viewed = $row["viewed"];
$archive = $row["archive"];
$outputList .= "<tr>";
$outputList .= "<td class=\"sub\">";
if($ntype==4 || $ntype==5 || $ntype==6 || $ntype==7){
$type2 = '32';
}else{
$type2 = '31';
}
$outputList .= "<a href=\"allianz.php?s=3&f=".$type2."\">";
$type = (isset($_GET['t']) && $_GET['t'] == 5)? $archive : $ntype;
if($type==18 or $type==19 or $type==20 or $type==21){
$outputList .= "<img src=\"gpack/travian_default/img/scouts/$type.gif\" title=\"".$topic."\" />";
}else{
$outputList .= "<img src=\"img/x.gif\" class=\"iReport iReport$type\" title=\"".$topic."\">";
}
$outputList .= "</a>";
$outputList .= "<div><a href=\"berichte.php?id=".$id."&aid=".$ally."\">";
if($ntype==0){ $nn = " scouts "; }else{ $nn = " attacks "; }
$outputList .= $database->getUserField($dataarray[0],username,0);
$outputList .= $nn;
$outputList .= $database->getUserField($dataarray[28],username,0);
if($ntype==0){
$isoasis = $database->isVillageOases($toWref);
if($isoasis == 0){
if($toWref != $village->wid){
$getUser = $database->getVillageField($toWref,owner);
}else{
$getUser = $database->getVillageField($dataarray[1],owner);
}
}else{
if($toWref != $village->wid){
$getUser = $database->getOasisField($toWref,owner);
}else{
$getUser = $database->getOasisField($dataarray[1],owner);
}
}
$getUserAlly = $database->getUserField($getUser,alliance,0);
}else if($ntype==1 or $ntype==2 or $ntype==3 or $ntype==18 or $ntype==19){
$getUserAlly = $database->getUserField($dataarray[28],alliance,0);
}else{
$getUserAlly = $database->getUserField($dataarray[0],alliance,0);
}
$getAllyName = $database->getAllianceName($getUserAlly);
if($getUserAlly==$session->alliance || !$getUserAlly){
$allyName = "-";
}else{
$allyName = "<a href=\"allianz.php?aid=".$getUserAlly."\">".$getAllyName."</a>";
}
$outputList .= "<td class=\"al\">".$allyName."</td>";
$date = $generator->procMtime($time);
$outputList .= "<td class=\"dat\">".$date[0]." ".date('H:i',$time)."</td>";
$outputList .= "</tr>";
$name++;
}
}
?>
<table cellpadding="1" cellspacing="1" id="offs">
<thead>
<tr>
<td>Player</td>
<td>Alliance</td>
<td>Date</td>
</tr>
</thead>
<tbody>
<?php echo $outputList; ?>
</tbody>
</table>
<?php } ?>
+38
View File
@@ -0,0 +1,38 @@
<?php
if(isset($aid)) {
$aid = $aid;
}
else {
$aid = $session->alliance;
}
$allianceinfo = $database->getAlliance($aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
?>
<table cellpadding="1" cellspacing="1" cellpadding="1" cellspacing="1" id="name" class="small_option"><thead>
<form method="post" action="allianz.php">
<input type="hidden" name="a" value="100">
<input type="hidden" name="o" value="100">
<input type="hidden" name="s" value="5">
<tr>
<th colspan="2">Change name</th>
</tr></thead>
<tbody><tr>
<th>Tag</th>
<td><input class="tag text" name="ally1" value="<?php echo $allianceinfo['tag']; ?>" maxlength="15">
<span class="error2"></span></td>
</tr>
<tr>
<th>Name</th>
<td><input class="name text" name="ally2" value="<?php echo $allianceinfo['name']; ?>" maxlength="50">
<span class="error2"></span></td>
</tr></tbody></table>
<p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p>
<p class="error3"><?php echo $form->getError("ally1"); ?></p>
<p class="error3"><?php echo $form->getError("ally2"); ?></p>
<p class="error3"><?php echo $form->getError("owner"); ?></p>
<p class="error3"><?php echo $form->getError("tag"); ?></p>
<p class="error3"><?php echo $form->getError("name"); ?></p>
+89
View File
@@ -0,0 +1,89 @@
<?php
if(isset($aid)) {
$aid = $aid;
}
else {
$aid = $session->alliance;
}
$playerData = $database->getAlliPermissions($_POST['a_user'], $session->alliance);
$playername = $database->getUserField($_POST['a_user'],'username',0);
$allianceinfo = $database->getAlliance($aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
?>
<form method="post" action="allianz.php">
<table cellpadding="1" cellspacing="1" id="position" class="small_option">
<thead>
<tr>
<th colspan="2">Assign to position</th>
</tr>
</thead>
<tbody>
<tr>
<th>Name:</th>
<td> <?php echo $playername; ?> </td>
</tr>
<tr>
<th>Position:</th>
<td><input class="name text" type="text" name="a_titel" value="<?php echo $playerData[rank]; ?>" maxlength="20" /></td>
</tr>
</tbody>
</table>
<table cellpadding="1" cellspacing="1" id="rights" class="small_option">
<thead>
<tr>
<th colspan="2">Assign rights</th>
</tr>
</thead>
<tbody>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e1" value="1" <?php if ($playerData[opt1]) { echo "checked=checked"; } ?> ></td>
<td>Assign to position</td>
</tr>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e2" value="1" <?php if ($playerData[opt2]) { echo "checked=checked"; } ?> ></td>
<td>Kick player</td>
</tr>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e3" value="1" <?php if ($playerData[opt3]) { echo "checked=checked"; } ?> ></td>
<td>Change alliance description</td>
</tr>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e6" value="1"<?php if ($playerData[opt6]) { echo "checked=checked"; } ?> ></td>
<td>Alliance diplomacy</td>
</tr>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e7" value="1" <?php if ($playerData[opt7]) { echo "checked=checked"; } ?> ></td>
<td>IGMs to every alliance member</td>
</tr>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e4" value="1" <?php if ($playerData[opt4]) { echo "checked=checked"; } ?> ></td>
<td>Invite a player into the alliance</td>
</tr>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e5" value="1" <?php if ($playerData[opt5]) { echo "checked=checked"; } ?> ></td>
<td>Manage forums</td>
</tr>
</tbody>
</table>
<p>
<input type="hidden" name="a" value="1">
<input type="hidden" name="o" value="1">
<input type="hidden" name="s" value="5">
<input type="hidden" name="a_user" value="<?php echo $_POST['a_user']; ?>">
<input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" />
</p>
</form>
+57
View File
@@ -0,0 +1,57 @@
<?php
////////////// made by TTMTT //////////////
if(isset($aid)) {
$aid = $aid;
}
else {
$aid = $session->alliance;
}
$allianceinfo = $database->getAlliance($aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
?>
<script type="text/javascript">
<?php sajax_show_javascript();?>
function show_data_cb(text) { document.getElementById("masnun").innerHTML = text; }
function start_it() { x_get_data(show_data_cb); setTimeout("start_it()",1000); }
function add_cb() {}
function send_data() {
//alert( document.form1.msg.value);
msg = document.form1.msg.value;
//alert(msg);
//x_add_data(name +"|"+msg,add_cb);
x_add_data(msg,add_cb);
document.form1.msg.value="";
}
</script>
<body onload="start_it()">
<form name="form1" onSubmit="send_data()">
<div id="TitleName" class="chatHeader">Ally-Chat</div>
<div id="chatContainer" style="position:relative; top:0; right:0; height: 220px; width: 500px; overflow: hidden; background-color: #FFF; border: 1px solid #C0C0C0;">
<div id="masnun" style="position:absolute; top:0; right:5px; width:470px; background-color: #FFF; "></div>
<div id="scrollbarbackground2" style="position:absolute; top:0; right:481px; width:17px; height:198px;"></div>
<div id="scrollbarbackground" style="position:absolute; top:0; right:489px; width:1px; height:198px; border-width:1px; border-style:solid; border-color:#71D000; background-color: #FFF; "></div>
<div id="scrollbar" style="position:absolute; top:0; right:481px; width:17px; height:198px; border-width:1px; border-style:solid; border-color:#71D000; background-color: #F0FFF0; "></div>
<input id="scrollCheckbox" class="fm" checked="checked" type="checkbox" style="position:absolute; top:200px; right:481px; " />
</div>
<div style="margin-top:10px; margin-bottom:10px;">
<table cellpadding="1" cellspacing="1"><tr><td>
<input name="s" value="6" type="hidden" />
<input class="text" type="text" name="msg" style="width: 415px;" />
</td><td>
<input type="button" src="img/x.gif" id="btn_ok" style="border: 0px; float:left;" alt="ok" onClick="send_data()" />
</td></tr></table>
</div>
</form>
</body>
<div id="rooms">
</div>
+202
View File
@@ -0,0 +1,202 @@
<?php
/*
|--------------------------------------------------------------------------
| PLEASE DO NOT REMOVE THIS COPYRIGHT NOTICE!
|--------------------------------------------------------------------------
|
| Developed by: Dzoki < dzoki.travian@gmail.com >
|
| This script is property of TravianX Project. You are allowed to change
| its source and release it, but you have no rights to remove copyright
| notices.
|
| TravianX All rights reserved
|
*/
if(isset($aid)) {
$aid = $aid;
} else {
$aid = $session->alliance;
}
$allianceinfo = $database->getAlliance($aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
?>
<form method="post" action="allianz.php">
<input type="hidden" name="a" value="6"> <input type="hidden" name="o" value="6"> <input type="hidden" name="s" value="5">
<table cellpadding="1" cellspacing="1" id="diplomacy" class="dipl">
<thead>
<tr>
<th colspan="2">Alliance diplomacy</th>
</tr>
</thead>
<tbody>
<tr>
<th>Alliance</th>
<td><input class="ally text" type="text" name="a_name" maxlength="15"></td>
</tr>
<tr>
<td colspan="2" class="empty"></td>
</tr>
<tr>
<td colspan="2"><label><input class="radio" type="radio" name="dipl" value="1"> offer a confederation</label></td>
</tr>
<tr>
<td colspan="2"><label><input class="radio" type="radio" name="dipl" value="2"> offer non-aggression pact</label></td>
</tr>
<tr>
<td colspan="2"><label><input class="radio" type="radio" name="dipl" value="3"> declare war</label></td>
</tr>
</tbody>
</table>
<table cellpadding="1" cellspacing="1" id="hint" class="infos">
<thead>
<tr>
<th colspan="2">Hint</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2">It's part of diplomatic etiquette to talk to another alliance and negotiate before sending an offer for a non-aggression pact or a confederation.</td>
</tr>
</tbody>
</table>
<div id="box">
<p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK"></p>
<p class="error"></p>
</div>
</form>
<div class="clear"></div>
<table cellpadding="1" cellspacing="1" id="own" class="dipl">
<thead>
<tr>
<th colspan="3">Own offers</th>
</tr>
</thead>
<tbody>
<tr>
<?php
$alliance = $session->alliance;
if(count($database->diplomacyOwnOffers($alliance))){
foreach($database->diplomacyOwnOffers($alliance) as $key => $value){
if($value['type'] == 1){
$type = "Conf.";
} else if($value['type'] == 2){
$type = "Nap";
} else if($value['type'] == 3){
$type = "War";
}
echo '<tr><td width="18"><form method="post" action="allianz.php"><input type="hidden" name="o" value="101"><input type="hidden" name="id" value="'.$value['id'].'"><input type="image" class="cancel" src="img/x.gif" title="Cancel" /></form></td><td><a href="allianz.php?aid='.$value['alli2'].'"><center>'.$database->getAllianceName($value['alli2']).'</a></center></td><td width="80"><center>'.$type.'</center></td></tr>';
}
} else {
echo '<tr><td colspan="3" class="none">none</td></tr>';
}
?>
</tr>
</tbody>
</table>
<table cellpadding="1" cellspacing="1" id="tip" class="infos">
<thead>
<tr>
<th colspan="2">Tip</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2">If you want to see connections in the alliance description automatically, type <span class="e">[diplomatie]</span> into the description, <span class="e">[ally]</span>, <span class="e">[nap]</span> and <span class="e">[war]</span> are also possible.</td>
</tr>
</tbody>
</table>
<table cellpadding="1" cellspacing="1" id="foreign" class="dipl">
<thead>
<tr>
<th colspan="4">Foreign offers</th>
</tr>
</thead>
<tbody>
<?php
unset($type);
$alliance = $session->alliance;
if(count($database->diplomacyInviteCheck($alliance))){
foreach($database->diplomacyInviteCheck($alliance) as $key => $row){
if($row['type'] == 1){
$type = "Conf.";
} else if($row['type'] == 2){
$type = "Nap";
} else if($row['type'] == 3){
$type = "War";
}
echo '<tr><td width="18"><form method="post" action="allianz.php"><input type="hidden" name="o" value="102"><input type="hidden" name="id" value="'.$row['id'].'"><input type="hidden" name="alli1" value="'.$row['alli1'].'"><input type="image" class="cancel" src="img/x.gif" title="Cancel" /></td></form><form method="post" action="allianz.php"><td width="18"><input type="hidden" name="o" value="103"><input type="hidden" name="id" value="'.$row['id'].'"><input type="hidden" name="alli2" value="'.$row['alli2'].'"><input type="hidden" name="type" value="'.$row['type'].'"><input type="image" class="accept" src="img/x.gif" title="Accept" /></td></form><td><a href="allianz.php?aid='.$row['alli1'].'"><center>'.$database->getAllianceName($row['alli1']).'</a></center></td><td width="80"><center>'.$type.'</center></td></tr>';
}
} else {
echo '<tr><td colspan="3" class="none">none</td></tr>';
}
?>
</tbody>
</table>
<table cellpadding="1" cellspacing="1" id="existing" class="dipl">
<thead>
<tr>
<th colspan="3">Existing relationships</th>
</tr>
</thead>
<tbody>
<?php
unset($type);
unset($row);
$alliance = $session->alliance;
if(count($database->diplomacyExistingRelationships($alliance))){
foreach($database->diplomacyExistingRelationships($alliance) as $key => $row){
if($row['type'] == 1){
$type = "Conf.";
} else if($row['type'] == 2){
$type = "Nap";
} else if($row['type'] == 3){
$type = "War";
}
echo '<tr><td width="18"><form method="post" action="allianz.php"><input type="hidden" name="o" value="104"><input type="hidden" name="id" value="'.$row['id'].'"><input type="hidden" name="alli2" value="'.$row['alli2'].'"><input type="image" class="cancel" src="img/x.gif" title="Cancel" /></form></td><td><a href="allianz.php?aid='.$row['alli1'].'"><center>'.$database->getAllianceName($row['alli1']).'</a></center></td><td width="80"><center>'.$type.'</center></td></tr>';
}
} elseif(count($database->diplomacyExistingRelationships2($alliance))){
foreach($database->diplomacyExistingRelationships2($alliance) as $key => $row){
if($row['type'] == 1){
$type = "Conf.";
} else if($row['type'] == 2){
$type = "Nap";
} else if($row['type'] == 3){
$type = "War";
}
echo '<tr><td width="18"><form method="post" action="allianz.php"><input type="hidden" name="o" value="104"><input type="hidden" name="id" value="'.$row['id'].'"><input type="hidden" name="alli2" value="'.$row['alli1'].'"><input type="image" class="cancel" src="img/x.gif" title="Cancel" /></form></td><td><a href="allianz.php?aid='.$row['alli2'].'"><center>'.$database->getAllianceName($row['alli2']).'</a></center></td><td width="80"><center>'.$type.'</center></td></tr>';
}
}else {
echo '<tr><td colspan="3" class="none">none</td></tr>';
}
?>
</tbody>
</table>
+416
View File
@@ -0,0 +1,416 @@
<?php
//////////////// made by TTMTT ////////////////
if(isset($aid)) {
$aid = $aid;
}else if($_GET['fid']){
$aid = $database->ForumCatAlliance($_GET['fid']);
}else if($_GET['fid2']){
$aid = $database->ForumCatAlliance($_GET['fid2']);
}else{
$aid = $session->alliance;
}
$allianceinfo = $database->getAlliance($aid);
$opt = $database->getAlliPermissions($session->uid, $aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
$ids = $_GET['s'];
if(isset($_POST['new'])){
$forum_name = $_POST['u1'];
$forum_des = $_POST['u2'];
$forum_owner = $session->uid;
$forum_area = $_POST['bid'];
$database->CreatForum($forum_owner,$aid,$forum_name,$forum_des,$forum_area);
}
if(isset($_POST['edittopic'])){
$topic_name = $_POST['thema'];
$topic_cat = $_POST['fid'];
$topic_id = $_POST['tid'];
$database->UpdateEditTopic($topic_id,$topic_name,$topic_cat);
}
if(isset($_POST['editforum'])){
$forum_name = $_POST['u1'];
$$forum_name = htmlspecialchars($forum_name);
$forum_des = $_POST['u2'];
$forum_des = htmlspecialchars($forum_des);
$forum_id = $_POST['fid'];
$database->UpdateEditForum($forum_id,$forum_name,$forum_des);
}
if(isset($_POST['newtopic'])){
$title = $_POST['thema'];
$text = $_POST['text'];
$cat = $_POST['fid'];
$owner = $session->uid;
$alli = $_POST['pid'];
if(isset($_POST['umfrage_ende'])){
$ends = "";
}else{
$ends = '';
}
if($text != ""){
if(!preg_match('/\[message\]/',$text) && !preg_match('/\[\/message\]/',$text)){
$text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){
if(preg_match('/\[alliance'.$i.'\]/',$text) && preg_match('/\[\/alliance'.$i.'\]/',$text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/',$alliance1) && preg_match('/\[\/alliance'.$i.'\]/',$alliance1)){
$j = $i+1;
$alliance2 = preg_replace('/\[\/alliance'.$i.'\](.*?)\[\/message\]/is', '', $text);
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1);
$text = $alliance2."[/alliance".$i."]".$alliance1;
$alliance += 1;
}
}
}
for($i=0;$i<=$player;$i++){
if(preg_match('/\[player'.$i.'\]/',$text) && preg_match('/\[\/player'.$i.'\]/',$text)){
$player1 = preg_replace('/\[message\](.*?)\[\/player'.$i.'\]/is', '', $text);
if(preg_match('/\[player'.$i.'\]/',$player1) && preg_match('/\[\/player'.$i.'\]/',$player1)){
$j = $i+1;
$player2 = preg_replace('/\[\/player'.$i.'\](.*?)\[\/message\]/is', '', $text);
$player1 = preg_replace('/\[player'.$i.'\]/', '[player'.$j.']', $player1);
$player1 = preg_replace('/\[\/player'.$i.'\]/', '[/player'.$j.']', $player1);
$text = $player2."[/player".$i."]".$player1;
$player += 1;
}
}
}
for($i=0;$i<=$coor;$i++){
if(preg_match('/\[coor'.$i.'\]/',$text) && preg_match('/\[\/coor'.$i.'\]/',$text)){
$coor1 = preg_replace('/\[message\](.*?)\[\/coor'.$i.'\]/is', '', $text);
if(preg_match('/\[coor'.$i.'\]/',$coor1) && preg_match('/\[\/coor'.$i.'\]/',$coor1)){
$j = $i+1;
$coor2 = preg_replace('/\[\/coor'.$i.'\](.*?)\[\/message\]/is', '', $text);
$coor1 = preg_replace('/\[coor'.$i.'\]/', '[coor'.$j.']', $coor1);
$coor1 = preg_replace('/\[\/coor'.$i.'\]/', '[/coor'.$j.']', $coor1);
$text = $coor2."[/coor".$i."]".$coor1;
$coor += 1;
}
}
}
for($i=0;$i<=$report;$i++){
if(preg_match('/\[report'.$i.'\]/',$text) && preg_match('/\[\/report'.$i.'\]/',$text)){
$report1 = preg_replace('/\[message\](.*?)\[\/report'.$i.'\]/is', '', $text);
if(preg_match('/\[report'.$i.'\]/',$report1) && preg_match('/\[\/report'.$i.'\]/',$report1)){
$j = $i+1;
$report2 = preg_replace('/\[\/report'.$i.'\](.*?)\[\/message\]/is', '', $text);
$report1 = preg_replace('/\[report'.$i.'\]/', '[report'.$j.']', $report1);
$report1 = preg_replace('/\[\/report'.$i.'\]/', '[/report'.$j.']', $report1);
$text = $report2."[/report".$i."]".$report1;
$report += 1;
}
}
}
$database->CreatTopic($title,$text,$cat,$owner,$alli,$ends,$alliance,$player,$coor,$report);
}
}
}
if(isset($_POST['newpost'])){
$text = $_POST['text'];
$tids = $_POST['tid'];
$owner = $session->uid;
if($text != ""){
if(!preg_match('/\[message\]/',$text) && !preg_match('/\[\/message\]/',$text)){
$text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){
if(preg_match('/\[alliance'.$i.'\]/',$text) && preg_match('/\[\/alliance'.$i.'\]/',$text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/',$alliance1) && preg_match('/\[\/alliance'.$i.'\]/',$alliance1)){
$j = $i+1;
$alliance2 = preg_replace('/\[\/alliance'.$i.'\](.*?)\[\/message\]/is', '', $text);
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1);
$text = $alliance2."[/alliance".$i."]".$alliance1;
$alliance += 1;
}
}
}
for($i=0;$i<=$player;$i++){
if(preg_match('/\[player'.$i.'\]/',$text) && preg_match('/\[\/player'.$i.'\]/',$text)){
$player1 = preg_replace('/\[message\](.*?)\[\/player'.$i.'\]/is', '', $text);
if(preg_match('/\[player'.$i.'\]/',$player1) && preg_match('/\[\/player'.$i.'\]/',$player1)){
$j = $i+1;
$player2 = preg_replace('/\[\/player'.$i.'\](.*?)\[\/message\]/is', '', $text);
$player1 = preg_replace('/\[player'.$i.'\]/', '[player'.$j.']', $player1);
$player1 = preg_replace('/\[\/player'.$i.'\]/', '[/player'.$j.']', $player1);
$text = $player2."[/player".$i."]".$player1;
$player += 1;
}
}
}
for($i=0;$i<=$coor;$i++){
if(preg_match('/\[coor'.$i.'\]/',$text) && preg_match('/\[\/coor'.$i.'\]/',$text)){
$coor1 = preg_replace('/\[message\](.*?)\[\/coor'.$i.'\]/is', '', $text);
if(preg_match('/\[coor'.$i.'\]/',$coor1) && preg_match('/\[\/coor'.$i.'\]/',$coor1)){
$j = $i+1;
$coor2 = preg_replace('/\[\/coor'.$i.'\](.*?)\[\/message\]/is', '', $text);
$coor1 = preg_replace('/\[coor'.$i.'\]/', '[coor'.$j.']', $coor1);
$coor1 = preg_replace('/\[\/coor'.$i.'\]/', '[/coor'.$j.']', $coor1);
$text = $coor2."[/coor".$i."]".$coor1;
$coor += 1;
}
}
}
for($i=0;$i<=$report;$i++){
if(preg_match('/\[report'.$i.'\]/',$text) && preg_match('/\[\/report'.$i.'\]/',$text)){
$report1 = preg_replace('/\[message\](.*?)\[\/report'.$i.'\]/is', '', $text);
if(preg_match('/\[report'.$i.'\]/',$report1) && preg_match('/\[\/report'.$i.'\]/',$report1)){
$j = $i+1;
$report2 = preg_replace('/\[\/report'.$i.'\](.*?)\[\/message\]/is', '', $text);
$report1 = preg_replace('/\[report'.$i.'\]/', '[report'.$j.']', $report1);
$report1 = preg_replace('/\[\/report'.$i.'\]/', '[/report'.$j.']', $report1);
$text = $report2."[/report".$i."]".$report1;
$report += 1;
}
}
}
$database->UpdatePostDate($tids);
$database->CreatPost($text,$tids,$owner,$alliance,$player,$coor,$report);
}
}
}
if(isset($_POST['editans'])){
$text = $_POST['text'];
$text = preg_replace('/\[message\]/', '', $text);
$text = preg_replace('/\[\/message\]/', '', $text);
for($i=1;$i<=$_POST['alliance0'];$i++){
$text = preg_replace('/\[alliance'.$i.'\]/', '[alliance0]', $text);
$text = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance0]', $text);
}
for($i=0;$i<=$_POST['player0'];$i++){
$text = preg_replace('/\[player'.$i.'\]/', '[player0]', $text);
$text = preg_replace('/\[\/player'.$i.'\]/', '[/player0]', $text);
}
for($i=0;$i<=$_POST['coor0'];$i++){
$text = preg_replace('/\[coor'.$i.'\]/', '[coor0]', $text);
$text = preg_replace('/\[\/coor'.$i.'\]/', '[/coor0]', $text);
}
for($i=0;$i<=$_POST['report0'];$i++){
$text = preg_replace('/\[report'.$i.'\]/', '[report0]', $text);
$text = preg_replace('/\[\/report'.$i.'\]/', '[/report0]', $text);
}
$topic_id = $_POST['tid'];
if($text != ""){
if(!preg_match('/\[message\]/',$text) && !preg_match('/\[\/message\]/',$text)){
$text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){
if(preg_match('/\[alliance'.$i.'\]/',$text) && preg_match('/\[\/alliance'.$i.'\]/',$text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/',$alliance1) && preg_match('/\[\/alliance'.$i.'\]/',$alliance1)){
$j = $i+1;
$alliance2 = preg_replace('/\[\/alliance'.$i.'\](.*?)\[\/message\]/is', '', $text);
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1);
$text = $alliance2."[/alliance".$i."]".$alliance1;
$alliance += 1;
}
}
}
for($i=0;$i<=$player;$i++){
if(preg_match('/\[player'.$i.'\]/',$text) && preg_match('/\[\/player'.$i.'\]/',$text)){
$player1 = preg_replace('/\[message\](.*?)\[\/player'.$i.'\]/is', '', $text);
if(preg_match('/\[player'.$i.'\]/',$player1) && preg_match('/\[\/player'.$i.'\]/',$player1)){
$j = $i+1;
$player2 = preg_replace('/\[\/player'.$i.'\](.*?)\[\/message\]/is', '', $text);
$player1 = preg_replace('/\[player'.$i.'\]/', '[player'.$j.']', $player1);
$player1 = preg_replace('/\[\/player'.$i.'\]/', '[/player'.$j.']', $player1);
$text = $player2."[/player".$i."]".$player1;
$player += 1;
}
}
}
for($i=0;$i<=$coor;$i++){
if(preg_match('/\[coor'.$i.'\]/',$text) && preg_match('/\[\/coor'.$i.'\]/',$text)){
$coor1 = preg_replace('/\[message\](.*?)\[\/coor'.$i.'\]/is', '', $text);
if(preg_match('/\[coor'.$i.'\]/',$coor1) && preg_match('/\[\/coor'.$i.'\]/',$coor1)){
$j = $i+1;
$coor2 = preg_replace('/\[\/coor'.$i.'\](.*?)\[\/message\]/is', '', $text);
$coor1 = preg_replace('/\[coor'.$i.'\]/', '[coor'.$j.']', $coor1);
$coor1 = preg_replace('/\[\/coor'.$i.'\]/', '[/coor'.$j.']', $coor1);
$text = $coor2."[/coor".$i."]".$coor1;
$coor += 1;
}
}
}
for($i=0;$i<=$report;$i++){
if(preg_match('/\[report'.$i.'\]/',$text) && preg_match('/\[\/report'.$i.'\]/',$text)){
$report1 = preg_replace('/\[message\](.*?)\[\/report'.$i.'\]/is', '', $text);
if(preg_match('/\[report'.$i.'\]/',$report1) && preg_match('/\[\/report'.$i.'\]/',$report1)){
$j = $i+1;
$report2 = preg_replace('/\[\/report'.$i.'\](.*?)\[\/message\]/is', '', $text);
$report1 = preg_replace('/\[report'.$i.'\]/', '[report'.$j.']', $report1);
$report1 = preg_replace('/\[\/report'.$i.'\]/', '[/report'.$j.']', $report1);
$text = $report2."[/report".$i."]".$report1;
$report += 1;
}
}
}
$database->EditUpdateTopic($topic_id,$text,$alliance,$player,$coor,$report);
}
}
}
if(isset($_POST['editpost'])){
$text = $_POST['text'];
$text = preg_replace('/\[message\]/', '', $text);
$text = preg_replace('/\[\/message\]/', '', $text);
for($i=1;$i<=$_POST['alliance0'];$i++){
$text = preg_replace('/\[alliance'.$i.'\]/', '[alliance0]', $text);
$text = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance0]', $text);
}
for($i=0;$i<=$_POST['player0'];$i++){
$text = preg_replace('/\[player'.$i.'\]/', '[player0]', $text);
$text = preg_replace('/\[\/player'.$i.'\]/', '[/player0]', $text);
}
for($i=0;$i<=$_POST['coor0'];$i++){
$text = preg_replace('/\[coor'.$i.'\]/', '[coor0]', $text);
$text = preg_replace('/\[\/coor'.$i.'\]/', '[/coor0]', $text);
}
for($i=0;$i<=$text['report0'];$i++){
$text = preg_replace('/\[report'.$i.'\]/', '[report0]', $text);
$text = preg_replace('/\[\/report'.$i.'\]/', '[/report0]', $text);
}
$posts_id = $_POST['pod'];
if($text != ""){
if(!preg_match('/\[message\]/',$text) && !preg_match('/\[\/message\]/',$text)){
$text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){
if(preg_match('/\[alliance'.$i.'\]/',$text) && preg_match('/\[\/alliance'.$i.'\]/',$text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/',$alliance1) && preg_match('/\[\/alliance'.$i.'\]/',$alliance1)){
$j = $i+1;
$alliance2 = preg_replace('/\[\/alliance'.$i.'\](.*?)\[\/message\]/is', '', $text);
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1);
$text = $alliance2."[/alliance".$i."]".$alliance1;
$alliance += 1;
}
}
}
for($i=0;$i<=$player;$i++){
if(preg_match('/\[player'.$i.'\]/',$text) && preg_match('/\[\/player'.$i.'\]/',$text)){
$player1 = preg_replace('/\[message\](.*?)\[\/player'.$i.'\]/is', '', $text);
if(preg_match('/\[player'.$i.'\]/',$player1) && preg_match('/\[\/player'.$i.'\]/',$player1)){
$j = $i+1;
$player2 = preg_replace('/\[\/player'.$i.'\](.*?)\[\/message\]/is', '', $text);
$player1 = preg_replace('/\[player'.$i.'\]/', '[player'.$j.']', $player1);
$player1 = preg_replace('/\[\/player'.$i.'\]/', '[/player'.$j.']', $player1);
$text = $player2."[/player".$i."]".$player1;
$player += 1;
}
}
}
for($i=0;$i<=$coor;$i++){
if(preg_match('/\[coor'.$i.'\]/',$text) && preg_match('/\[\/coor'.$i.'\]/',$text)){
$coor1 = preg_replace('/\[message\](.*?)\[\/coor'.$i.'\]/is', '', $text);
if(preg_match('/\[coor'.$i.'\]/',$coor1) && preg_match('/\[\/coor'.$i.'\]/',$coor1)){
$j = $i+1;
$coor2 = preg_replace('/\[\/coor'.$i.'\](.*?)\[\/message\]/is', '', $text);
$coor1 = preg_replace('/\[coor'.$i.'\]/', '[coor'.$j.']', $coor1);
$coor1 = preg_replace('/\[\/coor'.$i.'\]/', '[/coor'.$j.']', $coor1);
$text = $coor2."[/coor".$i."]".$coor1;
$coor += 1;
}
}
}
for($i=0;$i<=$report;$i++){
if(preg_match('/\[report'.$i.'\]/',$text) && preg_match('/\[\/report'.$i.'\]/',$text)){
$report1 = preg_replace('/\[message\](.*?)\[\/report'.$i.'\]/is', '', $text);
if(preg_match('/\[report'.$i.'\]/',$report1) && preg_match('/\[\/report'.$i.'\]/',$report1)){
$j = $i+1;
$report2 = preg_replace('/\[\/report'.$i.'\](.*?)\[\/message\]/is', '', $text);
$report1 = preg_replace('/\[report'.$i.'\]/', '[report'.$j.']', $report1);
$report1 = preg_replace('/\[\/report'.$i.'\]/', '[/report'.$j.']', $report1);
$text = $report2."[/report".$i."]".$report1;
$report += 1;
}
}
}
$database->EditUpdatePost($posts_id,$text,$alliance,$player,$coor,$report);
}
}
}
if(!isset($_GET['admin'])) {
$_GET['admin'] = null;
}
if($_GET['admin']== "switch_admin"){
if($opt['opt5'] == 1){
if($database->CheckResultEdit($aid) != 1){
$database->CreatResultEdit($aid,1);
}else{
if($database->CheckEditRes($aid) == 1){
$database->UpdateResultEdit($aid,'');
}else{
$database->UpdateResultEdit($aid,1);
}
}
}
}
if($_GET['admin']== "pin"){
$database->StickTopic($_GET[idt],1); // stick topic
}
if($_GET['admin']== "unpin"){
$database->StickTopic($_GET[idt],''); // unstick topic
}
if($_GET['admin']== "delforum"){
$database->DeleteCat($_GET[idf]); // delete forum
}
if($_GET['admin']== "deltopic"){
$database->DeleteTopic($_GET[idt]); // delete topic
}
if($_GET['admin']== "delpost"){
$database->DeletePost($_GET[pod]); // stick topic
}
if($_GET['admin']== "lock"){
$database->LockTopic($_GET[idt],1); // lock topic
}
if($_GET['admin']== "unlock"){
$database->LockTopic($_GET[idt],''); // unlock topic
}
if($_GET['admin']== "newforum"){
include("Forum/forum_1.tpl"); // new forum
}elseif(isset($_GET['fid'])){
if(isset($_GET['ac'])){
include("Forum/forum_5.tpl"); // new topic
}else{
include("Forum/forum_4.tpl"); // topic cat
}
}elseif($_GET['admin'] == "editforum"){
include("Forum/forum_8.tpl"); // edit topic
}elseif($_GET['admin'] == "editans"){
include("Forum/forum_9.tpl"); // edit answer
}elseif($_GET['admin'] == "editpost"){
include("Forum/forum_10.tpl"); // edit answer
}elseif($_GET['admin'] == "edittopic"){
include("Forum/forum_3.tpl"); // edit topic
}elseif(isset($_GET['tid'])){
if(isset($_GET['ac'])){
include("Forum/forum_7.tpl"); // new post
}else{
include("Forum/forum_6.tpl"); // showtopic
}
}else{
if($database->CheckForum($aid)){
include("Forum/forum_2.tpl");
}else if($opt['opt5'] == 1){
if($session->access==BANNED){
echo '<p class="error">Forum is not created yet</p><p>
<a href="banned.php"><img id="fbtn_newforum" class="dynamic_img" src="img/x.gif" alt="New forum" /></a></p>';
}else{
echo '<p class="error">Forum is not created yet</p><p>
<a href="allianz.php?s=2&admin=newforum"><img id="fbtn_newforum" class="dynamic_img" src="img/x.gif" alt="New forum" /></a></p>';
}}else{
echo '<p class="error">Forum is not created yet</p>';
}
}
?>
+55
View File
@@ -0,0 +1,55 @@
<?php
if(isset($aid)) {
$aid = $aid;
}
else {
$aid = $session->alliance;
}
$allianceinfo = $database->getAlliance($aid);
$allianceInvitations = $database->getAliInvitations($aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
?>
<table cellpadding="1" cellspacing="1" id="invite" class="small_option"><thead>
<form method="post" action="allianz.php">
<input type="hidden" name="s" value="5">
<input type="hidden" name="o" value="4">
<input type="hidden" name="a" value="4">
<tr>
<th colspan="2">Invite a player into the alliance</th>
</tr>
</thead><tbody>
<tr><th>Name</th>
<td><input class="name text" type="text" name="a_name" maxlength="30"><span class="error"></span></td>
</tr>
</tbody></table>
<p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" onclick="this.disabled=true;this.form.submit();"/></form> </p>
<p class="error"><?php echo $form->getError("name1"); ?><br /><?php echo $form->getError("name2"); ?><br /><?php echo $form->getError("name3"); ?><br /><?php echo $form->getError("name4"); ?><br /><?php echo $form->getError("name5"); ?><br /><?php echo $form->getError("perm"); ?></p><br />
<table cellpadding="1" cellspacing="1" id="invitations" class="small_option"><thead>
<tr>
<th colspan="2">Invitations:</th>
</tr></thead>
<tbody>
<?php
if (count($allianceInvitations) == 0) {
echo "<tr>";
echo "<td class=none colspan=2>none</td>";
echo "</tr>";
} else {
foreach($allianceInvitations as $invit) {
$invited = $database->getUserField($invit['uid'],username,0);
echo "<tr>";
echo "<td class=abo><a href=\"?o=4&s=5&d=".$invit['id']."\"><img src=\"gpack/travian_default/img/a/del.gif\" width=\"12\" height=\"12\" alt=\"Del\"></a></td>";
echo "<td><a href=spieler.php?uid=".$invit['uid'].">".$invited."</td>";
echo "</tr>";
}
}
?>
</tbody>
</table>
+45
View File
@@ -0,0 +1,45 @@
<?php
if(isset($aid)) {
$aid = $aid;
}
else {
$aid = $session->alliance;
}
$memberlist = $database->getAllMember($aid);
$allianceinfo = $database->getAlliance($aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
?>
<form method="post" action="allianz.php">
<table cellpadding="1" cellspacing="1" id="position" class="small_option">
<thead>
<tr>
<th colspan="2">Kick Player:</th>
</tr>
</thead>
<tbody>
<tr>
<th colspan="2">Here you can kick the players from your alliance.</th>
</tr>
<tr>
<th>Name</th>
<td>
<select name="a_user" class="name dropdown">
<?php
foreach($memberlist as $member) {
echo "<option value=".$member['id'].">".$member['username']."</option>";
}
?>
</select>
</td>
</tr>
</tbody>
</table>
<p>
<input type="hidden" name="o" value="2">
<input type="hidden" name="s" value="5">
<input type="hidden" name="a" value="2">
<input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" />
</p>
</form>
<p class="error"></p>
+32
View File
@@ -0,0 +1,32 @@
<?php
if(isset($aid)) {
$aid = $aid;
}
else {
$aid = $session->alliance;
}
$allianceinfo = $database->getAlliance($aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
?>
<form method="post" action="allianz.php">
<input type="hidden" name="a" value="5">
<input type="hidden" name="o" value="5">
<input type="hidden" name="s" value="5">
<tr>
<th colspan="2">Link to the forum</th>
</tr>
</thead><tbody>
<tr><th>URL</th>
<td><input class="link text" type="text" name="f_link" value="<?php echo $allianceinfo['forumlink']; ?>" maxlength="200"></td>
</tr>
<tr>
<td colspan="2" class="info">If your alliance wants to use an external forum, you can enter the url here.</td>
</tr></tbody>
</table>
<p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p>
+105
View File
@@ -0,0 +1,105 @@
<?php
//gp link
if($session->gpack == null || GP_ENABLE == false) {
$gpack= GP_LOCATE;
} else {
$gpack= $session->gpack;
}
//de lintjes
/******************************
INDELING CATEGORIEEN:
===============================
== 1. Aanvallers top 10 ==
== 2. Defence top 10 ==
== 3. Klimmers top 10 ==
== 4. Overvallers top 10 ==
== 5. In att en def tegelijk ==
== 6. in top 3 - aanval ==
== 7. in top 3 - verdediging ==
== 8. in top 3 - klimmers ==
== 9. in top 3 - overval ==
******************************/
$geregistreerd=date('d-m-Y', ($allianceinfo['timestamp']));
$profiel = preg_replace("/\[war]/s",'At war with<br>'.$database->getAllianceWar($aid), $profiel, 1);
$profiel = preg_replace("/\[ally]/s",'Confederacies<br>'.$database->getAllianceDipProfile($aid,1), $profiel, 1);
$profiel = preg_replace("/\[nap]/s",'NAPs<br>'.$database->getAllianceDipProfile($aid,2), $profiel, 1);
$profiel = preg_replace("/\[diplomatie]/s",'Confederacies<br>'.$database->getAllianceDipProfile($aid,1).'<br>NAPs<br>'.$database->getAllianceDipProfile($aid,2).'<br>At war with<br>'.$database->getAllianceWar($aid), $profiel, 1);
foreach($varmedal as $medal) {
switch ($medal['categorie']) {
case "1":
$titel="Attackers of the Week";
$woord="Points";
break;
case "2":
$titel="Defenders of the Week";
$woord="Points";
break;
case "3":
$titel="Climbers of the week(Ranks)";
$woord="Ranks";
break;
case "4":
$titel="Robbers of the week";
$woord="Resources";
break;
case "5":
$titel="Receiving this medal shows that your alliance was in the top 3 of both attacckers and defenders of the week.";
$bonus[$medal['id']]=1;
break;
case "6":
$titel="Receiving this medal shows that your alliance was in the top 3 of the attackers of the week ".$medal['points']." in a row";
$bonus[$medal['id']]=1;
break;
case "7":
$titel="Receiving this medal shows that your alliance was in the top 3 of the deffenders of the week ".$medal['points']." in a row";
$bonus[$medal['id']]=1;
break;
case "8":
$titel="Receiving this medal shows that your alliance was in the top 3 of the rank climbers of the week ".$medal['points']." in a row.";
$bonus[$medal['id']]=1;
break;
case "9":
$titel="Receiving this medal shows that your alliance was in the top 3 of the robbers of the week ".$medal['points']." in a row.";
$bonus[$medal['id']]=1;
break;
case "11":
$titel="Receiving this medal shows that you were in the top 3 of the Rank Climbers of the week ".$medal['points']." in a row.";
$bonus[$medal['id']]=1;
break;
case "12":
$titel="Receiving this medal shows that you were in the top 10 Attackers of the week ".$medal['points']." in a row.";
$bonus[$medal['id']]=1;
break;
case "13":
$titel="Receiving this medal shows that you were in the top 10 Defenders of the week ".$medal['points']." in a row.";
$bonus[$medal['id']]=1;
break;
case "15":
$titel="Receiving this medal shows that you were in the top 10 Robbers of the week ".$medal['points']." in a row.";
$bonus[$medal['id']]=1;
break;
case "16":
$titel="Receiving this medal shows that you were in the top 10 Rank Climbers of the week ".$medal['points']." in a row.";
$bonus[$medal['id']]=1;
break;
}
if(isset($bonus[$medal['id']])){
$profiel = preg_replace("/\[#".$medal['id']."]/is",'<img src="'.$gpack.'img/t/'.$medal['img'].'.jpg" border="0" onmouseout="med_closeDescription()" onmousemove="med_mouseMoveHandler(arguments[0],\'<table><tr><td>'.$titel.'<br /><br />Received in week: '.$medal['week'].'</td></tr></table>\')">', $profiel, 1);
} else {
$profiel = preg_replace("/\[#".$medal['id']."]/is",'<img src="'.$gpack.'img/t/'.$medal['img'].'.jpg" border="0" onmouseout="med_closeDescription()" onmousemove="med_mouseMoveHandler(arguments[0],\'<table><tr><td>Category:</td><td>'.$titel.'</td></tr><tr><td>Week:</td><td>'.$medal['week'].'</td></tr><tr><td>Rank:</td><td>'.$medal['plaats'].'</td></tr><tr><td>'.$woord.':</td><td>'.$medal['points'].'</td></tr></table>\')">', $profiel, 1);
}
}
?>
+33
View File
@@ -0,0 +1,33 @@
<?php
if(isset($aid)) {
$aid = $aid;
}
else {
$aid = $session->alliance;
}
$allianceinfo = $database->getAlliance($aid);
$noticeArray = $database->readAlliNotice($aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
?>
<table cellpadding="1" cellspacing="1" id="events"><thead>
<tr><th colspan="2">Alliance events</th></tr>
<tr>
<td>Event</td>
<td>Date</td>
</tr>
</thead>
<tbody>
<?php
foreach($noticeArray as $notice) {
$date = $generator->procMtime($notice['date']);
echo "<tr>";
echo "<td class=event>".$notice['comment']."</td>";
echo "<td class=dat>".$date['0']." ".$date['1']."</td>";
echo "</tr>";
}
?>
</tbody>
</table>
+85
View File
@@ -0,0 +1,85 @@
<?php
if(isset($aid)) {
$aid = $aid;
}
else {
$aid = $session->alliance;
}
$allianceinfo = $database->getAlliance($aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
?>
<table cellpadding="1" cellspacing="1" id="options" class="small_option"><thead>
<form method="POST" action="allianz.php">
<input type="hidden" name="s" value="5">
<tr>
<th colspan="2">Options</th>
</tr></thead><tbody>
<?php
if ($alliance->userPermArray['opt1']==1){
?>
<tr>
<td class="sel"><input class="radio" type="radio" name="o" value="1"></td>
<td class="val">Assign to position</td>
</tr>
<?php
}
if ($alliance->userPermArray['opt3']==1){
?>
<tr>
<td class="sel"><input class="radio" type="radio" name="o" value="100"></td>
<td class="val">Change name</td>
</tr>
<?php
}
if ($alliance->userPermArray['opt2']==1){
?>
<tr>
<td class="sel"><input class="radio" type="radio" name="o" value="2"></td>
<td class="val">Kick player</td>
</tr>
<?php
}
if ($alliance->userPermArray['opt3']==1){
?>
<tr>
<td class="sel"><input class="radio" type="radio" name="o" value="3"></td>
<td class="val">Change alliance description</td>
</tr>
<?php
}
if ($alliance->userPermArray['opt6']==1){
?>
<tr>
<td class="sel"><input class="radio" type="radio" name="o" value="6"></td>
<td class="val">Alliance diplomacy</td>
</tr>
<?php
}
if ($alliance->userPermArray['opt4']==1){
?>
<tr>
<td class="sel"><input class="radio" type="radio" name="o" value="4"></td>
<td class="val">Invite a player into the alliance</td>
</tr>
<?php
}
if ($alliance->userPermArray['opt5']==1){
?>
<tr>
<td class="sel"><input class="radio" type="radio" name="o" value="5"></td>
<td class="val">Link to the forum</td>
</tr>
<?php
}
?>
<tr>
<td class="sel"><input class="radio" type="radio" name="o" value="11"></td>
<td class="val">Quit alliance</td>
</tr>
</tbody>
</table>
<p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" onclick="this.disabled=true;this.form.submit();"/></form></p>
+159
View File
@@ -0,0 +1,159 @@
<?php
if(isset($_GET['aid'])) {
$aid = $_GET['aid'];
}
else {
$aid = $session->alliance;
}
$varmedal = $database->getProfileMedalAlly($aid);
$allianceinfo = $database->getAlliance($aid);
$memberlist = $database->getAllMember($aid);
$totalpop = 0;
if($allianceinfo['tag']==""){
header("Location: allianz.php");
}
foreach($memberlist as $member) {
$totalpop += $database->getVSumField($member['id'],"pop");
}
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
$profiel="".$allianceinfo['notice']."".md5(skJkev3)."".$allianceinfo['desc']."";
require("medal.php");
$profiel=explode("".md5(skJkev3)."", $profiel);
include("alli_menu.tpl");
?>
<table cellpadding="1" cellspacing="1" id="profile">
<thead>
<tr>
<th colspan="2">Alliance</th>
</tr>
<tr>
<td>Details</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr><td class="empty"></td><td class="empty"></td></tr>
<tr>
<td class="details">
<table cellpadding="0" cellspacing="0">
<tr>
<th>Tag</th>
<td><?php echo $allianceinfo['tag']; ?></td>
</tr>
<tr>
<th>Name</th>
<td><?php echo $allianceinfo['name']; ?></td>
</tr>
<tr>
<td colspan="2" class="empty"></td>
</tr>
<tr>
<th>Rank</th>
<td><?php echo $ranking->getAllianceRank($aid); ?>.</td>
</tr>
<tr>
<th>Points</th>
<td><?php echo $totalpop; ?></td>
</tr>
<tr>
<th>Members</th>
<td><?php echo count($memberlist); ?></td>
</tr><tr>
<td colspan="2" class="empty"></td>
</tr>
<?php
foreach($memberlist as $member) {
//rank name
$rank = $database->getAlliancePermission($member['id'],"rank",0);
//username
$name = $database->getUserField($member['id'],"username",0);
//if there is no rank defined, user will not be printed
if($rank == ''){
echo '';
}
//if there is user rank defined, user will be printed
else if($rank != ''){
echo "<tr>";
echo "<th>".stripslashes($rank)."</th>";
echo "<td><a href='spieler.php?uid=".$member['id']."'>".$name."</td>";
echo "</tr>";
}
}
if($allianceinfo['forumlink'] != ''){
echo "<tr>";
echo "<td><a href='".$allianceinfo['forumlink']."'>» to the forum</td>";
echo "</tr>";
}else{
?>
<tr>
<td colspan="2" class="emmty"></td>
</tr>
<?php } ?>
<tr>
<td class="desc2" colspan="2"><?php echo stripslashes(nl2br($profiel[0])); ?>
</td>
</tr>
</table>
</td>
<td class="desc1"><?php echo stripslashes(nl2br($profiel[1])); ?>
</td>
</tr>
</tbody>
</table><table cellpadding="1" cellspacing="1" id="member"><thead>
<tr>
<th>&nbsp;</th>
<th>Player</th>
<th>Population</th>
<th>Villages</th>
<?php
if($aid == $session->alliance){
echo "<th>&nbsp;</th>";
}
?>
</tr>
</thead>
<tbody>
<?php
// Alliance Member list loop
$rank=0;
foreach($memberlist as $member) {
$rank = $rank+1;
$TotalUserPop = $database->getVSumField($member['id'],"pop");
$TotalVillages = $database->getProfileVillages($member['id']);
echo " <tr>";
echo " <td class=ra>".$rank.".</td>";
echo " <td class=pla><a href=spieler.php?uid=".$member['id'].">".$member['username']."</a></td>";
echo " <td class=hab>".$TotalUserPop."</td>";
echo " <td class=vil>".count($TotalVillages)."</td>";
if($aid == $session->alliance){
if ((time()-600) < $member['timestamp']){ // 0 Min - 10 Min
echo " <td class=on><img class=online1 src=img/x.gif title='Now online' alt='Now online' /></td>";
}elseif ((time()-86400) < $member['timestamp'] && (time()-600) > $member['timestamp']){ // 10 Min - 1 Days
echo " <td class=on><img class=online2 src=img/x.gif title='Offline' alt='Offline' /></td>";
}elseif ((time()-259200) < $member['timestamp'] && (time()-86400) > $member['timestamp']){ // 1-3 Days
echo " <td class=on><img class=online3 src=img/x.gif title='Last 3 days' alt='Last 3 days' /></td>";
}elseif ((time()-604800) < $member['timestamp'] && (time()-259200) > $member['timestamp']){
echo " <td class=on><img class=online4 src=img/x.gif title='Last 7 days' alt='Last 7 days' /></td>";
}else{
echo " <td class=on><img class=online5 src=img/x.gif title=inactive alt=inactive /></td>";
}
}
echo " </tr>";
}
?>
</tbody>
</table>
+28
View File
@@ -0,0 +1,28 @@
<?php
if(isset($aid)) {
$aid = $aid;
}
else {
$aid = $session->alliance;
}
$allianceinfo = $database->getAlliance($aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
?>
<table cellpadding="1" cellspacing="1" id="quit" class="small_option"><thead>
<form method="post" action="allianz.php">
<input type="hidden" name="a" value="11">
<input type="hidden" name="o" value="11">
<input type="hidden" name="s" value="5">
<tr>
<th colspan="2">Quit alliance</th>
</tr>
</thead><tbody>
<tr><td colspan="2" class="info">In order to quit the alliance you have to enter your password again for safety reasons.</td></tr>
<tr><th>password:</th>
<td><input class="pass text" type="password" name="pw" maxlength="20"></td>
</tr></tbody></table>
<p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p>
+4
View File
@@ -0,0 +1,4 @@
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
File diff suppressed because it is too large Load Diff
+794
View File
@@ -0,0 +1,794 @@
<p class=f9>
At the beginning you should try to get a good economic basis. In order to do so you have to extend the 18 resource fields (village overview). There are four different types of resource fields: Woodcutter, Clay pit, Iron mine and Cropland. If you click one of them, you will get more information and the option to extend it.
<br><br>
Later in the game the buildings in the village become important too. In order to construct a new building you have to click on one of the green ovals. A list with every building that is available will appear.
<br><br>
Some buildings can only be built if you fulfil the prerequisites which are other buildings.</p>
<h2>Main Building</h2>
<p>
<img src="img/un/h/gid15.gif" width=166 height=150 border=0 alt="Main Building" title="Main Building" align="left" />
The village's master builders live in the main building. The higher its level the faster your master builders complete the construction of new buildings.
<br><br>
<b>Tribe advantage:</b><br>
Romans: Can build/extend a resource field and a village building at the same time. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
70 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
40 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
60 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
20 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
2 | <img src=img/un/h/clock.gif width=18 height=12>
0:33:20 <br>
<br>
<b>
Prerequisites: </b>
<br>
none</p>
<h2>Warehouse</h2>
<p>
<img src="img/un/h/gid10.gif" width=166 height=150 border=0 alt="Warehouse" title="Warehouse" align="right" />
The resources lumber, clay and iron are stored in your warehouse. By increasing its level you increase your warehouse's capacity. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
130 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
160 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
90 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
40 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
1 | <img src=img/un/h/clock.gif width=18 height=12>
0:33:20 <br>
<br>
<b>
Prerequisites: </b>
<br>
Main Building Level 1</p>
<h2>Granary</h2>
<p>
<img src="img/un/h/gid11.gif" width=166 height=150 border=0 alt="Granary" title="Granary" align="right" />
The crop produced by your farms is stored in the granary. By increasing its level you increase the granary?s capacity. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
80 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
100 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
70 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
20 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
1 | <img src=img/un/h/clock.gif width=18 height=12>
0:26:40 <br>
<br>
<b>
Prerequisites: </b>
<br>
Main Building Level 1</p>
<h2>Cranny</h2>
<p>
<img src="img/un/h/gid23.gif" width=166 height=150 border=0 alt="Cranny" title="Cranny" align="left" />
The cranny is used to hide some of your resources when the village is attacked. These resources cannot be stolen. At level 1 100 resources are hidden.
<br><br>
<b>Tribe advantage:</b><br>
Gauls: The cranny is twice as big.<br>
Teutons: Enemy crannies only hides 66% of the normal amount in Travian version 2.5 and 3, and 80% of the normal amount in Travian version 3.5. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
40 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
50 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
30 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
10 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
0 | <img src=img/un/h/clock.gif width=18 height=12>
0:12:30 <br>
<br>
<b>
Prerequisites: </b>
<br>
none</p>
<h2>Embassy</h2>
<p>
<img src="img/un/h/gid18.gif" width=166 height=150 border=0 alt="Embassy" title="Embassy" align="right" />
In order to join an alliance you need an embassy. With an embassy level 3 you can even found one yourself. With each higher level the maximum size of the alliance increases by 3. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
180 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
130 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
150 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
80 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
3 | <img src=img/un/h/clock.gif width=18 height=12>
0:33:20 <br>
<br>
<b>
Prerequisites: </b>
<br>
Main Building Level 1</p>
<h2>Rally Point</h2>
<p>
<img src="img/un/h/gid16.gif" width=166 height=150 border=0 alt="Rally Point" title="Rally Point" align="right" />
At the rally point you can instruct your troops and can see the sender of oncoming troops. The rally point can only be build at the building site right of the village centre. The higher its level the more targets for the catapults become available. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
110 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
160 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
90 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
70 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
1 | <img src=img/un/h/clock.gif width=18 height=12>
0:33:20 <br>
<br>
<b>
Prerequisites: </b>
<br>
none</p>
<h2>Marketplace</h2>
<p>
<img src="img/un/h/gid17.gif" width=166 height=150 border=0 alt="Marketplace" title="Marketplace" align="left" />
At the marketplace you can trade resources with other players. The higher its level, the more resources can be transported at the same time.
<br><br>
<b>Tribe advantage:</b><br>
Romans: Each merchant can carry 500 resources.<br>
Velocity: 16 fields/hour.<br>
Teutons: Each merchant can carry 1000 resources.<br>
Velocity: 12 fields/hour.<br>
Gauls: Each merchant can carry 750 resources.<br>
Velocity: 24 fields/hour. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
80 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
70 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
120 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
70 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
4 | <img src=img/un/h/clock.gif width=18 height=12>
0:30:00 <br>
<br>
<b>
Prerequisites: </b>
<br>
Main Building Level 3, Warehouse Level 1, Granary Level 1</p>
<h2>Barracks</h2>
<p>
<img src="img/un/h/gid19.gif" width=166 height=150 border=0 alt="Barracks" title="Barracks" align="left" />
Infantry can be trained in the barracks. The higher its level the faster the troops are trained. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
210 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
140 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
260 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
120 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
4 | <img src=img/un/h/clock.gif width=18 height=12>
0:33:20 <br>
<br>
<b>
Prerequisites: </b>
<br>
Rally Point Level 1, Main Building Level 3</p>
<h2>Stable</h2>
<p>
<img src="img/un/h/gid20.gif" width=166 height=150 border=0 alt="Stable" title="Stable" align="left" />
Cavalry is trained in the stable. The higher its level the faster the troops are trained. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
260 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
140 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
220 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
100 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
5 | <img src=img/un/h/clock.gif width=18 height=12>
0:36:40 <br>
<br>
<b>
Prerequisites: </b>
<br>
Blacksmith Level 3, Academy Level 5</p>
<h2>Workshop</h2>
<p>
<img src="img/un/h/gid21.gif" width=166 height=150 border=0 alt="Workshop" title="Workshop" align="left" />
Siege engines like catapults and rams can be built in the workshop. The higher its level the faster the units are produced. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
460 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
510 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
600 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
320 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
3 | <img src=img/un/h/clock.gif width=18 height=12>
0:50:00 <br>
<br>
<b>
Prerequisites: </b>
<br>
Academy Level 10, Main Building Level 5</p>
<h2>Academy</h2>
<p>
<img src="img/un/h/gid22.gif" width=166 height=150 border=0 alt="Academy" title="Academy" align="right" />
New unit types can be developed in the academy. By increasing its level you can order the research of better units. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
220 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
160 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
90 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
40 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
4 | <img src=img/un/h/clock.gif width=18 height=12>
0:33:20 <br>
<br>
<b>
Prerequisites: </b>
<br>
Barracks Level 3, Main Building Level 3</p>
<h2>Blacksmith</h2>
<p>
<img src="img/un/h/gid12.gif" width=166 height=150 border=0 alt="Blacksmith" title="Blacksmith" align="left" />
Your warriors' weapons are enhanced in the blacksmith?s melting furnaces. By increasing its level you can order the fabrication of even better weapons. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
170 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
200 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
380 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
130 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
4 | <img src=img/un/h/clock.gif width=18 height=12>
0:33:20 <br>
<br>
<b>
Prerequisites: </b>
<br>
Main Building Level 3, Academy Level 3</p>
<h2>Armoury</h2>
<p>
<img src="img/un/h/gid13.gif" width=166 height=150 border=0 alt="Armoury" title="Armoury" align="right" />
Your warriors' armour is enhanced in the armoury's melting furnaces. By increasing its level you can order the fabrication of even better armour. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
130 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
210 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
410 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
130 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
4 | <img src=img/un/h/clock.gif width=18 height=12>
0:33:20 <br>
<br>
<b>
Prerequisites: </b>
<br>
Main Building Level 3, Academy Level 1</p>
<h2>Palace</h2>
<p>
<img src="img/un/h/gid26.gif" width=166 height=150 border=0 alt="Palace" title="Palace" align="left" />
The King or Queen of the empire lives in the palace. The palace can only be built in one village at a time and can be used to make a village the capital. Capitals cannot be conquered.
<br><br>
At level 10, 15 and 20 three settlers or one administrator (Senator, Chief or Chieftain) can be trained.
<br><br>
The Capital is the only place a stonemason's lodge can be erected. Also the capital is the only village where resource fields can be extended beyond level 10. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
550 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
800 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
750 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
250 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
1 | <img src=img/un/h/clock.gif width=18 height=12>
1:23:20 <br>
<br>
<b>
Prerequisites: </b>
<br>
Embassy Level 1, Main Building Level 5, <strike>Residence</strike></p>
<h2>Residence</h2>
<p>
<img src="img/un/h/gid25.gif" width=166 height=150 border=0 alt="Residence" title="Residence" align="left" />
The residence is a small palace where the king or queen lives when he or she visits the village. The residence protects the village against enemies who want to conquer it as long as it is not destroyed.
<br><br>
At level 10 and 20 three settlers or one administrator (Senator, Chief or Chieftain) can be trained. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
580 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
460 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
350 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
180 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
1 | <img src=img/un/h/clock.gif width=18 height=12>
0:33:20 <br>
<br>
<b>
Prerequisites: </b>
<br>
Main Building Level 5, <strike>Palace</strike></p>
<h2>Trade Office</h2>
<p>
<img src="img/un/h/gid28.gif" width=166 height=150 border=0 alt="Trade Office" title="Trade Office" align="left" />
In the trade office the merchants' carts get improved and equipped with powerful horses. The higher its level the more your merchants are able to carry.
<br><br>
With each level the capacity increases by 10%. At level 20 your merchants can carry thrice as much as normal.
<br><br>
<b>Tribe advantage:</b><br>
Romans: In Travian version 3.5 the Roman trade office increases the capacity by 20% per level. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
1400 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
1330 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
1200 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
400 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
3 | <img src=img/un/h/clock.gif width=18 height=12>
0:50:00 <br>
<br>
<b>
Prerequisites: </b>
<br>
Marketplace Level 20, Stable Level 10</p>
<h2>Tournament Square</h2>
<p>
<img src="img/un/h/gid14.gif" width=166 height=150 border=0 alt="Tournament Square" title="Tournament Square" align="left" />
Your troops can train to increase their stamina at the tournament square. The further the building is upgraded the faster your troops are beyond a minimum distance of 30 squares. <br>
<br>
<b>Costs</b> and <b>construction time</b> for level 1: <br>
<img src=img/un/res/1.gif width=18 height=12 alt=Lumber " title="
Lumber " style="padding-top: 4px" />
1750 | <img src=img/un/res/2.gif width=18 height=12 alt="Clay" title="Clay">
2250 | <img src="img/un/res/3.gif" width=18 height=12 alt="Iron" title="Iron">
1530 | <img src=img/un/res/4.gif width=18 height=12 alt="Crop" title="Crop">
240 | <img src=img/un/res/5.gif width=18 height=12 alt="Crop consumption" title="Crop consumption">
1 | <img src=img/un/h/clock.gif width=18 height=12>
0:58:20 <br>
<br>
<b>
Prerequisites: </b>
<br>
Rally Point Level 15</p>
</div>
<div class="clear"></div>
</div>
<div id="footer">
<div class="container">
<a href="#" class="logo"><img src="img/x.gif" alt="Travian Games" class="logo_traviangames" /></a>
<li class="copyright">&copy; <?php echo TRAVIAN_COPYRIGHT; ?></li>
</div>
</div>
</div>
+77
View File
@@ -0,0 +1,77 @@
<p><img src="img/un/h/faq_vp.jpg" width="116" height="128" border="0" alt="Rally point" title="Rally point" align="right"></p>
<p class="question">How can I build a rally point?</p>
<p class="answer">The rally point can only be built at one location. This location is found to the right of your villages centre on the meadow.</p>
<p><img src="img/un/h/faq_botschaft.jpg" width="122" height="150" border="0" alt="Embassy" title="Embassy" align="left"></p>
<p class="question">How can I found an alliance?</p>
<p class="answer">To found an alliance you need an embassy at level 3. To be able to join an alliance you just need an embassy at level 1 and, of course, an invitation to join the alliance.</p>
<p class="question">How can I change the name of my village?</p>
<p class="answer">First select the village you wish to remain by clicking it under <i>Villages</i>. Next click <i>Profile</i> at the left then <i>Change Profile</i>. Change the name in the <i>Village name</i> box and click OK.</p>
<p class="question">How do I train troops?</p>
<p class="answer">You need a rally point which is at least level 1 and a main building which is at least level 3. When you have those you can raise Barracks and there you can train infantry.</p>
<p class="question">How do I defend my village?</p>
<p class="answer">As long as there are troops (your own or troops sent to reinforce you) in your village they defend your village automatically.</p>
<p class="answer">Each building increases the population of your village by a certain number of new inhabitants. How many new inhabitants are produced by raising/extending a building is shown next to the symbol <img src="img/un/res/5.gif" width="18" height="12" border="0" alt="Use of crop" title="use of crop">.</p>
<p class="question">Help, my crop production sinks more and more!</p>
<p class="answer">At <i>Production</i> (e.g. 10) your crop production minus your use of crop because of <i>population</i> (e.g. 5) and <i>Troops</i> is shown. Your total crop production is shown in the upper right corner. e.g. <img src="img/un/res/5.gif" width="18" height="12" border="0" alt="use of crop" title="use of crop"> 5/15
<br>In the example 8 would be your use of crop, 15 your total crop production, <br>15 - 8 = 7 units of crop per hour. </p>
<p class="question">Why do my troops plunder so few resources?</p>
<p class="answer">There are two explanations. Firstly, each troop type can only carry a certain number of resources. Secondly, your victim might have a <i>cranny</i> where his or her villagers automatically hide a certain number of resources that your plundering hordes cannot find.</p>
<p class="question">How can I found or conquer new villages?</p>
<p class="answer">You need three settlers to found a new village. To conquer a village you need an administrator (senator, chief or chieftain) which can be trained in your palace/residence at level 10. Additionally you need a certain number of <a href="anleitung.php?s=4">culture points</a>.</p>
<p class="question">Can I lose a village?</p>
<p class="answer">Every village can be catapulted to 0 inhabitants and as long as it is not the last of your account it will disappear after a short time. The only village that cannot be conquered is the capital. Note that destroying the capital is still possible.</p>
</div>
<div class="clear"></div>
</div>
<div id="footer">
<div class="container">
<a href="#" class="logo"><img src="img/x.gif" alt="Travian Games" class="logo_traviangames" /></a>
<li class="copyright">&copy; <?php echo TRAVIAN_COPYRIGHT; ?></li>
</div>
</div>
</div>
File diff suppressed because it is too large Load Diff
+4
View File
@@ -0,0 +1,4 @@
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
+53
View File
@@ -0,0 +1,53 @@
<?php
include("next.tpl");
?>
<div id="build" class="gid1"><a href="#" onClick="return Popup(0,4);" class="build_logo">
<img class="building g1" src="img/x.gif" alt="<?php echo B1; ?>" title="<?php echo B1; ?>" />
</a>
<h1><?php echo B1; ?> <span class="level"><?php echo LEVEL." "; echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc"><?php echo B1_DESC; ?></p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th><?php echo CUR_PROD; ?>:</th>
<td><b><?php echo $bid1[$village->resarray['f'.$id]]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
<tr>
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
<td><b><?php echo $bid1[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}else{
?>
<tr>
<th><?php echo NEXT_PROD; 20 ?>:</th>
<td><b><?php echo $bid1[20]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}}else{
if($next<=10){
?>
<tr>
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
<td><b><?php echo $bid1[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}else{
?>
<tr>
<th><?php echo NEXT_PROD; echo 10; ?>:</th>
<td><b><?php echo $bid1[10]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}}}
?>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+38
View File
@@ -0,0 +1,38 @@
<?php
include("next.tpl");
?>
<div id="build" class="gid10"><a href="#" onClick="return Popup(10,4);" class="build_logo">
<img class="building g10" src="img/x.gif" alt="Warehouse" title="Warehouse" />
</a>
<h1>Warehouse <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">The resources wood, clay and iron are stored in your Warehouse. By increasing its level you increase your Warehouse's capacity. .</p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th>Current capacity:</th>
<td><b><?php echo $bid10[$village->resarray['f'.$id]]['attri']*STORAGE_MULTIPLIER; ?></b> Resource units</td>
</tr>
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
<td><b><?php echo $bid10[$next]['attri']*STORAGE_MULTIPLIER; ?></b> Resource units</td>
<?php
}else{
?>
<th>Capacity at level 20:</th>
<td><b><?php echo $bid10[20]['attri']*STORAGE_MULTIPLIER; ?></b> Resource units</td>
<?php
}
}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+39
View File
@@ -0,0 +1,39 @@
<?php
include("next.tpl");
?>
<div id="build" class="gid11"><a href="#" onClick="return Popup(11,4);" class="build_logo">
<img class="building g11" src="img/x.gif" alt="Granary" title="Granary" />
</a>
<h1>Granary <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">Crop produced by your farms is stored in the Granary. By increasing its level you increase the Granary's capacity.</p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th>Current capacity:</th>
<td><b><?php echo $bid11[$village->resarray['f'.$id]]['attri']*STORAGE_MULTIPLIER; ?></b> Crop units</td>
</tr>
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
<td><b><?php echo $bid11[$next]['attri']*STORAGE_MULTIPLIER; ?></b> Crop units</td>
<?php
}else{
?>
<th>Capacity at level 20:</th>
<td><b><?php echo $bid11[20]['attri']*STORAGE_MULTIPLIER; ?></b> Crop units</td>
<?php
}
}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+16
View File
@@ -0,0 +1,16 @@
<div id="build" class="gid12"><a href="#" onClick="return Popup(12,4);" class="build_logo">
<img class="building g12" src="img/x.gif" alt="Blacksmith" title="Blacksmith" />
</a>
<h1>Blacksmith <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">In the blacksmith's melting furnaces your warriors' weapons are enhanced. By increasing its level you can order the fabrication of even better weapons.
<?php
if ($building->getTypeLevel(12) > 0) {
include("12_upgrades.tpl");
} else {
echo "<p><b>Upgrades can commence when blacksmith is completed.</b><br>\n";
}
include("upgrade.tpl");
?>
</p>
</div>
+78
View File
@@ -0,0 +1,78 @@
<table cellpadding="1" cellspacing="1" class="build_details">
<thead>
<tr>
<td>Blacksmith</td>
<td>Action</td>
</tr>
</thead>
<tbody>
<tr>
<?php
$abdata = $database->getABTech($village->wid);
$ABups = $technology->getABUpgrades('b');
for($i=($session->tribe*10-9);$i<=($session->tribe*10-2);$i++) {
$j = $i % 10 ;
if ( $technology->getTech($i) || $j == 1 ) {
echo "<tr><td class=\"desc\"><div class=\"tit\">
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> (Level ".$abdata['b'.$j].")
</div>";
if($abdata['b'.$j] != 20) {
echo "<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'ab'.$i}[$abdata['b'.$j]+1]['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'ab'.$i}[$abdata['b'.$j]+1]['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'ab'.$i}[$abdata['b'.$j]+1]['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'ab'.$i}[$abdata['b'.$j]+1]['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round(${'ab'.$i}[$abdata['b'.$j]+1]['time']*($bid12[$building->getTypeLevel(12)]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'ab'.$i}[$abdata['b'.$j]+1]['wood']."&r2=".${'ab'.$i}[$abdata['b'.$j]+1]['clay']."&r3=".${'ab'.$i}[$abdata['b'.$j]+1]['iron']."&r4=".${'ab'.$i}[$abdata['b'.$j]+1]['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
}
if($abdata['b'.$j] == 20) {
echo "<td class=\"act\"><div class=\"none\">Maximum<br>level</div></td></tr>";
}
else if(${'ab'.$i}[$abdata['b'.$j]+1]['wood'] > $village->maxstore || ${'ab'.$i}[$abdata['b'.$j]+1]['clay'] > $village->maxstore || ${'ab'.$i}[$abdata['b'.$j]+1]['iron'] > $village->maxstore) {
echo "<td class=\"act\"><div class=\"none\">Expand<br>warehouse</div></td></tr>";
}
else if (${'ab'.$i}[$abdata['b'.$j]+1]['crop'] > $village->maxcrop) {
echo "<td class=\"act\"><div class=\"none\">Expand<br>granary</div></td></tr>";
}
else if (${'ab'.$i}[$abdata['b'.$j]+1]['wood'] > $village->awood || ${'ab'.$i}[$abdata['b'.$j]+1]['clay'] > $village->aclay || ${'ab'.$i}[$abdata['b'.$j]+1]['iron'] > $village->airon || ${'ab'.$i}[$abdata['b'.$j]+1]['crop'] > $village->acrop) {
if($village->getProd("crop")>0 || $village->acrop > ${'ab'.$i}[$abdata['b'.$j]+1]['crop']){
$time = $technology->calculateAvaliable(12,${'ab'.$i}[$abdata['b'.$j]+1]);
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
} else {
echo "<br><span class=\"none\">Crop production is negative so you will never reach the required resources</span></div></td>";
}
echo "<td class=\"act\"><div class=\"none\">Too few<br>resources</div></td></tr>";
}
else if ($building->getTypeLevel(12) <= $abdata['b'.$j]) {
echo "<td class=\"act\"><div class=\"none\">Upgrade<br>blacksmith</div></td></tr>";
}
else if (count($ABups) > 0) {
echo "<td class=\"act\"><div class=\"none\">Upgrade in<br>progress</div></td></tr>";
}
else if($session->access != BANNED){
echo "<td class=\"act\"><a class=\"research\" href=\"build.php?id=$id&amp;a=$j&amp;c=".$session->mchecker."\">Upgrade</a></td></tr>";
}else{
echo "<td class=\"act\"><a class=\"research\" href=\"banned.php\">Upgrade</a></td></tr>";
}
}
}
?>
</tbody>
</table>
<?php
if(count($ABups) > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Upgrading</td><td>Duration</td><td>Complete</td></tr>
</thead><tbody>";
$timer = 1;
foreach($ABups as $black) {
$unit = ($session->tribe-1)*10 + substr($black['tech'],1,2);
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($black['timestamp']-time())."</span></td>";
$date = $generator->procMtime($black['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
?>
+16
View File
@@ -0,0 +1,16 @@
<div id="build" class="gid13"><a href="#" onClick="return Popup(13,4);" class="build_logo">
<img class="building g13" src="img/x.gif" alt="Armoury" title="Armoury" />
</a>
<h1>Armoury <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">In the armoury&#39;s melting furnaces your warriors&#39; armour is enhanced. By increasing its level you can order the fabrication of even better armour.
<?php
if ($building->getTypeLevel(13) > 0) {
include("13_upgrades.tpl");
} else {
echo "<p><b>Upgrades can commence when armoury is completed.</b><br>\n";
}
include("upgrade.tpl");
?>
</p>
</div>
+78
View File
@@ -0,0 +1,78 @@
<table cellpadding="1" cellspacing="1" class="build_details">
<thead>
<tr>
<td>Armoury</td>
<td>Action</td>
</tr>
</thead>
<tbody>
<tr>
<?php
$abdata = $database->getABTech($village->wid);
$ABups = $technology->getABUpgrades('a');
for($i=($session->tribe*10-9);$i<=($session->tribe*10-2);$i++) {
$j = $i % 10 ;
if ( $technology->getTech($i) || $j == 1 ) {
echo "<tr><td class=\"desc\"><div class=\"tit\">
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> (Level ".$abdata['a'.$j].")
</div>";
if($abdata['a'.$j] != 20) {
echo "<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'ab'.$i}[$abdata['a'.$j]+1]['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'ab'.$i}[$abdata['a'.$j]+1]['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'ab'.$i}[$abdata['a'.$j]+1]['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'ab'.$i}[$abdata['a'.$j]+1]['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round(${'ab'.$i}[$abdata['a'.$j]+1]['time']*($bid13[$building->getTypeLevel(13)]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'ab'.$i}[$abdata['a'.$j]+1]['wood']."&r2=".${'ab'.$i}[$abdata['a'.$j]+1]['clay']."&r3=".${'ab'.$i}[$abdata['a'.$j]+1]['iron']."&r4=".${'ab'.$i}[$abdata['a'.$j]+1]['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
}
if($abdata['a'.$j] == 20) {
echo "<td class=\"act\"><div class=\"none\">Maximum<br>level</div></td></tr>";
}
else if(${'ab'.$i}[$abdata['a'.$j]+1]['wood'] > $village->maxstore || ${'ab'.$i}[$abdata['a'.$j]+1]['clay'] > $village->maxstore || ${'ab'.$i}[$abdata['a'.$j]+1]['iron'] > $village->maxstore) {
echo "<td class=\"act\"><div class=\"none\">Expand<br>warehouse</div></td></tr>";
}
else if (${'ab'.$i}[$abdata['a'.$j]+1]['crop'] > $village->maxcrop) {
echo "<td class=\"act\"><div class=\"none\">Expand<br>granary</div></td></tr>";
}
else if (${'ab'.$i}[$abdata['a'.$j]+1]['wood'] > $village->awood || ${'ab'.$i}[$abdata['a'.$j]+1]['clay'] > $village->aclay || ${'ab'.$i}[$abdata['a'.$j]+1]['iron'] > $village->airon || ${'ab'.$i}[$abdata['a'.$j]+1]['crop'] > $village->acrop) {
if($village->getProd("crop")>0 || $village->acrop > ${'ab'.$i}[$abdata['a'.$j]+1]['crop']){
$time = $technology->calculateAvaliable(13,${'ab'.$i}[$abdata['a'.$j]+1]);
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
} else {
echo "<br><span class=\"none\">Crop production is negative so you will never reach the required resources</span></div></td>";
}
echo "<td class=\"act\"><div class=\"none\">Too few<br>resources</div></td></tr>";
}
else if ($building->getTypeLevel(13) <= $abdata['a'.$j]) {
echo "<td class=\"act\"><div class=\"none\">Upgrade<br>armoury</div></td></tr>";
}
else if (count($ABups) > 0) {
echo "<td class=\"act\"><div class=\"none\">Upgrade in<br>progress</div></td></tr>";
}
else if($session->access != BANNED){
echo "<td class=\"act\"><a class=\"research\" href=\"build.php?id=$id&amp;a=$j&amp;c=".$session->mchecker."\">Upgrade</a></td></tr>";
}else{
echo "<td class=\"act\"><a class=\"research\" href=\"banned.php\">Upgrade</a></td></tr>";
}
}
}
?>
</tbody>
</table>
<?php
if(count($ABups) > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Upgrading</td><td>Duration</td><td>Complete</td></tr>
</thead><tbody>";
$timer = 1;
foreach($ABups as $arms) {
$unit = ($session->tribe-1)*10 + substr($arms['tech'],1,2);
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($arms['timestamp']-time())."</span></td>";
$date = $generator->procMtime($arms['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
?>
+37
View File
@@ -0,0 +1,37 @@
<?php
include("next.tpl");
?>
<div id="build" class="gid14"><a href="#" onClick="return Popup(14,4);" class="build_logo">
<img class="building g14" src="img/x.gif" alt="Tournament Square" title="Tournament Square" />
</a>
<h1>Tournament Square <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">At the Tournament Square your troops can train their stamina. The further the building is upgraded the faster your troops are beyond a minimum distance of <?php echo TS_THRESHOLD ?> squares.</p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th>Current speed bonus:</th>
<td><b><?php echo $bid14[$village->resarray['f'.$id]]['attri']; ?></b> Percent</td>
</tr>
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Speed bonus at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid14[$next]['attri']; ?></b> Percent</td>
<?php
}else{
?>
<th>Speed bonus at level 20:</th>
<td><b><?php echo $bid14[20]['attri']; ?></b> Percent</td>
<?php
}}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+41
View File
@@ -0,0 +1,41 @@
<?php
include("next.tpl");
?>
<div id="build" class="gid15"><a href="#" onClick="return Popup(15,4);" class="build_logo">
<img class="building g15" src="img/x.gif" alt="Main Building" title="Main Building" />
</a>
<h1>Main Building <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">In the main building the village's master builders live. The higher its level the faster your master builders complete the construction of new buildings.</p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th>Current construction time:</th>
<td><b><?php echo round($bid15[$village->resarray['f'.$id]]['attri']); ?></b> Percent</td>
</tr>
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Construction time at level <?php echo $next; ?>:</th>
<td><b><?php echo round($bid15[$next]['attri']); ?></b> Percent</td>
<?php
}else{
?>
<th>Construction time at level 20:</th>
<td><b><?php echo round($bid15[20]['attri']); ?></b> Percent</td>
<?php
}}
?>
</tr>
</table>
<?php
if($village->resarray['f'.$id] >= 10){
include("Templates/Build/15_1.tpl");
}
include("upgrade.tpl");
?>
</p></div>
+56
View File
@@ -0,0 +1,56 @@
<?php
if($_REQUEST["cancel"] == "1") {
if($session->access != BANNED){
$database->delDemolition($village->wid);
header("Location: build.php?gid=15&amp;cancel=0&amp;demolish=0");
}else{
header("Location: banned.php");
}
}
if(!empty($_REQUEST["demolish"]) && $_REQUEST["c"] == $session->mchecker) {
if($session->access != BANNED){
if($_REQUEST["type"] != null) {
$type = $_REQUEST['type'];
$database->addDemolition($village->wid,$type);
$session->changeChecker();
header("Location: build.php?gid=15&amp;cancel=0&amp;demolish=0");
}
}else{
header("Location: banned.php");
}
}
if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) {
echo "<h2>Demolition of the building:</h2><p>If you no longer need a building, you can order the demolition of the building.</p>";
$VillageResourceLevels = $database->getResourceLevel($village->wid);
$DemolitionProgress = $database->getDemolition($village->wid);
if (!empty($DemolitionProgress)) {
$Demolition = $DemolitionProgress[0];
echo "<b>";
echo "<a href='build.php?id=26&cancel=1'><img src='img/x.gif' class='del' title='cancel' alt='cancel'></a> ";
echo "Demolition of ".$building->procResType($VillageResourceLevels['f'.$Demolition['buildnumber'].'t']).": <span id=timer1>".$generator->getTimeFormat($Demolition['timetofinish']-time())."</span>";
if($session->gold >= 2) {
if($session->access!=BANNED){
?> <a href="?buildingFinish=1" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="Finish all construction and research orders in this village immediately for 2 Gold?"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
<?php
}else{
?> <a href="banned.php" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="Finish all construction and research orders in this village immediately for 2 Gold?"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
<?php
}
}
echo "</b>";
} else {
echo "
<form action=\"build.php?gid=15&amp;demolish=1&amp;cancel=0&amp;c=".$session->mchecker."\" method=\"POST\" style=\"display:inline\">
<select name=\"type\" class=\"dropdown\">";
for ($i=19; $i<=41; $i++) {
if ($VillageResourceLevels['f'.$i] >= 1 && !$building->isCurrent($i) && !$building->isLoop($i)) {
echo "<option value=".$i.">".$i.". ".$building->procResType($VillageResourceLevels['f'.$i.'t'])." (lvl ".$VillageResourceLevels['f'.$i].")</option>";
}
}
echo "</select><input id=\"btn_demolish\" name=\"demolish\" class=\"dynamic_img\" value=\"Demolish\" type=\"image\" src=\"img/x.gif\" alt=\"Demolish\" title=\"Demolish\" /></form>";
}
}
?>
+249
View File
@@ -0,0 +1,249 @@
<div id="build" class="gid16"><a href="#" onClick="return Popup(16,4);" class="build_logo">
<img class="g16" src="img/x.gif" alt="Rally point" title="Rally point" />
</a>
<h1>Rally point <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">Your village's troops meet here. From here you can send them out to conquer, raid or reinforce other villages.</p>
<div id="textmenu">
<a href="build.php?id=<?php echo $id; ?>">Overview</a> |
<a href="a2b.php">Send troops</a> |
<a href="warsim.php">Combat Simulator</a> <?php if($session->goldclub==1){ ?>|
<a href="build.php?id=<?php echo $id; ?>&amp;t=99">Gold Club</a>
<?php } ?>
</div>
<?php
$units_type = $database->getMovement("34",$village->wid,1);
$settlers = $database->getMovement("7",$village->wid,1);
$units_incoming = count($units_type);
$settlers_incoming = count($settlers);
for($i=0;$i<$units_incoming;$i++){
if($units_type[$i]['attack_type'] == 1 && $units_type[$i]['sort_type'] == 3)
$units_incoming -= 1;
}
if($units_incoming > 0 or $settlers_incoming > 0){
?>
<h4>Incoming troops (<?php echo $units_incoming; ?>)</h4>
<?php include("16_incomming.tpl");
}
?>
<h4>Troops in the village</h4>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<td class="role"><a href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td><td colspan="<?php if($village->unitarray['hero'] == 0) {echo"10";}else{echo"11";}?>">
<a href="spieler.php?uid=<?php echo $session->uid; ?>">Own troops</a></td></tr></thead>
<tbody class="units">
<?php include("16_troops.tpl");
?>
</tbody></table>
<?php
if(count($village->enforcetome) > 0) {
foreach($village->enforcetome as $enforce) {
$colspan = 10+$enforce['hero'];
if($enforce['from']!=0){
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'],"name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'],"owner")."\">".$database->getUserField($database->getVillageField($enforce['from'],"owner"),"username",0)." troops</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($enforce['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($enforce['hero']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=$start;$i<=($start+9);$i++) {
if($enforce['u'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $enforce['u'.$i]."</td>";
}
if($enforce['hero']!=0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><a href='a2b.php?w=".$enforce['id']."'>Send back</a></div></td></tr>";
echo "</tbody></table>";
}else{
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a>Taskmaster</a></td>
<td colspan=\"$colspan\">";
echo "<a> village of the elders troops</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = 4;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($enforce['hero']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=$start;$i<=($start+9);$i++) {
if($enforce['u'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $enforce['u'.$i]."</td>";
}
if($enforce['hero']!=0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><span class=none><b>Send back</b></span></div></td></tr>";
echo "</tbody></table>";
}
}
}
if(count($village->enforcetoyou) > 0) {
echo "<h4>Troops in other village</h4>";
foreach($village->enforcetoyou as $enforce) {
$colspan = 10+$enforce['hero'];
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['vref'])."\">".$database->getVillageField($enforce['vref'],"name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'],"owner")."\">".$database->getUserField($database->getVillageField($enforce['from'],"owner"),"username",0)." troops</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($enforce['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($enforce['hero']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=$start;$i<=($start+9);$i++) {
if($enforce['u'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $enforce['u'.$i]."</td>";
}
if($enforce['hero']!=0){
echo "<td>".$enforce['hero']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>Send back</a></div></td></tr>";
echo "</tbody></table>";
}
}
if(count($database->getPrisoners3($village->wid)) > 0) {
echo "<h4>Prisoners</h4>";
foreach($database->getPrisoners3($village->wid) as $prisoners) {
$colspan = 10+$prisoners['t11'];
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".$database->getVillageField($prisoners['wref'],"name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">prisoners in ".$database->getVillageField($prisoners['wref'],"name")."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($prisoners['t11']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=1;$i<=10;$i++) {
if($prisoners['t'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $prisoners['t'.$i]."</td>";
}
if($prisoners['t11']!=0){
echo "<td>".$prisoners['t11']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($prisoners,$tribe,0,1)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>Kill</a></div></td></tr>";
echo "</tbody></table>";
}
}
if(count($database->getPrisoners($village->wid)) > 0) {
echo "<h4>Prisoners</h4>";
foreach($database->getPrisoners($village->wid) as $prisoners) {
$colspan = 10+$prisoners['t11'];
$colspan2 = 11+$prisoners['t11'];
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".$database->getVillageField($prisoners['from'],"name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">prisoners from ".$database->getVillageField($prisoners['from'],"name")."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($prisoners['t11']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=1;$i<=10;$i++) {
if($prisoners['t'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $prisoners['t'.$i]."</td>";
}
if($prisoners['t11']!=0){
echo "<td>".$prisoners['t11']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><td colspan=\"11\"><div class='sup'><img class=\"r6\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" /></div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>Send Back</a></div></td></tr>";
echo "</tbody></table>";
}
}
?>
<?php
$units_type = $database->getMovement("3",$village->wid,0);
$settlers = $database->getMovement("5",$village->wid,0);
$units_incoming = count($units_type);
for($i=0;$i<$units_incoming;$i++){
if($units_type[$i]['vref'] != $village->wid)
$units_incoming -= 1;
}
$units_incoming += count($settlers);
if($units_incoming >= 1){
echo "<h4>Troops on their way</h4>";
include("16_walking.tpl");
}
include("upgrade.tpl");
?>
</p></div>
+78
View File
@@ -0,0 +1,78 @@
<?php
if(!$session->goldclub) {
include "Templates/Build/16.tpl";
}else{
?>
<div id="build" class="gid16"><a href="#" onClick="return Popup(16,4);" class="build_logo">
<img class="g16" src="img/x.gif" alt="Rally point" title="Rally point" />
</a>
<h1>Rally point <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">Your village's troops meet here. From here you can send them out to conquer, raid or reinforce other villages.</p>
<div id="textmenu">
<a href="build.php?id=<?php echo $id; ?>">Overview</a> |
<a href="a2b.php">Send troops</a> |
<a href="warsim.php">Combat Simulator</a> <?php if($session->goldclub==1){ ?>|
<a href="build.php?id=<?php echo $id; ?>&amp;t=99">Gold Club</a>
<?php } ?>
</div>
<div id="raidList">
<?php include "Templates/goldClub/farmlist.tpl"; ?>
</div>
<br />
<?php if($hideevasion == 0){ ?>
<table cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="4">evasion settings</th>
</tr>
<tr>
<td></td>
<td>village</td>
<td>own troops</td>
<td>reinforcement</td>
</tr>
</thead>
<tbody>
<?php
for($i=0;$i<=count($session->villages)-1;$i++) {
$wref = $session->villages[$i];
$vname = $database->getVillageField($wref,"name");
$vchecked = $database->getVillageField($wref,"evasion");
$reinf = $database->getEnforceVillage($wref,0);
if($vchecked == 1){ $checked = 'checked'; }else{ $checked = ''; }
?>
<tr>
<td><input type="checkbox" class="check" name="hideShow" onclick="window.location.href = '?gid=16&t=99&evasion=<?php echo $wref;?>';" <?php echo $checked; ?>></td>
<td><?php echo $vname; ?></td>
<td><?php echo $database->getUnitsNumber($wref); ?></td>
<td><?php echo count($reinf); ?></td>
</tr>
<?php
}
$user = $database->getUserArray($session->uid, 1);
?>
</tbody>
</table>
<form action="build.php?id=39&t=99" method="POST">
<br />
<tr>
Send troops away a maximun of <input class="text" type="text" name="maxevasion" value="<?php echo $user['maxevasion']; ?>" maxlength="3" style="width:50px;"> times
<span class="none">(costs: <img src="<?php echo GP_LOCATE; ?>img/a/gold_g.gif" alt="Gold" title="Gold"/><b>2</b> per evasion)</span>
</tr>
<tr>
<div class="clear"></div><p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK"/></p></form>
</tr>
</form>
<?php } ?>
</div>
<?php } ?>
+276
View File
@@ -0,0 +1,276 @@
<?php
include_once("GameEngine/Data/unitdata.php");
$units = $database->getMovement("34",$village->wid,1);
$total_for = count($units);
$send = $database->getMovement("1",$village->wid,1);
$total_for2 = count($send);
for($y=0;$y < $total_for;$y++){
for($i=0;$i < $total_for2;$i++){
if($units[$y]['ref'] == $send[$i]['ref2']){
$res1 = mysql_query("SELECT * FROM " . TB_PREFIX . "send where id = ".$send[$i]['ref']."");
$res = mysql_fetch_array($res1);
}
}
$timer = $y+1;
if ($units[$y]['sort_type']==3){
if ($units[$y]['attack_type']==3){
$actionType = "Attack on ";
} else if ($units[$y]['attack_type']==4){
$actionType = "Raid on ";
}
$reinfowner = $database->getVillageField($units[$y]['from'],"owner");
if($units[$y]['attack_type'] != 1){
if($units[$y]['from'] != 0){
if($units[$y]['t11'] != 0 && $reinfowner == $session->uid) {
$colspan = 11;
}else{
$colspan = 10;
}
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$units[$y]['from']."&c=".$generator->getMapCheck($units[$y]['from'])."\">".$database->getVillageField($units[$y]['from'],"name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"spieler.php?uid=".$database->getVillageField($units[$y]['from'],"owner")."\">".$database->getUserField($database->getVillageField($units[$y]['from'],"owner"),"username",0)."'s troops</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($units[$y]['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($units[$y]['t11'] != 0 && $reinfowner == $session->uid) {
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=1;$i<=$colspan;$i++) {
$totalunits = $units[$y]['t1']+$units[$y]['t2']+$units[$y]['t3']+$units[$y]['t4']+$units[$y]['t5']+$units[$y]['t6']+$units[$y]['t7']+$units[$y]['t8']+$units[$y]['t9']+$units[$y]['t10']+$units[$y]['t11'];
if($units[$y]['attack_type'] == 2){
if($reinfowner != $session->uid){
echo "<td class=\"none\">?</td>";
}else{
if($units[$y]['t'.$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>";
echo $units[$y]['t'.$i]."</td>";
}
}}else{
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,3,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,3,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,3,2,0));
$total_artefact = $artefact + $artefact1 + $artefact2;
if($totalunits > $building->getTypeLevel(16) && $total_artefact == 0){
echo "<td class=\"none\">?</td>";
}else{
if($units[$y]['t'.$i] == 0) {
echo "<td class=\"none\">0</td>";
}else{
echo "<td>?</td>";
}
}
}
}
echo "</tr></tbody>";
echo '
<tbody class="infos">
<tr>
<th>Arrival</th>
<td colspan="10">
<div class="in small"><span id=timer'.$timer.'>'.$generator->getTimeFormat($units[$y]['endtime']-time()).'</span> h</div>';
$datetime = $generator->procMtime($units[$y]['endtime']);
echo "<div class=\"at small\">";
if($datetime[0] != "today") {
echo "on ".$datetime[0]." ";
}
echo "at ".$datetime[1]." hours</div>
</div>
</td>
</tr>
</tbody>";
echo "</table>";
}else{
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a>village of the elders</a></td>
<td colspan=\"10\">";
echo "<a>Taskmaster's troops</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $session->tribe;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=1;$i<=10;$i++) {
echo "<td class=\"none\">?</td>";
}
echo "</tr></tbody>";
echo '
<tbody class="infos">
<tr>
<th>Arrival</th>
<td colspan="10">
<div class="in small"><span id=timer'.$timer.'>'.$generator->getTimeFormat($units[$y]['endtime']-time()).'</span> h</div>';
$datetime = $generator->procMtime($units[$y]['endtime']);
echo "<div class=\"at small\">";
if($datetime[0] != "today") {
echo "on ".$datetime[0]." ";
}
echo "at ".$datetime[1]."</div>
</div>
</td>
</tr>
</tbody>";
echo "</table>";
}
}
}else if ($units[$y]['sort_type']==4){
if ($units[$y]['attack_type']==1){
$actionType = "Return from ";
} else if ($units[$y]['attack_type']==2){
$actionType = "Reinforment for ";
} else if ($units[$y]['attack_type']==3){
$actionType = "Return from ";
} else if ($units[$y]['attack_type']==4){
$actionType = "Return from ";
}
$to = $database->getMInfo($units[$y]['vref']);
?>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<td class="role"><a href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
<td colspan="<?php if($units[$y]['t11'] != 0) {echo"11";}else{echo"10";}?>"><a href="karte.php?d=<?php echo $to['wref']."&c=".$generator->getMapCheck($to['wref']); ?>"><?php echo "Returning to ".$to['name']; ?></a></td>
</tr>
</thead>
<tbody class="units">
<?php
$tribe = $session->tribe;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($units[$y]['t11'] != 0) {
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
?>
</tr>
<tr><th>Troops</th>
<?php
for($i=1;$i<($units[$y]['t11'] != 0?12:11);$i++) {
if($units[$y]['t'.$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>";
echo $units[$y]['t'.$i]."</td>";
}
}
?>
</tr>
<?php
$totalres = $res['wood']+$res['clay']+$res['iron']+$res['crop'];
if($units[$y]['attack_type']!=2 and $units[$y]['attack_type']!=1 and $totalres != ""){?>
<tr><th>Bounty</th>
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
<?php
$totalcarry = $units[$y]['t1']*${'u'.$start.''}['cap']+$units[$y]['t2']*${'u'.($start+1).''}['cap']+$units[$y]['t3']*${'u'.($start+2).''}['cap']+$units[$y]['t4']*${'u'.($start+3).''}['cap']+$units[$y]['t5']*${'u'.($start+4).''}['cap']+$units[$y]['t6']*${'u'.($start+5).''}['cap']+$units[$y]['t7']*${'u'.($start+6).''}['cap']+$units[$y]['t8']*${'u'.($start+7).''}['cap']+$units[$y]['t9']*${'u'.($start+8).''}['cap']+$units[$y]['t10']*${'u'.($start+9).''}['cap'];
echo "<div class=\"in small\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".$res['wood']."<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$res['clay']."<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$res['iron']."<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$res['crop']."</div>";
echo "<div class=\"in small\"><img class=\"car\" src=\"gpack/travian_default/img/a/car.gif\" alt=\"carry\" title=\"carry\"/>".$totalres."/".$totalcarry."</div>";
?>
</tr>
<?php } ?>
<tbody class="infos">
<tr>
<th>Arrival</th>
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
<?php
echo "<div class=\"in small\"><span id=timer".$timer.">".$generator->getTimeFormat($units[$y]['endtime']-time())."</span> h</div>";
$datetime = $generator->procMtime($units[$y]['endtime']);
echo "<div class=\"at small\">";
if($datetime[0] != "today") {
echo "on ".$datetime[0]." ";
}
echo "at ".$datetime[1]."</div>";
?>
</div>
</td>
</tr>
</tbody>
</table>
<?php
}
}
$settlers = $database->getMovement("7",$village->wid,1);
$total_for3 = count($settlers);
for($x=0;$x < $total_for3;$x++){
$timer = $x+1;
$to = $database->getMInfo($settlers[$x]['to']);
?>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<td class="role"><a href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
<td colspan="10"><a href="karte.php?d=<?php echo $to['wref']."&c=".$generator->getMapCheck($to['wref']); ?>"><?php echo "Returning to ".$to['name']; ?></a></td>
</tr>
</thead>
<tbody class="units">
<?php
$tribe = $session->tribe;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
?>
</tr>
<tr><th>Troops</th>
<?php
for($z=1;$z<=9;$z++) {
$settlers[$x]['t'.$z]=0;
}
$settlers[$x]['t10']=3;
for($i=1;$i<11;$i++) {
if($settlers[$x]['t'.$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>";
echo $settlers[$x]['t'.$i]."</td>";
}
}
?>
</tr>
<tbody class="infos">
<tr>
<th>Arrival</th>
<td colspan="10">
<?php
echo "<div class=\"in small\"><span id=timer".$timer.">".$generator->getTimeFormat($settlers[$x]['endtime']-time())."</span> h</div>";
$datetime = $generator->procMtime($settlers[$x]['endtime']);
echo "<div class=\"at small\">";
if($datetime[0] != "today") {
echo "on ".$datetime[0]." ";
}
echo "at ".$datetime[1]."</div>";
?>
</div>
</td>
</tr>
</tbody>
</table>
<?php } ?>
+34
View File
@@ -0,0 +1,34 @@
<?php
$tribe = $session->tribe;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($village->unitarray['hero'] != 0) {
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
?>
</tr><tr><th>Troops</th>
<?php
for($i=$start;$i<=$end;$i++) {
if($village->unitarray['u'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $village->unitarray['u'.$i]."</td>";
}
if($village->unitarray['hero'] != 0) {
echo "<td>";
echo $village->unitarray['hero']."</td>";
}
?>
</tr></tbody>
<tbody class="infos"><tr><th>Upkeep</th>
<td colspan="<?php if($village->unitarray['hero'] == 0) {echo"10";}else{echo"11";}?>"><?php echo $technology->getUpkeep($village->unitarray,0); ?><img class="r4" src="img/x.gif" title="Crop" alt="Crop" />per hour</td></tr>
+155
View File
@@ -0,0 +1,155 @@
<?php
$units = $database->getMovement(3,$village->wid,0);
$total_for = count($units);
for($y=0;$y<$total_for;$y++){
$timer += 1;
if($units[$y]['attack_type'] == 2){
$attack_type = "Reinforcing";
}
if($units[$y]['attack_type'] == 1){
$attack_type = "Scouting";
}
if($units[$y]['attack_type'] == 3){
$attack_type = "Attack to";
}
if($units[$y]['attack_type'] == 4){
$attack_type = "Raid to";
}
$isoasis = $database->isVillageOases($units[$y]['to']);
if ($isoasis ==0){
$to = $database->getMInfo($units[$y]['to']);
} else {
$to = $database->getOMInfo($units[$y]['to']);}
?>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<td class="role"><a href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>"><a href="karte.php?d=<?php echo $to['wref']."&c=".$generator->getMapCheck($to['wref']); ?>"><?php echo $attack_type." ".$to['name']; ?></a></td>
</tr>
</thead>
<tbody class="units">
<?php
echo "<tr><th>&nbsp;</th>";
for($i=($session->tribe-1)*10+1;$i<=$session->tribe*10;$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($units[$y]['t11'] != 0) {
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
?>
</tr>
<tr><th>Troops</th>
<?php
if($units[$y]['t11'] != 0) {
$end = 12;
}else{
$end = 11;
}
for($i=1;$i<$end;$i++) {
if($units[$y]['t'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $units[$y]['t'.$i]."</td>";
}
?>
</tr></tbody>
<tbody class="infos">
<tr>
<th>Arrival</th>
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
<?php
echo "<div class=\"in small\"><span id=timer$timer>".$generator->getTimeFormat($units[$y]['endtime']-time())."</span> h</div>";
$datetime = $generator->procMtime($units[$y]['endtime']);
echo "<div class=\"at small\">";
if($datetime[0] != "today") {
echo "on ".$datetime[0]." ";
}
echo "at ".$datetime[1]."</div>";
if (($units[$y]['starttime']+90)>time()){
?>
<div class="abort"><a href="build.php?id=<?php echo $_GET['id']."&mode=troops&cancel=1&moveid=".$units[$y]['moveid']; ?>"><img src="img/x.gif" class="del" /></a></div>
<?php } ?>
</div>
</td>
</tr>
</tbody>
</table>
<?php
}
?>
<?php
$settlers = $database->getMovement(5,$village->wid,0);
if($settlers){
$total_for = count($settlers);
for($y=0;$y<$total_for;$y++){
$timer += 1;
?>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<td class="role"><a href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
<td colspan="10"><a href="karte.php?d=<?php echo $settlers[$y]['to']."&c=".$generator->getMapCheck($settlers[$y]['to']); ?>">Found new village</a></td>
</tr>
</thead>
<tbody class="units">
<?php
$tribe = $session->tribe;
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
?>
</tr>
<tr><th>Troops</th>
<?php
for($x=1;$x<=9;$x++) {
$units[$y]['t'.$x]=0;
}
$units[$y]['t10']=3;
for($i=1;$i<=10;$i++) {
if($units[$y]['t'.$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>";
echo $units[$y]['t'.$i]."</td>";
}
}
?>
</tr></tbody>
<tbody class="infos">
<tr>
<th>Arrival</th>
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
<?php
echo "<div class=\"in small\"><span id=timer$timer>".$generator->getTimeFormat($settlers[$y]['endtime']-time())."</span> h</div>";
$datetime = $generator->procMtime($settlers[$y]['endtime']);
echo "<div class=\"at small\">";
if($datetime[0] != "today") {
echo "on ".$datetime[0]." ";
}
echo "at ".$datetime[1]."</div>";
if (($units[$y]['starttime']+90)>time()){
?>
<div class="abort"><a href="build.php?id=<?php echo $_GET['id']."&mode=troops&cancel=1&moveid=".$units[$y]['moveid']; ?>"><img src="img/x.gif" class="del" /></a></div>
<?php } ?>
</div>
</td>
</tr>
</tbody>
</table>
<?php
}
}
?>
+299
View File
@@ -0,0 +1,299 @@
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
<img class="building g17" src="img/x.gif" alt="Marketplace" title="Marketplace" />
</a>
<h1>Marketplace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">At the Marketplace you can trade resources with other players. The higher its level, the more resources can be transported at the same time.
</p>
<?php include("17_menu.tpl"); ?>
<script language="JavaScript">
<!--
var haendler = <?php echo $market->merchantAvail(); ?>;
var carry = <?php echo $market->maxcarry; ?>;
//-->
</script>
<?php
$allres = $_POST['r1']+$_POST['r2']+$_POST['r3']+$_POST['r4'];
if($_POST['x']!="" && $_POST['y']!="" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){
$getwref = $database->getVilWref($_POST['x'],$_POST['y']);
$checkexist = $database->checkVilExist($getwref);
}
else if($_POST['dname']!=""){
$getwref = $database->getVillageByName($_POST['dname']);
$checkexist = $database->checkVilExist($getwref);
}
if($checkexist){
$villageOwner = $database->getVillageField($getwref,'owner');
$userAccess = $database->getUserField($villageOwner,'access',0);
}
$maxcarry = $market->maxcarry;
$maxcarry *= $market->merchantAvail();
if(isset($_POST['ft'])=='check' && $allres!=0 && $allres <= $maxcarry && ($_POST['x']!="" && $_POST['y']!="" or $_POST['dname']!="") && $checkexist){
?>
<form method="POST" name="snd" action="build.php">
<input type="hidden" name="ft" value="mk1">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<input type="hidden" name="send3" value="<?php echo $_POST['send3']; ?>">
<table id="send_select" class="send_res" cellpadding="1" cellspacing="1">
<tr>
<td class="ico"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /></td>
<td class="nam"> Wood</td>
<td class="val"><input class="text disabled" type="text" name="r1" id="r1" value="<?php echo $_POST['r1']; ?>" readonly="readonly"></td>
<td class="max"> / <span class="none"><B><?php echo $market->maxcarry; ?></B></span> </td>
</tr>
<tr>
<td class="ico"><img class="r2" src="img/x.gif" alt="Clay" title="Clay" /></td>
<td class="nam"> Clay</td>
<td class="val"><input class="text disabled" type="text" name="r2" id="r2" value="<?php echo $_POST['r2']; ?>" readonly="readonly"></td>
<td class="max"> / <span class="none"><b><?php echo$market->maxcarry; ?></b></span> </td>
</tr>
<tr>
<td class="ico"><img class="r3" src="img/x.gif" alt="Iron" title="Iron" /></td>
<td class="nam"> Iron</td>
<td class="val"><input class="text disabled" type="text" name="r3" id="r3" value="<?php echo $_POST['r3']; ?>" readonly="readonly">
</td>
<td class="max"> / <span class="none"><b><?php echo $market->maxcarry; ?></b></span> </td>
</tr>
<tr>
<td class="ico"><img class="r4" src="img/x.gif" alt="Crop" title="Crop" /></td>
<td class="nam"> Wheat</td>
<td class="val"> <input class="text disabled" type="text" name="r4" id="r4" value="<?php echo $_POST['r4']; ?>" readonly="readonly">
</td>
<td class="max"> / <span class="none"><B><?php echo $market->maxcarry; ?></B></span></td>
</tr></table>
<table id="target_validate" class="res_target" cellpadding="1" cellspacing="1">
<tbody><tr>
<th>Coordinates:</th>
<?php
if($_POST['x']!="" && $_POST['y']!="" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){
$getwref = $database->getVilWref($_POST['x'],$_POST['y']);
$getvilname = $database->getVillageField($getwref, "name");
$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);
}
?>
<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>
<th>Player:</th>
<td><a href="spieler.php?uid=<?php echo $getvilowner; ?>"><?php echo $database->getUserField($getvilowner,username,0); ?></a></td>
</tr>
<tr>
<th>duration:</th>
<td><?php echo $generator->getTimeFormat($time); ?></td>
</tr>
<tr>
<th>Merchants:</th>
<td><?php
$resource = array($_POST['r1'],$_POST['r2'],$_POST['r3'],$_POST['r4']);
echo ceil((array_sum($resource)-0.1)/$market->maxcarry); ?></td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
</tbody></table>
<input type="hidden" name="getwref" value="<?php echo $getwref; ?>">
<div class="clear"></div>
<p>
<div class="clear"></div><p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK" <?php if(!$market->merchantAvail()) { echo "DISABLED"; }?>/></p></form>
<?php }else{ ?>
<form method="POST" name="snd" action="build.php">
<input type="hidden" name="ft" value="check">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<table id="send_select" class="send_res" cellpadding="1" cellspacing="1"><tr>
<td class="ico">
<a href="#" onClick="upd_res(1,1); return false;"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /></a>
</td>
<td class="nam">
Lumber:
</td>
<td class="val">
<input class="text" type="text" name="r1" id="r1" value="" maxlength="5" onKeyUp="upd_res(1)" tabindex="1">
</td>
<td class="max">
<a href="#" onMouseUp="add_res(1);" onClick="return false;">(<?php echo $market->maxcarry; ?>)</a>
</td>
</tr><tr>
<td class="ico">
<a href="#" onClick="upd_res(2,1); return false;"><img class="r2" src="img/x.gif" alt="Clay" title="Clay" /></a>
</td>
<td class="nam">
Clay:
</td>
<td class="val">
<input class="text" type="text" name="r2" id="r2" value="" maxlength="5" onKeyUp="upd_res(2)" tabindex="2">
</td>
<td class="max">
<a href="#" onMouseUp="add_res(2);" onClick="return false;">(<?php echo$market->maxcarry; ?>)</a>
</td>
</tr><tr>
<td class="ico">
<a href="#" onClick="upd_res(3,1); return false;"><img class="r3" src="img/x.gif" alt="Iron" title="Iron" /></a>
</td>
<td class="nam">
Iron:
</td>
<td class="val">
<input class="text" type="text" name="r3" id="r3" value="" maxlength="5" onKeyUp="upd_res(3)" tabindex="3">
</td>
<td class="max">
<a href="#" onMouseUp="add_res(3);" onClick="return false;">(<?php echo $market->maxcarry; ?>)</a>
</td>
</tr><tr>
<td class="ico">
<a href="#" onClick="upd_res(4,1); return false;"><img class="r4" src="img/x.gif" alt="Crop" title="Crop" /></a>
</td>
<td class="nam">
Crop:
</td>
<td class="val">
<input class="text" type="text" name="r4" id="r4" value="" maxlength="5" onKeyUp="upd_res(4)" tabindex="4">
</td>
<td class="max">
<a href="#" onMouseUp="add_res(4);" onClick="return false;">(<?php echo $market->maxcarry; ?>)</a>
</td>
</tr></table>
<table id="target_select" class="res_target" cellpadding="1" cellspacing="1">
<tr>
<td class="mer">Merchants <?php echo $market->merchantAvail(); ?>/<?php echo $market->merchant; ?></td>
</tr>
<td class="vil">
<span>Villages:</span>
<input class="text" type="text" name="dname" value="" maxlength="30" tabindex="5">
</td>
<tr>
<td class="or">or</td>
</tr>
<tr>
<?php
if(isset($_GET['z'])){
$coor = $database->getCoor($_GET['z']);
}
else{
$coor['x'] = "";
$coor['y'] = "";
}
?>
<td class="coo">
<span>X:</span><input class="text" type="text" name="x" value="<?php echo $coor['x']; ?>" maxlength="4" tabindex="6">
<span>Y:</span><input class="text" type="text" name="y" value="<?php echo $coor['y']; ?>" maxlength="4" tabindex="7">
</td>
</tr>
</table>
<div class="clear"></div>
<?php if($session->goldclub == 1){?>
<p><select name="send3"><option value="1" selected="selected">1x</option><option value="2">2x</option><option value="3">3x</option></select>go</p>
<?php
}else{
?>
<input type="hidden" name="send3" value="1">
<?php
}
?>
<p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK" <?php if(!$market->merchantAvail()) { echo "DISABLED"; }?>/></p></form>
<?php
$error = '';
if(isset($_POST['ft'])=='check'){
if(!$checkexist){
$error = '<span class="error"><b>No Coordinates selected</b></span>';
}elseif($getwref == $village->wid){
$error = '<span class="error"><b>You cannot send resources to the same village</b></span>';
}elseif($userAccess == '0' or $userAccess == '8' or $userAccess == '9'){
$error = '<span class="error"><b>Player is Banned. You cannot send resources to him.</b></span>';
}elseif($_POST['r1']==0 && $_POST['r2']==0 && $_POST['r3']==0 && $_POST['r4']==0){
$error = '<span class="error"><b>Resources not selected.</b></span>';
}elseif(!$_POST['x'] && !$_POST['y'] && !$_POST['dname']){
$error = '<span class="error"><b>Enter coordinates or village name.</b></span>';
}elseif($allres > $maxcarry){
$error = '<span class="error"><b>Too few merchants.</b></span>';
}
echo $error;
}
?>
<p>
<?php } ?>
<p>Each merchant can carry <b><?php echo $market->maxcarry; ?></b> units of resource</p>
<?php
$timer = 1;
if(count($market->recieving) > 0) {
echo "<h4>Merchants coming:</h4>";
foreach($market->recieving as $recieve) {
echo "<table class=\"traders\" cellpadding=\"1\" cellspacing=\"1\">";
$villageowner = $database->getVillageField($recieve['from'],"owner");
echo "<thead><tr><td><a href=\"spieler.php?uid=$villageowner\">".$database->getUserField($villageowner,"username",0)."</a></td>";
echo "<td><a href=\"karte.php?d=".$recieve['from']."&c=".$generator->getMapCheck($recieve['from'])."\">Transport from ".$database->getVillageField($recieve['from'],"name")."</a></td>";
echo "</tr></thead><tbody><tr><th>Arrival in</th><td>";
echo "<div class=\"in\"><span id=timer$timer>".$generator->getTimeFormat($recieve['endtime']-time())."</span> h</div>";
$datetime = $generator->procMtime($recieve['endtime']);
echo "<div class=\"at\">";
if($datetime[0] != "today") {
echo "on ".$datetime[0]." ";
}
echo "at ".$datetime[1]."</div>";
echo "</td></tr></tbody> <tr class=\"res\"> <th>Resource</th> <td colspan=\"2\"><span class=\"f10\">";
echo "<img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".$recieve['wood']." | <img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$recieve['clay']." | <img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$recieve['iron']." | <img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$recieve['crop']."</td></tr></tbody>";
echo "</table>";
$timer +=1;
}
}
if(count($market->sending) > 0) {
echo "<h4>Own merchants on the way:</h4>";
foreach($market->sending as $send) {
$villageowner = $database->getVillageField($send['to'],"owner");
$ownername = $database->getUserField($villageowner,"username",0);
echo "<table class=\"traders\" cellpadding=\"1\" cellspacing=\"1\">";
echo "<thead><tr> <td><a href=\"spieler.php?uid=$villageowner\">$ownername</a></td>";
echo "<td><a href=\"karte.php?d=".$send['to']."&c=".$generator->getMapCheck($send['to'])."\">Transport to ".$database->getVillageField($send['to'],"name")."</a></td>";
echo "</tr></thead> <tbody><tr> <th>Arrival in</th> <td>";
echo "<div class=\"in\"><span id=timer".$timer.">".$generator->getTimeFormat($send['endtime']-time())."</span> h</div>";
$datetime = $generator->procMtime($send['endtime']);
echo "<div class=\"at\">";
if($datetime[0] != "today") {
echo "on ".$datetime[0]." ";
}
echo "at ".$datetime[1]."</div>";
echo "</td> </tr> <tr class=\"res\"> <th>Resource</th><td>";
echo "<img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".$send['wood']." | <img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$send['clay']." | <img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$send['iron']." | <img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$send['crop']."</td></tr></tbody>";
echo "</table>";
$timer += 1;
}
}
if(count($market->return) > 0) {
echo "<h4>Merchants returning:</h4>";
foreach($market->return as $return) {
$villageowner = $database->getVillageField($return['from'],"owner");
$ownername = $database->getUserField($villageowner,"username",0);
echo "<table class=\"traders\" cellpadding=\"1\" cellspacing=\"1\">";
echo "<thead><tr> <td><a href=\"spieler.php?uid=$villageowner\">$ownername</a></td>";
echo "<td><a href=\"karte.php?d=".$return['from']."&c=".$generator->getMapCheck($return['from'])."\">Return from ".$database->getVillageField($return['from'],"name")."</a></td>";
echo "</tr></thead> <tbody><tr> <th>Arrival in</th> <td>";
echo "<div class=\"in\"><span id=timer".$timer.">".$generator->getTimeFormat($return['endtime']-time())."</span> h</div>";
$datetime = $generator->procMtime($return['endtime']);
echo "<div class=\"at\">";
if($datetime[0] != "today") {
echo "on ".$datetime[0]." ";
}
echo "at ".$datetime[1]."</div>";
echo "</td> </tr>";
echo "</tbody></table>";
$timer += 1;
}
}
include("upgrade.tpl");
?>
</p></div>
+134
View File
@@ -0,0 +1,134 @@
<?php
if(isset($_GET['u'])) {
$u = $_GET['u'];
}
else {
$u=0;
}
?>
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
<img class="building g17" src="img/x.gif" alt="Marketplace" title="Marketplace" />
</a>
<h1>Marketplace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">At the Marketplace you can trade resources with other players. The higher its level, the more resources can be transported at the same time.
</p>
<?php include("17_menu.tpl");
if($session->plus) {
?>
<table id="search_select" class="buy_select" cellpadding="1" cellspacing="1">
<thead><tr>
<td colspan="4">I'm searching</td>
</tr></thead>
<tbody><tr>
<td <?php if(isset($_GET['s']) && $_GET['s'] == 1) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&s=1<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /></a></td>
<td <?php if(isset($_GET['s']) && $_GET['s'] == 2) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&s=2<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>"><img class="r2" src="img/x.gif" alt="Clay" title="Clay" /></a></td>
<td <?php if(isset($_GET['s']) && $_GET['s'] == 3) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&s=3<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>"><img class="r3" src="img/x.gif" alt="Iron" title="Iron" /></a></td>
<td <?php if(isset($_GET['s']) && $_GET['s'] == 4) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&s=4<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>"><img class="r4" src="img/x.gif" alt="Crop" title="Crop" /></a></td></tr></tbody>
</table><table id="ratio_select" class="buy_select" cellpadding="1" cellspacing="1">
<tbody>
<tr><td <?php if(isset($_GET['v'])) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&v=1:1<?php if(isset($_GET['s'])) echo "&s=".$_GET['s']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>">1:1</a></td>
</tr><tr><td <?php if(!isset($_GET['v'])) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1<?php if(isset($_GET['s'])) echo "&s=".$_GET['s']; if(isset($_GET['b'])) echo "&b=".$_GET['b']; ?>">1:x</a></td>
</tr>
</tbody>
</table>
<table id="bid_select" class="buy_select" cellpadding="1" cellspacing="1">
<thead><tr>
<td colspan="4">I'm offering</td>
</tr></thead>
<tbody><tr>
<td <?php if(isset($_GET['b']) && $_GET['b'] == 1) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&b=1<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['s'])) echo "&s=".$_GET['s']; ?>"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /></a></td>
<td <?php if(isset($_GET['b']) && $_GET['b'] == 2) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&b=2<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['s'])) echo "&s=".$_GET['s']; ?>"><img class="r2" src="img/x.gif" alt="Clay" title="Clay" /></a></td>
<td <?php if(isset($_GET['b']) && $_GET['b'] == 3) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&b=3<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['s'])) echo "&s=".$_GET['s']; ?>"><img class="r3" src="img/x.gif" alt="Iron" title="Iron" /></a></td>
<td <?php if(isset($_GET['b']) && $_GET['b'] == 4) echo "class=\"hl\""; ?>><a href="build.php?id=<?php echo $id; ?>&t=1&b=4<?php if(isset($_GET['v'])) echo "&v=".$_GET['v']; if(isset($_GET['s'])) echo "&s=".$_GET['s']; ?>"><img class="r4" src="img/x.gif" alt="Crop" title="Crop" /></a></td></tr></tbody>
</table>
<?php
}
?>
<div class="clear"></div><table id="range" cellpadding="1" cellspacing="1">
<thead><tr>
<th colspan="5"><a name="h2"></a>Offers at the marketplace</th>
</tr>
<tr>
<td>Offered
<br>to me</td>
<td>Wanted
<br>from me</td>
<td>Player</td>
<td>Duration</td>
<td>Action</td>
</tr></thead>
<tbody>
<?php
if(count($market->onsale) > 0) {
for($i=0+$u;$i<=40+$u;$i++) {
if(isset($market->onsale[$i])) {
echo "<tr><td class=\"val\">";
$reqMerc = 1;
if($market->onsale[$i]['wamt'] > $market->maxcarry) {
$reqMerc = round($market->onsale[$i]['wamt']/$market->maxcarry);
if($market->onsale[$i]['wamt'] > $market->maxcarry*$reqMerc) {
$reqMerc += 1;
}
}
switch($market->onsale[$i]['gtype']) {
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"Wood\" />"; break;
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" />"; break;
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" />"; break;
case 4: echo "<img src=\"img/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" />"; break;
}
echo $market->onsale[$i]['gamt'];
echo "</td> <td class=\"val\">";
switch($market->onsale[$i]['wtype']) {
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"Wood\" />"; break;
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" />"; break;
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" />"; break;
case 4: echo "<img src=\"img/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" />"; break;
}
echo $market->onsale[$i]['wamt'];
echo "</td><td class=\"pla\" title=\"".$database->getVillageField($market->onsale[$i]['vref'],"name")."\">";
echo "<a href=\"karte.php?d=".$market->onsale[$i]['vref']."&c=".$generator->getMapCheck($market->onsale[$i]['vref'])."\">".$database->getUserField($database->getVillageField($market->onsale[$i]['vref'],"owner"),"username",0)."</a></td>";
echo "<td class=\"dur\">".$generator->getTimeFormat($market->onsale[$i]['duration'])."</td>";
if(($market->onsale[$i]['wtype'] == 1 && $village->awood <= $market->onsale[$i]['wamt']) ||($market->onsale[$i]['wtype'] == 2 && $village->aclay <= $market->onsale[$i]['wamt']) ||($market->onsale[$i]['wtype'] == 3 && $village->airon <= $market->onsale[$i]['wamt']) ||($market->onsale[$i]['wtype'] == 4 && $village->acrop <= $market->onsale[$i]['wamt'])) {
echo "<td class=\"act none\">Not Enough Resource</td></tr>";
}
else if($reqMerc > $market->merchantAvail()) {
echo "<td class=\"act none\">Not Enough Merchant</td></tr>";
}
else if($session->access != BANNED){
echo "<td class=\"act\"><a href=\"build.php?id=$id&t=1&a=".$session->mchecker."&g=".$market->onsale[$i]['id']."\">Accept offer</a></td>";
}else{
echo "<td class=\"act\"><a href=\"banned.php\">Accept offer</a></td>";
}
echo"</tr>";
}
}
}
else {
echo "<tr><td class=\"none\" colspan=\"5\">There are no avaliable offers on the market</td></tr>";
}
?>
</tbody><tfoot><tr><td colspan="5">
<span class="none">
<?php
if(!isset($_GET['u']) && count($market->onsale) < 40) {
echo "<span class=\"none\"><b>&laquo;</b></span><span class=\"none\"><b>&raquo;</b></span>";
}
else if (!isset($_GET['u']) && count($market->onsale) > 40) {
echo "<span class=\"none\"><b>&laquo;</b></span><a href=\"build.php?id=<?php echo $id; ?>&t=1&u=40\">&raquo;</a>";
}
else if(isset($_GET['u']) && count($market->onsale) > $_GET['u']) {
if(count($market->onsale) > ($_GET['u']+40) && $_GET['u']-40 < count($market->onsale) && $_GET['u'] != 0) {
echo "<a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']-40)."\">&laquo;</a><a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']+40)."\">&raquo;</a>";
}
else if(count($market->onsale) > $_GET['u']+40) {
echo "<span class=\"none\"><b>&laquo;</b></span><a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']+40)."\">&raquo;</a>";
}
else {
echo "<a href=\"build.php?id=<?php echo $id; ?>&t=1&u=".($_GET['u']-40)."\">&laquo;</a><span class=\"none\"><b>&raquo;</b></span>";
}
}
?>
</td></tr>
</table></div>
+118
View File
@@ -0,0 +1,118 @@
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
<img class="building g17" src="img/x.gif" alt="Marketplace" title="Marketplace" />
</a>
<h1>Marketplace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">At the Marketplace you can trade resources with other players. The higher its level, the more resources can be transported at the same time.</p>
<?php include("17_menu.tpl"); ?>
<form method="POST" action="build.php">
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="hidden" name="ft" value="mk2" />
<table id="sell" cellpadding="1" cellspacing="1">
<tr>
<th>Offering</th>
<td class="val"><input class="text" tabindex="1" name="m1" value="" maxlength="6" /></td>
<td class="res">
<select name="rid1" tabindex="2" class="dropdown">
<option value="1" selected="selected">Lumber</option>
<option value="2">Clay</option>
<option value="3">Iron</option>
<option value="4">Crop</option>
</select>
</td>
<td class="tra"><input class="check" type="checkbox" tabindex="5" name="d1" value="1" /> max. time of transport: <input class="text" tabindex="6" name="d2" value="2" maxlength="2" /> hours</td>
</tr>
<tr>
<th>Searching</th>
<td class="val"><input class="text" tabindex="3" name="m2" value="" maxlength="6" /></td>
<td class="res">
<select name="rid2" tabindex="4" class="dropdown">
<option value="1">Lumber</option>
<option value="2" selected="selected">Clay</option>
<option value="3">Iron</option>
<option value="4">Crop</option>
</select>
</td>
<td class="al">
<?php
if($session->userinfo['alliance'] != 0)
{
echo "<input class=\"check\" type=\"checkbox\" tabindex=\"7\" name=\"ally\" value=\"1\" /> own alliance only";
}
?>
</td>
</tr>
</table>
<?php
if(isset($_GET['e1']))
{
echo "<p class=\"error2\">Not enough resources</p>";
}
elseif(isset($_GET['e2']))
{
echo "<p class=\"error2\">Invalid offer</p>";
}
elseif(isset($_GET['e3']))
{
echo "<p class=\"error2\">Not enough merchants</p>";
}
else
{
echo "<p>Merchants: ".$market->merchantAvail()."/".$market->merchant."</p>";
}
?>
<input type="image" tabindex="8" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" <?php //if(!$market->merchantAvail()) { echo "DISABLED"; }?>/></p>
</form>
<?php
if(count($market->onmarket) > 0)
{
echo "<table id=\"sell_overview\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><th colspan=\"6\">Own offers</th></tr><tr><td>&nbsp;</td><td>Offer</td><td>Search</td><td>Merchants</td><td>Alliance</td><td>Duration</td></tr></thead><tbody>";
foreach($market->onmarket as $offer)
{
if($session->access != BANNED)
{
echo "<tr><td class=\"abo\"><a href=\"build.php?id=$id&t=2&a=5&del=".$offer['id']."\"><img class=\"del\"src=\"img/x.gif\" alt=\"Delete\" title=\"Delete\" /></a></td>";
echo "<td class=\"val\">";
}
else
{
echo "<tr><td class=\"abo\"><a href=\"banned.php\"><img class=\"del\"src=\"img/x.gif\" alt=\"Delete\" title=\"Delete\" /></a></td>";
echo "<td class=\"val\">";
}
switch($offer['gtype'])
{
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"Wood\" />"; break;
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" />"; break;
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" />"; break;
case 4: echo "<img src=\"img/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" />"; break;
}
echo $offer['gamt'];
echo "</td><td class=\"val\">";
switch($offer['wtype'])
{
case 1: echo "<img src=\"img/x.gif\" class=\"r1\" alt=\"Wood\" title=\"Wood\" />"; break;
case 2: echo "<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" />"; break;
case 3: echo "<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" />"; break;
case 4: echo "<img src=\"img/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" />"; break;
}
echo $offer['wamt'];
echo "</td><td class=\"tra\">1</td><td class=\"al\">";
echo ($offer['alliance'] == 0)? 'No' : 'Yes';
echo "</td><td class=\"dur\">";
if($offer['maxtime'] != 0)
{
echo $offer['maxtime']/3600;
echo " hrs.";
}
else
{
echo "All";
}
echo "</td></tr>";
}
echo "</table>";
}
?>
</div>
+271
View File
@@ -0,0 +1,271 @@
<?php if($session->gold > 2){ ?>
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
<img class="building g17" src="img/x.gif" alt="Marketplace" title="Marketplace" />
</a>
<h1>Marketplace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">At the Marketplace you can trade resources with other players. The higher its level, the more resources can be transported at the same time.
</p>
<?php include("17_menu.tpl");
if(isset($_GET['c'])){
?>
<p><b>NPC completed.</b> Cost 3<img src="img/x.gif" class="gold" alt="Gold" title="Gold" /></p>
<a href="javascript: history.go(-2)">Back to building</a>
<?php } else { ?>
<p>With the NPC merchant you can distribute the resources in your warehouse as you desire. <br /><br />
The first line shows the current stock. In the second line you can choose another distribution. The third line shows the difference between the old and new stock.</p>
<script language="JavaScript">
var overall;
function calculateRes() {
resObj=document.getElementsByName("m2");
overall=0;
for (i=0; i<resObj.length; i++) {
var tmp="";
for (j=0; j<resObj[i].value.length; j++)
if ((resObj[i].value.charAt(j)>="0") && (resObj[i].value.charAt(j)<="9")) tmp=tmp+resObj[i].value.charAt(j);
resObj[i].value=tmp;
if (tmp=="") tmp="0";
newRes=Math.round(parseInt(tmp)*summe/100);
if (((i<3) && (newRes<=max123)) || ((i==3) && (newRes<=max4)))
newHTML=newRes;
else
newHTML="<span class='corr'>"+newRes+"</span>";
document.getElementById("new"+i).innerHTML=newHTML;
overall+=parseInt(tmp);
}
document.getElementById("overall").innerHTML=overall+"%";
}
function normalize() {
calculateRes();
resObj=document.getElementsByName("m2");
for (i=0; i<resObj.length; i++) {
tmp=parseInt(resObj[i].value);
tmp=tmp*(100/overall);
resObj[i].value=Math.round(tmp);
}
calculateRes();
}
function calculateRest() {
resObj=document.getElementsByName("m2[]");
overall=0;
for (i=0; i<resObj.length; i++) {
var tmp="";
for (j=0; j<resObj[i].value.length; j++)
if ((resObj[i].value.charAt(j)>="0") && (resObj[i].value.charAt(j)<="9")) tmp=tmp+resObj[i].value.charAt(j);
if (tmp=="") {
tmp="0";
newRes=0;
resObj[i].value="";
} else {
newRes=parseInt(tmp);
if ((i<3) && (newRes>max123)) newRes=max123;
if ((i==3) && (newRes>max4)) newRes=max4;
resObj[i].value=newRes;
}
dif=newRes-parseInt(document.getElementById("org"+i).innerHTML);
newHTML=dif;
if (dif>0) newHTML="+"+dif;
document.getElementById("diff"+i).innerHTML=newHTML;
overall+=newRes;
}
document.getElementById("newsum").innerHTML=overall;
rest=parseInt(document.getElementById("org4").innerHTML)-overall;
document.getElementById("remain").innerHTML=rest;
testSum();
}
function fillup(nr) {
resObj=document.getElementsByName("m2[]");
if (nr<3) {
resObj[nr].value=max123;
} else {
resObj[nr].value=max4;
}
calculateRest();
}
function portionOut() {
restRes=parseInt(document.getElementById("remain").innerHTML);
rest=restRes;
resObj=document.getElementsByName("m2[]");
nullCount=0;
notNullCount=0;
// Z&#65533;hlen
for (j=0; j<resObj.length; j++) {
if ((restRes>0) && (resObj[j].value=="")) nullCount++;
if ((restRes<0) && (resObj[j].value!="")) notNullCount++;
}
// Verteilen
nullCount2=0;
if (restRes>0) {
// In allen Feldern schon Zahlen?
if (nullCount==0) {
for (i=0; i<resObj.length; i++) {
free=max123-parseInt(resObj[i].value);
resObj[i].value=(parseInt(resObj[i].value)+Math.round(rest/(4-i)));
rest=rest-Math.min(free,Math.round(rest/(4-i)));
if ((i<3) && (parseInt(resObj[i].value)<max123)) nullCount2++;
}
} else {
for (i=0; i<resObj.length; i++) {
if (resObj[i].value=="") {
resObj[i].value=Math.round(rest/nullCount);
rest=rest-Math.round(rest/nullCount);
nullCount--;
}
if ((i<3) && (parseInt(resObj[i].value)<max123)) nullCount2++;
}
}
} else {
for (j=0; j<resObj.length; j++) {
if (parseInt(resObj[j].value)>0) {
resObj[j].value=(parseInt(resObj[j].value)+Math.round(rest/notNullCount));
rest=rest-Math.round(rest/notNullCount);
notNullCount--;
}
}
}
calculateRest();
// Noch irgendein Rest?
if (rest>0) {
if (max123>max4) {
for (j=0; j<3; j++) {
if (parseInt(resObj[j].value)<max123) {
resObj[j].value=(parseInt(resObj[j].value)+Math.round(rest/nullCount2));
rest=rest-Math.round(rest/nullCount2);
nullCount2--;
}
}
} else {
resObj[3].value=(parseInt(resObj[3].value)+rest);
}
}
calculateRest();
}
function testSum() {
if (document.getElementById("remain").innerHTML!=0) {
document.getElementById("submitText").innerHTML="<a href='javascript:portionOut();'>Distribute resources at (step 1 of 2)</a>";
document.getElementById("submitText").style.display="block";
document.getElementById("submitButton").style.display="none";
} else {
document.getElementById("submitText").innerHTML="";
document.getElementById("submitText").style.display="none";
document.getElementById("submitButton").style.display="block";
}
}
</script>
<script language="JavaScript">var summe=<?php echo floor($village->awood+$village->acrop+$village->airon+$village->aclay); ?>;var max123=<?php echo $village->maxstore; ?>;var max4=<?php echo $village->maxcrop; ?>;</script>
<form method="post" name="snd" action="build.php">
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="hidden" name="ft" value="mk3" />
<input type="hidden" name="t" value="3" />
<?php
$wwvillage = $database->getResourceLevel($village->wid);
if($wwvillage['f99t']!=40){
?>
<table id="npc" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="5">NPC Trade</th>
</tr>
<tr>
<td class="all">
<a href="javascript:fillup(0);"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /></a>
<span id="org0"><?php echo floor($village->awood); ?></span>
</td>
<td class="all">
<a href="javascript:fillup(1);"><img class="r2" src="img/x.gif" alt="Clay" title="Clay" /></a>
<span id="org1"><?php echo floor($village->aclay); ?></span>
</td>
<td class="all">
<a href="javascript:fillup(2);"><img class="r3" src="img/x.gif" alt="Iron" title="Iron" /></a>
<span id="org2"><?php echo floor($village->airon); ?></span>
</td>
<td class="all">
<a href="javascript:fillup(3);"><img class="r4" src="img/x.gif" alt="Crop" title="Crop" /></a>
<span id="org3"><?php echo floor($village->acrop); ?></span>
</td>
<td class="sum">Sum:&nbsp;<span id="org4"><?php echo floor($village->awood+$village->acrop+$village->airon+$village->aclay); ?></span></td>
</tr>
</thead>
<tbody>
<tr>
<td class="sel">
<input class="text" onkeyup="calculateRest();" name="m2[]" size="5" maxlength="7" <?php if(isset($_GET['r1'])) { echo "value=\"".$_GET['r1']."\""; } ?>/>
<input type="hidden" name="m1[]" value="<?php echo floor($village->awood); ?>" />
</td>
<td class="sel">
<input class="text" onkeyup="calculateRest();" name="m2[]" size="5" maxlength="7" <?php if(isset($_GET['r2'])) { echo "value=\"".$_GET['r2']."\""; } ?>/>
<input type="hidden" name="m1[]" value="<?php echo floor($village->aclay); ?>" />
</td>
<td class="sel">
<input class="text" onkeyup="calculateRest();" name="m2[]" size="5" maxlength="7" <?php if(isset($_GET['r3'])) { echo "value=\"".$_GET['r3']."\""; } ?>/>
<input type="hidden" name="m1[]" value="<?php echo floor($village->airon); ?>" />
</td>
<td class="sel">
<input class="text" onkeyup="calculateRest();" name="m2[]" size="5" maxlength="7" <?php if(isset($_GET['r4'])) { echo "value=\"".$_GET['r4']."\""; } ?>/>
<input type="hidden" name="m1[]" value="<?php echo floor($village->acrop); ?>" />
</td>
<td class="sum">Sum:&nbsp;<span id="newsum"><?php if(isset($_GET['r1']) && isset($_GET['r2']) && isset($_GET['r3']) && isset($_GET['r4'])) { echo $_GET['r1']+$_GET['r2']+$_GET['r3']+$_GET['r4']; } else { echo 0; } ?></span></td>
</tr>
<tr>
<td class="rem">
<span id="diff0"><?php echo 0-floor($village->awood); ?></span>
</td>
<td class="rem">
<span id="diff1"><?php echo 0-floor($village->aclay); ?></span>
</td>
<td class="rem">
<span id="diff2"><?php echo 0-floor($village->airon); ?></span>
</td>
<td class="rem">
<span id="diff3"><?php echo 0-floor($village->acrop); ?></span>
</td>
<td class="sum">Rest:&nbsp;<span id="remain">
<?php if(isset($_GET['r1']) && isset($_GET['r2']) && isset($_GET['r3']) && isset($_GET['r4'])) {
echo floor($village->awood+$village->acrop+$village->airon+$village->aclay)-($_GET['r1']+$_GET['r2']+$_GET['r3']+$_GET['r4']);
} else { echo floor($village->awood+$village->acrop+$village->airon+$village->aclay); } ?></span></td>
</tr>
</tbody>
</table>
<p id="submitButton">
<?php if($session->userinfo['gold'] > 3) { ?><a href="javascript:document.snd.submit();">Trade resources at (step 2 of 2)</a> <span class="none">(Costs: <img src="img/x.gif" class="gold_g" alt="Gold" title="Gold" /><b>3</b>)</span><?php } else { echo"<span class='none'>Trade resources at (step 2 of 2)</span> (Costs: <img src='img/x.gif' class='gold' alt='Gold' title='Gold' /><b>3</b>)"; }?> </p>
<p id="submitText"></p>
</form>
<script>
testSum();
</script>
<?php }else{ ?>
</br></br>
<?php echo "You can't use NPC trade in WW village.";
}} ?>
</div>
<?php
}else{
header("Location: build.php?id=".$_GET['id']."");
}
?>
+75
View File
@@ -0,0 +1,75 @@
<?php if($session->goldclub == 1 && count($database->getProfileVillages($session->uid)) > 1) { ?>
<div id="build" class="gid17"><a href="#" onClick="return Popup(17,4);" class="build_logo">
<img class="building g17" src="img/x.gif" alt="Marketplace" title="Marketplace" />
</a>
<h1>Marketplace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">At the Marketplace you can trade resources with other players. The higher its level, the more resources can be transported at the same time.
</p>
<?php include("17_menu.tpl");
if(isset($_GET['action'])){
$routeaccess = 1;
}
if(isset($_GET['create']) && $session->gold > 1){
$routeaccess = 1;
include("17_create.tpl");
}else if($_GET['action'] == 'editRoute' && isset($_GET['routeid']) && $_GET['routeid'] != ""){
$traderoute = $database->getTradeRouteUid($_GET['routeid']);
if($traderoute == $session->uid){
include("17_edit.tpl");
}
}else{
?>
<p>Trade route allows you to set up routes for your merchant that he will walk every day at a certain hour. <br /><br />
Standard this holds on for 7 days, but you can extend it with 7 days for the cost of <img src="../../<?php echo GP_LOCATE; ?>img/a/gold.gif" alt="Gold" title="Gold">2.</p>
<table id="npc" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th></th>
<th>description</th>
<th>start</th>
<th>Merchants</th>
<th>time left</th>
</tr></thead><tbody>
<?php
$routes = $database->getTradeRoute($session->uid);
if(count($routes) == 0) {
echo "<td colspan=\"5\" class=\"none\">No active trade routes.</td></tr>";
}else{
foreach($routes as $route){
?>
<tr>
<th><label><input class="radio" type="radio" onclick="window.location.href = '?id=<?php echo $id; ?>&t=4&routeid=<?php echo $route['id']; ?>';" name="routeid" value="<?php echo $route['id']; ?>" <?php if($routeid == $route['id']) { echo "checked"; } ?>></label></th>
<th>
<?php
echo "Trade route to <a href=karte.php?d=".$route['wid']."&c=".$generator->getMapCheck($route['wid']).">".$database->getVillageField($route['wid'],"name")."</a>";
?>
</th>
<th><?php if($route['start'] > 9){ echo $route['start'];}else{ echo "0".$route['start'];} echo ":00"; ?></th>
<th><?php echo $route['deliveries']."x".$route['merchant']; ?></th>
<th><?php echo ceil(($route['timeleft']-time())/86400); echo " days"; ?></th>
</tr>
<?php }} ?>
</tbody><tfoot><tr>
<th>
</th>
<th colspan="4">
<?php $routeid=$routeid == 0? $routeid=0:$routeid; ?>
<a href="build.php?action=extendRoute&routeid=<?php echo $routeid; ?>">extend</a>*
| <a href="build.php?id=<?php echo $id; ?>&t=4&action=editRoute&routeid=<?php echo $routeid; ?>">edit</a>
| <a href="build.php?action=delRoute&routeid=<?php echo $routeid; ?>">delete</a>
</th></tr></tfoot></table>
* Extend the trade route by 7 days for <img src="../../<?php echo GP_LOCATE; ?>img/a/gold.gif" alt="Gold" title="Gold">2
<br>
<div class="options">
<a class="arrow" href="build.php?gid=17&t=4&create">» Create new trade route</a>
</div>
</div>
<?php
}}else{
header("Location: build.php?id=".$_GET['id']."");
}
?>
+78
View File
@@ -0,0 +1,78 @@
<form action="build.php" method="post">
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
<input type="hidden" name="action" value="addRoute">
<table cellpadding="1" cellspacing="1" id="npc" class="transparent">
<thead>
<tr>
<th colspan="2">Create trade route</th>
</tr>
</thead>
<tbody>
<tr>
<th>
target village: </th>
<td>
<select id="tvillage" name="tvillage">
<?php
if($session->villages[0] == $village->wid){
$firstvillage = 2;
}else{
$firstvillage = 1;
}
for($i=1;$i<=count($session->villages);$i++) {
if($i == $firstvillage){
$select = 'selected="selected"';
}else{
$select = '';
}
if($session->villages[$i-1] != $village->wid){
$coor = $database->getCoor($session->villages[$i-1]);
echo "<option value=\"".$session->villages[$i-1]."\" ".$select.">".$database->getVillageField($session->villages[$i-1],'name')." (".$coor['x']."|".$coor['y'].")</option>";
}
}
?> </select>
</td>
</tr>
<tr>
<th>
Resources: </th>
<td>
<img src="../../<?php echo GP_LOCATE; ?>img/r/1.gif" alt="Lumber" title="Lumber"> <input class="text" type="text" name="r1" id="r1" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/2.gif" alt="Clay" title="Clay"> <input class="text" type="text" name="r2" id="r2" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/3.gif" alt="Iron" title="Iron"> <input class="text" type="text" name="r3" id="r3" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/4.gif" alt="Crop" title="Crop"> <input class="text" type="text" name="r4" id="r4" value="" maxlength="5" tabindex="1" style="width:50px;">
</td>
</tr>
<tr>
<th>
start time: </th>
<td>
<select name="start"><option value="0" selected="selected">00</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option></select>
</td>
</tr>
<tr>
<th>
deliveries: </th>
<td>
<select name="deliveries"><option value="1" selected="selected">1</option><option value="2">2</option><option value="3">3</option></select>
</td>
</tr>
<tr>
<th>
costs: </th>
<td>
<img src="../../<?php echo GP_LOCATE; ?>img/a/gold.gif" alt="Gold" title="Gold"> 2
</td>
</tr>
<tr>
<th>
Duration: </th>
<td>
7 days
</td>
</tr>
</tbody></table>
</div>
</div>
<p><input type="image" value="1" name="save" id="btn_save" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK"/></p>
</form>
</div>
+40
View File
@@ -0,0 +1,40 @@
<?php $edited_route = $database->getTradeRoute2($_GET['routeid']); ?>
<form action="build.php" method="post">
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
<input type="hidden" name="action" value="editRoute">
<input type="hidden" name="routeid" value="<?php echo $_GET['routeid']; ?>">
<table cellpadding="1" cellspacing="1" id="npc" class="transparent">
<thead>
<tr>
<th colspan="2">Edit trade route</th>
</tr>
</thead>
<tbody>
<tr>
<th>
Resources: </th>
<td>
<img src="../../<?php echo GP_LOCATE; ?>img/r/1.gif" alt="Lumber" title="Lumber"> <input class="text" type="text" name="r1" id="r1" value="<?php echo $edited_route['wood']; ?>" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/2.gif" alt="Clay" title="CLay"> <input class="text" type="text" name="r2" id="r2" value="<?php echo $edited_route['clay']; ?>" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/3.gif" alt="Iron" title="Iron"> <input class="text" type="text" name="r3" id="r3" value="<?php echo $edited_route['iron']; ?>" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/4.gif" alt="Crop" title="Crop"> <input class="text" type="text" name="r4" id="r4" value="<?php echo $edited_route['crop']; ?>" maxlength="5" tabindex="1" style="width:50px;">
</td>
</tr>
<tr>
<th>
start time: </th>
<td>
<select name="start"><?php for($i=0;$i<=23;$i++){?><option value="<?php echo $i; ?>" <?php if($i == $edited_route['start']){echo "selected";} ?>><?php if($i > 9){echo $i;}else{echo "0".$i;}?></option><?php } ?></select>
</td>
</tr>
<tr>
<th>
deliveries: </th>
<td>
<select name="deliveries"><?php for($i=1;$i<=3;$i++){?><option value="<?php echo $i; ?>" <?php if($i == $edited_route['deliveries']){echo "selected";} ?>><?php echo $i; ?></option><?php } ?></select>
</td>
</tr>
</tbody></table>
</div>
</div>
<p><input type="image" value="1" name="save" id="btn_save" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK"/></p>
</form>
</div>
+17
View File
@@ -0,0 +1,17 @@
<div id="textmenu">
<a href="build.php?id=<?php echo $id; ?>"<?php if(!isset($_GET['t'])) { echo "class=\"selected\""; } ?>">Send Resouces</a>
| <a href="build.php?id=<?php echo $id; ?>&amp;t=1" <?php if(isset($_GET['t']) && $_GET['t'] == 1) { echo "class=\"selected\""; } ?>>Buy</a>
| <a href="build.php?id=<?php echo $id; ?>&amp;t=2" <?php if(isset($_GET['t']) && $_GET['t'] == 2) { echo "class=\"selected\""; } ?>>Offer</a>
<?php if($session->userinfo['gold'] > 2) {
?>
| <a href="build.php?id=<?php echo $id; ?>&amp;t=3" <?php if(isset($_GET['t']) && $_GET['t'] == 3) { echo "class=\"selected\""; } ?>>NPC trading</a>
<?php
}
?>
<?php if($session->goldclub == 1 && count($database->getProfileVillages($session->uid)) > 1) {
?>
| <a href="build.php?id=<?php echo $id; ?>&amp;t=4" <?php if(isset($_GET['t']) && $_GET['t'] == 4) { echo "class=\"selected\""; } ?>>trade routes</a>
<?php
}
?>
</div>
+66
View File
@@ -0,0 +1,66 @@
<div id="build" class="gid18"><a href="#" onClick="return Popup(18,4);" class="build_logo">
<img class="building g18" src="img/x.gif" alt="Embassy" title="Embassy" />
</a>
<h1>Embassy <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">The embassy is a place for diplomats. The higher its level the more options the king gains.</p>
<?php
if($village->resarray['f'.$id] >= 3 && $session->alliance == 0) {
include("18_create.tpl");
}
if($session->alliance != 0) {
echo "
<table cellpadding=\"1\" cellspacing=\"1\" id=\"ally_info\">
<thead><tr>
<th colspan=\"2\">Alliance</th>
</tr></thead>
<tbody><tr>
<th>Tag</th>
<td>".$alliance->allianceArray['tag']."</td>
</tr>
<tr>
<th>Name</th>
<td>".$alliance->allianceArray['name']."</td>
</tr>
<tr>
<td class=\"empty\" colspan=\"2\"></td>
</tr>
<tr>
<td colspan=\"2\"><a href=\"allianz.php\">&nbsp;&raquo; to the alliance</a></td>
</tr></tbody>
</table>";
}
else if($village->resarray['f'.$id] >= 1) {
?>
<table cellpadding="1" cellspacing="1" id="join">
<form method="post" action="build.php">
<input type="hidden" name="id" value="<?php echo $id ?>">
<input type="hidden" name="a" value="2">
<thead><tr>
<th colspan="3">join alliance</th>
</tr></thead>
<tbody><tr>
<?php
if($alliance->gotInvite) {
foreach($alliance->inviteArray as $invite) {
echo "<td class=\"abo\"><a href=\"build.php?id=".$id."&a=2&d=".$invite['id']."\"><img class=\"del\" src=\"img/x.gif\" alt=\"refuse\" title=\"refuse\" /></a></td>
<td class=\"nam\"><a href=\"allianz.php?aid=".$invite['alliance']."\">&nbsp;".$database->getAllianceName($invite['alliance'])."</a></td>
<td class=\"acc\"><a href=\"build.php?id=".$id."&a=3&d=".$invite['id']."\">&nbsp;accept</a></td><tr>";
}
}
else {
echo "<td colspan=\"3\" class=\"none\">There are no invitations available.</td>";
}
?>
</tr></tbody></table>
<?php
if($alliance->gotInvite) {
echo "<p class=\"error2\" style=\"color: #DD0000\">".$form->getError("ally_accept")."</p>";
}
}
include("upgrade.tpl");
?>
</p></div>
+59
View File
@@ -0,0 +1,59 @@
<?php if($session->access!=BANNED){ ?>
<table cellpadding="1" cellspacing="1" id="found">
<form method="post" action="build.php">
<input type="hidden" name="id" value="<?php echo $id ?>">
<input type="hidden" name="ft" value="ali1">
<thead><tr>
<th colspan="2">found alliance</th>
</tr></thead>
<tbody><tr>
<th>Tag</th>
<td class="tag">
<input class="text" name="ally1" value="<?php echo $form->getValue("ally1"); ?>" maxlength="15">
<span class="error"><?php echo $form->getError("ally1"); ?></span>
</td>
</tr>
<tr>
<th>Name</th>
<td class="nam">
<input class="text" name="ally2" value="<?php echo $form->getValue("ally2"); ?>" maxlength="50">
<span class="error"><?php echo $form->getError("ally2"); ?></span>
</td>
</tr></tbody>
</table>
<p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></form></p><table cellpadding="1" cellspacing="1" id="join">
<?php }else{ ?>
<table cellpadding="1" cellspacing="1" id="found">
<form method="post" action="build.php">
<input type="hidden" name="id" value="<?php echo $id ?>">
<input type="hidden" name="ft" value="ali1">
<thead><tr>
<th colspan="2">found alliance</th>
</tr></thead>
<tbody><tr>
<th>Tag</th>
<td class="tag">
<input class="text" name="ally1" disabled="disabled" value="<?php echo $form->getValue("ally1"); ?>" maxlength="8">
<span class="error"><?php echo $form->getError("ally1"); ?></span>
</td>
</tr>
<tr>
<th>Name</th>
<td class="nam">
<input class="text" name="ally2" disabled="disabled" value="<?php echo $form->getValue("ally2"); ?>" maxlength="25">
<span class="error"><?php echo $form->getError("ally2"); ?></span>
</td>
</tr></tbody>
</table>
<?php
echo "Banned player can't create an alliance.";
?></br><?php
}
?>
+60
View File
@@ -0,0 +1,60 @@
<div id="build" class="gid19"><a href="#" onClick="return Popup(19,4);" class="build_logo">
<img class="building g19" src="img/x.gif" alt="Barracks" title="Barracks" />
</a>
<h1>Barracks <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">All foot soldiers are trained in the barracks. The higher the level of the barracks, the faster the troops are trained.</p>
<?php if ($building->getTypeLevel(19) > 0) { ?>
<form method="POST" name="snd" action="build.php">
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="hidden" name="ft" value="t1" />
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr>
<td>Name</td>
<td>Quantity</td>
<td>Max</td>
</tr></thead><tbody>
<?php
include("19_train.tpl");
?></table>
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" onclick="this.disabled=true;this.form.submit();"/></form></p>
<?php
} else {
echo "<b>Training can commence when barracks are completed.</b><br>\n";
}
$trainlist = $technology->getTrainingList(1);
if(count($trainlist) > 0) {
//$timer = 2*count($trainlist);
echo "
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
<thead><tr>
<td>Training</td>
<td>Duration</td>
<td>Finished</td>
</tr></thead>
<tbody>";
$TrainCount = 0;
foreach($trainlist as $train) {
$TrainCount++;
echo "<tr><td class=\"desc\">";
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
if ($TrainCount == 1 ) {
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
if($time[0] != "today") {
echo "on ".$time[0]." at ";
}
echo $time[1];
} ?>
</tr><tr class="next"><td colspan="3">The next unit will be finished in <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
</tbody></table>
<?php }
include("upgrade.tpl");
?>
</p></div>
+85
View File
@@ -0,0 +1,85 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
if($session->tribe != 4){
for ($i=($session->tribe-1)*10+1;$i<=($session->tribe-1)*10+4;$i++) {
if ($i <> 4 && $i <> 23 && $i <> 24 && ($technology->getTech($i) || $i%10 == 1)) {
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup(".$i.",1);\"> ".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span>
</div>
<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".(${'u'.$i}['wood'])."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".(${'u'.$i}['clay'])."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".(${'u'.$i}['iron'])."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".(${'u'.$i}['crop'])."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
$dur=round(${'u'.$i}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div>
</td>
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"10\"></td>
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i,false)."; return false;\">(".$technology->maxUnit($i,false).")</a></td></tr></tbody>";
}
}
}else{
for ($i=31;$i<=40;$i++) {
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup(".$i.",1);\"> ".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span>
</div>
<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".(${'u'.$i}['wood'])."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".(${'u'.$i}['clay'])."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".(${'u'.$i}['iron'])."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".(${'u'.$i}['crop'])."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
$dur=round(${'u'.$i}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div>
</td>
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"10\"></td>
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i,false)."; return false;\">(".$technology->maxUnit($i,false).")</a></td></tr></tbody>";
}
}
?>
+55
View File
@@ -0,0 +1,55 @@
<?php
include("next.tpl");
?>
<div id="build" class="gid2"><a href="#" onClick="return Popup(2,4);" class="build_logo">
<img class="building g2" src="img/x.gif" alt="<?php echo B2; ?>" title="<?php echo B2; ?>" />
</a>
<h1><?php echo B2; ?> <span class="level"><?php echo LEVEL." "; echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc"><?php echo B2_DESC; ?></p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th><?php echo CUR_PROD; ?>:</th>
<td><b><?php echo $bid2[$village->resarray['f'.$id]]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
<tr>
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
<td><b><?php echo $bid2[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}else{
?>
<tr>
<th><?php echo NEXT_PROD; echo 20; ?>:</th>
<td><b><?php echo $bid2[20]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}}else{
if($next<=10){
?>
<tr>
<th><?php echo NEXT_PROD; echo $next; ?>:</th>
<td><b><?php echo $bid2[$next]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}else{
?>
<tr>
<th><?php echo NEXT_PROD; echo 10; ?>:</th>
<td><b><?php echo $bid2[10]['prod']* SPEED; ?></b> <?php echo PER_HR; ?></td>
</tr>
<?php
}}}
?>
</table>
<?php
include("upgrade.tpl");
?></p></div>
+73
View File
@@ -0,0 +1,73 @@
<div id="build" class="gid20"><a href="#" onClick="return Popup(20,4);" class="build_logo">
<img class="building g20" src="img/x.gif" alt="Stable" title="Stable" /> </a>
<h1>Stable <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">Cavalry can be trained in the stable. The higher its level the faster the troops are trained.<br /></p>
<?php if ($building->getTypeLevel(20) > 0) { ?>
<form method="POST" name="snd" action="build.php">
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="hidden" name="ft" value="t1" />
<table cellpadding="1" cellspacing="1" class="build_details">
<thead>
<tr>
<td>Name</td>
<td>Quantity</td>
<td>Max</td>
</tr>
</thead>
<tbody>
<?php
if($session->tribe != 4){
include("20_".$session->tribe.".tpl");
}
?>
</tbody>
</table>
<p>
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
</p>
</form>
<?php
} else {
echo "<b>Training can commence when stables are completed.</b><br>\n";
}
$trainlist = $technology->getTrainingList(2);
if(count($trainlist) > 0) {
//$timer = 2*count($trainlist);
echo "
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
<thead><tr>
<td>Training</td>
<td>Duration</td>
<td>Finished</td>
</tr></thead>
<tbody>";
$TrainCount = 0;
foreach($trainlist as $train) {
$TrainCount++;
echo "<tr><td class=\"desc\">";
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
if ($TrainCount == 1) {
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</span></td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
if($time[0] != "today") {
echo "on ".$time[0]." at ";
}
echo $time[1];
} ?>
</tr><tr class="next"><td colspan="3">The next unit will be finished in <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
</tbody></table>
<?php }
?>
<?php
include("upgrade.tpl");
?> </p></div>
+62
View File
@@ -0,0 +1,62 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
$success = 0;
for($i=4;$i<=6;$i++) {
if($technology->getTech($i)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u$i\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
if(${'u'.$i}['drinking'] <= $building->getTypeLevel(41)) {
echo "<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".(${'u'.$i}['pop']-1)."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
}else{
echo "<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".(${'u'.$i}['pop'])."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
}
$dur=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) * ($building->getTypeLevel(41)>=1?(1/$bid41[$building->getTypeLevel(41)]['attri']):1) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div></td>
<td class=\"val\">
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"10\">
</td>
<td class=\"max\">
<a href=\"#\" onClick=\"document.snd.t$i.value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a>
</td>
</tr>";
$success += 1;
}
}
if($success == 0) {
echo "<tr><td colspan=\"3\"><div class=\"none\" align=\"center\">No units avaliable. Research at academy</div></td></tr>";
}
?>
+57
View File
@@ -0,0 +1,57 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
$success = 0;
for($i=15;$i<=16;$i++) {
if($technology->getTech($i)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u$i\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
echo "<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
$dur=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div></td>
<td class=\"val\">
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"10\">
</td>
<td class=\"max\">
<a href=\"#\" onClick=\"document.snd.t$i.value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a>
</td>
</tr>";
$success += 1;
}
}
if($success == 0) {
echo "<tr><td class=\"none\" colspan=\"3\">No units avaliable. Research at academy</td></tr>";
}
?>
+57
View File
@@ -0,0 +1,57 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
$success = 0;
for($i=23;$i<=26;$i++) {
if($technology->getTech($i)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u$i\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
echo "<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
$dur=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div></td>
<td class=\"val\">
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"10\">
</td>
<td class=\"max\">
<a href=\"#\" onClick=\"document.snd.t$i.value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a>
</td>
</tr>";
$success += 1;
}
}
if($success == 0) {
echo "<tr><td class=\"none\" colspan=\"3\">No units avaliable. Research at academy</td></tr>";
}
?>
+57
View File
@@ -0,0 +1,57 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
$success = 0;
for($i=35;$i<=36;$i++) {
if($technology->getTech($i)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u$i\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
echo "<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
$dur=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div></td>
<td class=\"val\">
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"10\">
</td>
<td class=\"max\">
<a href=\"#\" onClick=\"document.snd.t$i.value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a>
</td>
</tr>";
$success += 1;
}
}
if($success == 0) {
echo "<tr><td class=\"none\" colspan=\"3\">No units avaliable. Research at academy</td></tr>";
}
?>
+54
View File
@@ -0,0 +1,54 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
$success = 0;
for($i=45;$i<=46;$i++) {
if($technology->getTech($i)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u$i\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
echo "<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
$dur=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
echo "</div></td>
<td class=\"val\">
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"10\">
</td>
<td class=\"max\">
<a href=\"#\" onClick=\"document.snd.t$i.value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a>
</td>
</tr>";
$success += 1;
}
}
if($success == 0) {
echo "<tr><td class=\"none\" colspan=\"3\">No units avaliable. Research at academy</td></tr>";
}
?>
+138
View File
@@ -0,0 +1,138 @@
<div id="build" class="gid21"><a href="#" onClick="return Popup(21,4, 'gid');" class="build_logo">
<img class="building g21" src="img/x.gif" alt="Workshop" title="Workshop" /> </a>
<h1>Workshop <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">Siege engines like catapults and rams can be built in the workshop. The higher its level the faster the units are produced.</p>
<?php if ($building->getTypeLevel(21) > 0) { ?>
<form method="POST" name="snd" action="build.php">
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="hidden" name="ft" value="t1" />
<table cellpadding="1" cellspacing="1" class="build_details">
<thead>
<tr>
<td>Name</td>
<td>Quantity</td>
<td>Max</td>
</tr>
</thead>
<tbody>
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
$success = 0;
$start = ($session->tribe == 1)? 7 : (($session->tribe == 2)? 17 : 27);
if ($session->tribe == 1){
$start = 7;
}else if ($session->tribe == 2){
$start = 17;
}else if ($session->tribe == 3){
$start = 27;
}else if ($session->tribe == 5){
$start = 47;
}
if($session->tribe != 4){
for($i=$start;$i<=($start+1);$i++) {
if($technology->getTech($i)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u$i\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
echo "<div class=\"details\">
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
$dur=round(${'u'.$i}['time'] * ($bid21[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div></td>
<td class=\"val\">
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"10\">
</td>
<td class=\"max\">
<a href=\"#\" onClick=\"document.snd.t$i.value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a>
</td>
</tr>";
$success += 1;
}
}
if($success == 0) {
echo "<tr><td class=\"none\" colspan=\"3\">No units avaliable. Research at academy</td></tr>";
}
}
?>
</tbody>
</table>
<p>
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
</p>
</form>
<?php
} else {
echo "<b>Training can commence when workshop are completed.</b><br>\n";
}
$trainlist = $technology->getTrainingList(3);
if(count($trainlist) > 0) {
//$timer = 2*count($trainlist);
echo "
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
<thead><tr>
<td>Training</td>
<td>Duration</td>
<td>Finished</td>
</tr></thead>
<tbody>";
$TrainCount = 0;
foreach($trainlist as $train) {
$TrainCount++;
echo "<tr><td class=\"desc\">";
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
if ($TrainCount == 1 ) {
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
if($time[0] != "today") {
echo "on ".$time[0]." at ";
}
echo $time[1];
} ?>
</tr><tr class="next"><td colspan="3">The next unit will be finished in <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
</tbody></table>
<?php }
include("upgrade.tpl");
?>
</p></div>
+17
View File
@@ -0,0 +1,17 @@
<div id="build" class="gid22"><a href="#" onClick="return Popup(22,4);" class="build_logo">
<img class="building g22" src="img/x.gif" alt="Academy" title="Academy" />
</a>
<h1>Academy <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">In the academy new unit types can be researched. By increasing its level you can order the research of better units.</p>
<?php
if ($building->getTypeLevel(22) > 0) {
include("22_".$session->tribe.".tpl");
} else {
echo "<p><b>Research can commence when academy is completed.</b><br>\n";
}
include("upgrade.tpl");
?>
</p>
</div>
+153
View File
@@ -0,0 +1,153 @@
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr>
<td>Academy</td>
<td>Action</td>
</tr></thead>
<tbody>
<?php
$fail = $success = 0;
$acares = $technology->grabAcademyRes();
for($i=2;$i<=9;$i++) {
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
echo "<br><span class=\"none\">Expand warehouse</span></div></td>";
echo "<td class=\"act\">
<div class=\"none\">Expand<br>warehouse</div>
</td></tr>";
}
else if(${'r'.$i}['crop'] > $village->maxcrop) {
echo "<br><span class=\"none\">Expand granary</span></div></td>";
echo "<td class=\"act\">
<div class=\"none\">Expand<br>granary</div>
</td></tr>";
}
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
if($village->getProd("crop")>0){
$time = $technology->calculateAvaliable(22,${'r'.$i});
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
} else {
echo "<br><span class=\"none\">Crop production is negative so you will never reach the required resources</span></div></td>";
}
echo "<td class=\"act\"><div class=\"none\">Too few<br>resources</div></td></tr>";
}
else if (count($acares) > 0) {
echo "</td>";
echo "<td class=\"none\">
Research in progress</td></tr>";
}
else if($session->access != BANNED){
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"build.php?id=$id&amp;a=$i&amp;c=".$session->mchecker."\">Research</a></td></tr>";
}else{
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"banned.php\">Research</a></td></tr>";
}
$success += 1;
}
else {
$fail += 1;
}
}
if($success == 0) {
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">There are no researches avaliable</div></td>";
}
?>
</tbody>
</table>
<?php
if($fail > 0) {
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">show more</a></p>
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
<thead><tr><td colspan=\"2\">Prerequisites</td></tr><tbody>";
if(!$technology->meetRRequirement(2) && !$technology->getTech(2)) {
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u2\" title=\"Praetorian\" alt=\"Praetorian\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(2, 1);\" href=\"#\">Praetorian</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 1);\">Academy</a>
<span title=\"+2\">&nbsp;Level 1</span><br /><a href=\"#\" onclick=\"return Popup(13, 4);\">Armoury </a><span title=\"+1\">&nbsp;Level 1</span></td></tr>";
}
if(!$technology->meetRRequirement(3) && !$technology->getTech(3)) {
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u3\" title=\"Imperian\" alt=\"Imperian\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(3, 1);\" href=\"#\">Imperian</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
<span title=\"+2\">&nbsp;Level 5</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\">&nbsp;Level 1</span> </td></tr>";
}
if(!$technology->meetRRequirement(4) && !$technology->getTech(4)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u4\" title=\"Equites Legati\" alt=\"Equites Legati\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(4, 1);\" href=\"#\">Equites Legati</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\">&nbsp;Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a><span title=\"+1\">&nbsp;Level 1</span> </td></tr>";
}
if(!$technology->meetRRequirement(5) && !$technology->getTech(5)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u5\" title=\"Equites Imperatoris\" alt=\"Equites Imperatoris\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(5, 1);\" href=\"#\">Equites Imperatoris</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\">&nbsp;Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a><span title=\"+5\">&nbsp;Level 5</span> </td></tr>";
}
if(!$technology->meetRRequirement(6) && !$technology->getTech(6)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u6\" title=\"Equites Caesaris\" alt=\"Equites Caesaris\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(6, 1);\" href=\"#\">Equites Caesaris</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\">&nbsp;Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
Stable</a><span title=\"+10\">&nbsp;Level 10</span> </td></tr>";
}
if(!$technology->meetRRequirement(7) && !$technology->getTech(7)) {
echo "
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u7\" title=\"Battering Ram\" alt=\"Battering Ram\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(7, 1);\" href=\"#\">Battering Ram</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
<span title=\"+7\">&nbsp;Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a><span title=\"+1\">&nbsp;Level 1</span></td></tr>";
}
if(!$technology->meetRRequirement(8) && !$technology->getTech(8)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u8\" title=\"Fire Catapult\" alt=\"Fire Catapult\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(8, 1);\" href=\"#\">Fire Catapult</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a>
<span title=\"+10\">&nbsp;Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\">&nbsp;Level 15</span> </td>
</tr>";
}
if(!$technology->meetRRequirement(9) && !$technology->getTech(9)) {
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u9\" title=\"Senator\" alt=\"Senator\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(9, 1);\" href=\"#\">Senator</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(16, 4);\">Rally Point</a><span title=\"+9\">&nbsp;Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
Academy</a><span title=\"+17\">&nbsp;Level 20</span></td></tr>";
}
echo "<script type=\"text/javascript\">
//<![CDATA[
$(\"researchFuture\").toggle = (function()
{
this.toggleClass(\"hide\");
$(\"researchFutureLink\").set(\"text\",
this.hasClass(\"hide\")
? \"show more\"
: \"hide more\"
);
return false;
}).bind($(\"researchFuture\"));
//]]>
</script>";
echo "</tbody></table>";
}
//$acares = $technology->grabAcademyRes();
if(count($acares) > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Researching</td><td>Duration</td><td>Complete</td></tr>
</thead><tbody>";
$timer = 1;
foreach($acares as $aca) {
$unit = substr($aca['tech'],1,2);
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
?>
+149
View File
@@ -0,0 +1,149 @@
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr>
<td>Academy</td>
<td>Action</td>
</tr></thead>
<tbody>
<?php
$fail = $success = 0;
$acares = $technology->grabAcademyRes();
for($i=12;$i<=19;$i++) {
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
echo "<br><span class=\"none\">Expand warehouse</span></div></td>";
echo "<td class=\"none\">
<div class=\"none\">Expand<br>warehouse</div>
</td></tr>";
}
else if(${'r'.$i}['crop'] > $village->maxcrop) {
echo "<br><span class=\"none\">Expand granary</span></div></td>";
echo "<td class=\"none\">
<div class=\"none\">Expand<br>granary</div>
</td></tr>";
}
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
if($village->getProd("crop")>0){
$time = $technology->calculateAvaliable(22,${'r'.$i});
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
} else {
echo "<br><span class=\"none\">Crop production is negative so you will never reach the required resources</span></div></td>";
}
echo "<td class=\"act\"><div class=\"none\">Too few<br>resources</div></td></tr>";
}
else if ( count($acares) > 0 ) {
echo "</td>";
echo "<td class=\"none\">
Research in progress</td></tr>";
}
else if($session->access != BANNED){
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"build.php?id=$id&amp;a=$i&amp;c=".$session->mchecker."\">Research</a></td></tr>";
}else{
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"banned.php\">Research</a></td></tr>";
}
$success += 1;
}
else {
$fail += 1;
}
}
if($success == 0) {
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">There are no researches avaliable</div></td>";
}
?>
</tbody>
</table>
<?php if($fail > 0) {
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">show more</a></p>
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
<thead><tr><td colspan=\"2\">Prerequisites</td></tr><tbody>";
if(!$technology->meetRRequirement(13) && !$technology->getTech(13)) {
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u13\" title=\"Axeman\" alt=\"Axeman\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(13, 1);\" href=\"#\">Axeman</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a>
<span title=\"+2\">Level 3</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\">Level 1</span> </td></tr>";
}
if(!$technology->meetRRequirement(14) && !$technology->getTech(14)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u14\" title=\"Scout\" alt=\"Scout\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(14, 1);\" href=\"#\">Scout</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+2\">Level 1</span><br /><a href=\"#\" onclick=\"return Popup(15, 4);\">Main Building</a>
<span title=\"+3\">Level 5</span> </td></tr>";
}
if(!$technology->meetRRequirement(15) && !$technology->getTech(15)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u15\" title=\"Paladin\" alt=\"Paladin\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(15, 1);\" href=\"#\">Paladin</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable </a>
<span title=\"+5\">Level 5</span> </td></tr>";
}
if(!$technology->meetRRequirement(16) && !$technology->getTech(16)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u16\" title=\"Teutonic Knight\" alt=\"Teutonic Knight\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(16, 1);\" href=\"#\">Teutonic Knight</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+2\">Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
Stable </a><span title=\"+3\">Level 10</span> </td></tr>";
}
if(!$technology->meetRRequirement(17) && !$technology->getTech(17)) {
echo "
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u17\" title=\"Ram\" alt=\"Ram\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(17, 1);\" href=\"#\">Ram</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a>
<span title=\"+7\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop </a><span title=\"+1\">Level 1</span></td></tr>";
}
if(!$technology->meetRRequirement(18) && !$technology->getTech(18)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u18\" title=\"Catapult\" alt=\"Catapult\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(18, 1);\" href=\"#\">Catapult</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a>
<span title=\"+10\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+12\">Level 15</span> </td>
</tr>";
}
if(!$technology->meetRRequirement(19) && !$technology->getTech(19)) {
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u19\" title=\"Chief\" alt=\"Chief\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(19, 1);\" href=\"#\">Chief</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(16, 4);\">Rally Point </a><span title=\"+4\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
Academy </a><span title=\"+17\">Level 20</span></td></tr>";
}
echo " <script type=\"text/javascript\">
//<![CDATA[
$(\"researchFuture\").toggle = (function()
{
this.toggleClass(\"hide\");
$(\"researchFutureLink\").set(\"text\",
this.hasClass(\"hide\")
? \"show more\"
: \"hide more\"
);
return false;
}).bind($(\"researchFuture\"));
//]]>
</script>";
echo "</tbody></table>";
}
//$acares = $technology->grabAcademyRes();
if(count($acares) > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Researching</td><td>Duration</td><td>Complete</td></tr>
</thead><tbody>";
$timer = 1;
foreach($acares as $aca) {
$unit = substr($aca['tech'],1,2);
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
?>
+153
View File
@@ -0,0 +1,153 @@
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr>
<td>Academy</td>
<td>Action</td>
</tr></thead>
<tbody><tr>
<?php
$fail = $success = 0;
$acares = $technology->grabAcademyRes();
for($i=22;$i<=29;$i++) {
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
echo "<br><span class=\"none\">Expand warehouse</span></div></td>";
echo "<td class=\"none\">
<div class=\"none\">Expand<br>warehouse</div>
</td></tr>";
}
else if(${'r'.$i}['crop'] > $village->maxcrop) {
echo "<br><span class=\"none\">Expand granary</span></div></td>";
echo "<td class=\"none\">
<div class=\"none\">Expand<br>granary</div>
</td></tr>";
}
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
if($village->getProd("crop")>0){
$time = $technology->calculateAvaliable(22,${'r'.$i});
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
} else {
echo "<br><span class=\"none\">Crop production is negative so you will never reach the required resources</span></div></td>";
}
echo "<td class=\"act\"><div class=\"none\">Too few<br>resources</div></td></tr>";
}
else if ( count($acares) > 0 ) {
echo "</td>";
echo "<td class=\"none\">
Research in progress</td></tr>";
}
else if($session->access != BANNED){
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"build.php?id=$id&amp;a=$i&amp;c=".$session->mchecker."\">Research</a></td></tr>";
}else{
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"banned.php\">Research</a></td></tr>";
}
$success +=1;
}
else {
$fail += 1;
}
}
if($success == 0) {
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">There are no researches avaliable</div></td>";
}
?>
</tbody></table>
<?php if($fail > 0) {
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">show more</a></p>
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
<thead><tr><td colspan=\"2\">Prerequisites</td></tr><tbody>";
if(!$technology->meetRRequirement(22) && !$technology->getTech(22)) {
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u22\" title=\"Swordsman\" alt=\"Swordsman\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(22, 1);\" href=\"#\">Swordsman</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
<span title=\"+2\">&nbsp;Level 3</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\">&nbsp;Level 1</span></td></tr>";
}
if(!$technology->meetRRequirement(23) && !$technology->getTech(23)) {
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u23\" title=\"Pathfinder\" alt=\"Pathfinder\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(23, 1);\" href=\"#\">Pathfinder</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
<span title=\"+2\">&nbsp;Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable </a><span title=\"+1\">&nbsp;Level 1</span> </td></tr>";
}
if(!$technology->meetRRequirement(24) && !$technology->getTech(24)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u24\" title=\"Theutates Thunder\" alt=\"Theutates Thunder\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(24, 1);\" href=\"#\">Theutates Thunder</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\">&nbsp;Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a>
<span title=\"+3\">&nbsp;Level 3</span> </td></tr>";
}
if(!$technology->meetRRequirement(25) && !$technology->getTech(25)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u25\" title=\"Druidrider\" alt=\"Druidrider\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(25, 1);\" href=\"#\">Druidrider</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\">&nbsp;Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a>
<span title=\"+5\">&nbsp;Level 5</span> </td></tr>";
}
if(!$technology->meetRRequirement(26) && !$technology->getTech(26)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u26\" title=\"Haeduan\" alt=\"Haeduan\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(26, 1);\" href=\"#\">Haeduan</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\">&nbsp;Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
Stable</a><span title=\"+10\">&nbsp;Level 10</span> </td></tr>";
}
if(!$technology->meetRRequirement(27) && !$technology->getTech(27)) {
echo "
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u27\" title=\"Ram\" alt=\"Ram\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(27, 1);\" href=\"#\">Ram</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
<span title=\"+7\">&nbsp;Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a><span title=\"+1\">&nbsp;Level 1</span></td></tr>";
}
if(!$technology->meetRRequirement(28) && !$technology->getTech(28)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u28\" title=\"Trebuchet\" alt=\"Trebuchet\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(28, 1);\" href=\"#\">Trebuchet</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a>
<span title=\"+10\">&nbsp;Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\">&nbsp;Level 15</span> </td>
</tr>";
}
if(!$technology->meetRRequirement(29) && !$technology->getTech(29)) {
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u29\" title=\"Chieftain\" alt=\"Chieftain\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(29, 1);\" href=\"#\">Chieftain</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(14, 4);\">Rally Point</a><span title=\"+9\">&nbsp;Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
Academy</a><span title=\"+17\">&nbsp;Level 20</span></td></tr>";
}
echo " <script type=\"text/javascript\">
//<![CDATA[
$(\"researchFuture\").toggle = (function()
{
this.toggleClass(\"hide\");
$(\"researchFutureLink\").set(\"text\",
this.hasClass(\"hide\")
? \"show more\"
: \"hide more\"
);
return false;
}).bind($(\"researchFuture\"));
//]]>
</script>";
echo "</tbody></table>";
}
$acares = $technology->grabAcademyRes();
if(count($acares) > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Researching</td><td>Duration</td><td>Complete</td></tr>
</thead><tbody>";
$timer = 1;
foreach($acares as $aca) {
$unit = substr($aca['tech'],1,2);
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
?>
+148
View File
@@ -0,0 +1,148 @@
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr>
<td>Academy</td>
<td>Action</td>
</tr></thead>
<tbody>
<?php
$fail = $success = 0;
$acares = $technology->grabAcademyRes();
for($i=32;$i<=39;$i++) {
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
echo "<br><span class=\"none\">Expand warehouse</span></div></td>";
echo "<td class=\"none\">
<div class=\"none\">Expand<br>warehouse</div>
</td></tr>";
}
else if(${'r'.$i}['crop'] > $village->maxcrop) {
echo "<br><span class=\"none\">Expand granary</span></div></td>";
echo "<td class=\"none\">
<div class=\"none\">Expand<br>granary</div>
</td></tr>";
}
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
$time = $technology->calculateAvaliable($i);
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
echo "<td class=\"none\">
<div class=\"none\">Too few<br>resources</div>
</td></tr>";
}
else if ( count($acares) > 0 ) {
echo "</td>";
echo "<td class=\"none\">
Research in progress</td></tr>";
}
else {
else if($session->access != BANNED){
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"build.php?id=$id&amp;a=$i&amp;c=".$session->mchecker."\">Research</a></td></tr>";
}else{
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"banned.php\">Research</a></td></tr>";
}
$success += 1;
}
else {
$fail += 1;
}
}
if($success == 0) {
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">There are no researches avaliable</div></td>";
}
?>
</tbody>
</table>
<?php if($fail > 0) {
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">show more</a></p>
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
<thead><tr><td colspan=\"2\">Prerequisites</td></tr><tbody>";
if(!$technology->meetRRequirement(33) && !$technology->getTech(33)) {
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u33\" title=\"".U33."\" alt=\"".U33."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(33, 1);\" href=\"#\">".U33."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a>
<span title=\"+2\">Level 3</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\">Level 1</span> </td></tr>";
}
if(!$technology->meetRRequirement(34) && !$technology->getTech(34)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u34\" title=\"".U34."\" alt=\"".U34."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(34, 1);\" href=\"#\">".U34."</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+2\">Level 1</span><br /><a href=\"#\" onclick=\"return Popup(15, 4);\">Main Building</a>
<span title=\"+3\">Level 5</span> </td></tr>";
}
if(!$technology->meetRRequirement(35) && !$technology->getTech(35)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u35\" title=\"".U35."\" alt=\"".U35."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(35, 1);\" href=\"#\">".U35."</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable </a>
<span title=\"+5\">Level 5</span> </td></tr>";
}
if(!$technology->meetRRequirement(36) && !$technology->getTech(36)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u36\" title=\"".U36."\" alt=\"".U36."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(36, 1);\" href=\"#\">".U36."</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+2\">Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
Stable </a><span title=\"+3\">Level 10</span> </td></tr>";
}
if(!$technology->meetRRequirement(17) && !$technology->getTech(17)) {
echo "
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u37\" title=\"".U37."\" alt=\"".U37."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(37, 1);\" href=\"#\">".U37."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a>
<span title=\"+7\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop </a><span title=\"+1\">Level 1</span></td></tr>";
}
if(!$technology->meetRRequirement(38) && !$technology->getTech(38)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u38\" title=\"".U38."\" alt=\"".U38."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(38, 1);\" href=\"#\">".U38."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a>
<span title=\"+10\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+12\">Level 15</span> </td>
</tr>";
}
if(!$technology->meetRRequirement(39) && !$technology->getTech(39)) {
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u39\" title=\"".U33."\" alt=\"".U33."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(39, 1);\" href=\"#\">".U39."</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(16, 4);\">Rally Point </a><span title=\"+4\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
Academy </a><span title=\"+17\">Level 20</span></td></tr>";
}
echo " <script type=\"text/javascript\">
//<![CDATA[
$(\"researchFuture\").toggle = (function()
{
this.toggleClass(\"hide\");
$(\"researchFutureLink\").set(\"text\",
this.hasClass(\"hide\")
? \"show more\"
: \"hide more\"
);
return false;
}).bind($(\"researchFuture\"));
//]]>
</script>";
echo "</tbody></table>";
}
//$acares = $technology->grabAcademyRes();
if(count($acares) > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Researching</td><td>Duration</td><td>Complete</td></tr>
</thead><tbody>";
$timer = 1;
foreach($acares as $aca) {
$unit = substr($aca['tech'],1,2);
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
?>
+143
View File
@@ -0,0 +1,143 @@
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr>
<td>Academy</td>
<td>Action</td>
</tr></thead>
<tbody>
<?php
$fail = $success = 0;
$acares = $technology->grabAcademyRes();
for($i=42;$i<=49;$i++) {
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
echo "<br><span class=\"none\">Expand warehouse</span></div></td>";
echo "<td class=\"none\">
<div class=\"none\">Expand<br>warehouse</div>
</td></tr>";
}
else if(${'r'.$i}['crop'] > $village->maxcrop) {
echo "<br><span class=\"none\">Expand granary</span></div></td>";
echo "<td class=\"none\">
<div class=\"none\">Expand<br>granary</div>
</td></tr>";
}
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
$time = $technology->calculateAvaliable($i);
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
echo "<td class=\"none\">
<div class=\"none\">Too few<br>resources</div>
</td></tr>";
}
else if ( count($acares) > 0 ) {
echo "</td>";
echo "<td class=\"none\">
Research in progress</td></tr>";
}
else {
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"build.php?id=$id&amp;a=$i&amp;c=".$session->mchecker."\">Research</a></td></tr>";
}
$success += 1;
}
else {
$fail += 1;
}
}
if($success == 0) {
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">There are no researches avaliable</div></td>";
}
?>
</tbody>
</table>
<?php if($fail > 0) {
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">show more</a></p>
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
<thead><tr><td colspan=\"2\">Prerequisites</td></tr><tbody>";
if(!$technology->meetRRequirement(43) && !$technology->getTech(43)) {
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u43\" title=\"".U43."\" alt=\"".U33."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(43, 1);\" href=\"#\">".U43."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a>
<span title=\"+2\">Level 3</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\">Level 1</span> </td></tr>";
}
if(!$technology->meetRRequirement(44) && !$technology->getTech(44)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u44\" title=\"".U44."\" alt=\"".U44."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(34, 1);\" href=\"#\">".U44."</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(44, 5);\">Academy </a><span title=\"+2\">Level 1</span><br /><a href=\"#\" onclick=\"return Popup(15, 4);\">Main Building</a>
<span title=\"+3\">Level 5</span> </td></tr>";
}
if(!$technology->meetRRequirement(45) && !$technology->getTech(45)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u45\" title=\"".U45."\" alt=\"".U45."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(45, 1);\" href=\"#\">".U45."</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(45, 4);\">Academy </a><span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable </a>
<span title=\"+5\">Level 5</span> </td></tr>";
}
if(!$technology->meetRRequirement(46) && !$technology->getTech(46)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u46\" title=\"".U46."\" alt=\"".U46."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(46, 1);\" href=\"#\">".U46."</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+2\">Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
Stable </a><span title=\"+3\">Level 10</span> </td></tr>";
}
if(!$technology->meetRRequirement(47) && !$technology->getTech(47)) {
echo "
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u47\" title=\"".U47."\" alt=\"".U47."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(47, 1);\" href=\"#\">".U47."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a>
<span title=\"+7\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop </a><span title=\"+1\">Level 1</span></td></tr>";
}
if(!$technology->meetRRequirement(48) && !$technology->getTech(48)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u48\" title=\"".U48."\" alt=\"".U48."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(48, 1);\" href=\"#\">".U48."</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a>
<span title=\"+10\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy </a><span title=\"+12\">Level 15</span> </td>
</tr>";
}
if(!$technology->meetRRequirement(49) && !$technology->getTech(49)) {
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u49\" title=\"".U49."\" alt=\"".U43."\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(49, 1);\" href=\"#\">".U49."</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(16, 4);\">Rally Point </a><span title=\"+4\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
Academy </a><span title=\"+17\">Level 20</span></td></tr>";
}
echo " <script type=\"text/javascript\">
//<![CDATA[
$(\"researchFuture\").toggle = (function()
{
this.toggleClass(\"hide\");
$(\"researchFutureLink\").set(\"text\",
this.hasClass(\"hide\")
? \"show more\"
: \"hide more\"
);
return false;
}).bind($(\"researchFuture\"));
//]]>
</script>";
echo "</tbody></table>";
}
//$acares = $technology->grabAcademyRes();
if(count($acares) > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Researching</td><td>Duration</td><td>Complete</td></tr>
</thead><tbody>";
$timer = 1;
foreach($acares as $aca) {
$unit = substr($aca['tech'],1,2);
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
?>
+83
View File
@@ -0,0 +1,83 @@
<?php
include("next.tpl");
$artefact_2 = count($database->getOwnUniqueArtefactInfo2($session->uid,7,3,0));
$artefact1_2 = count($database->getOwnUniqueArtefactInfo2($village->wid,7,1,1));
$artefact2_2 = count($database->getOwnUniqueArtefactInfo2($session->uid,7,2,0));
if($artefact_2 > 0){
$artefact_bouns = 6;
}else if($artefact1_2 > 0){
$artefact_bouns = 3;
}else if($artefact2_2 > 0){
$artefact_bouns = 2;
}else{
$artefact_bouns = 1;
}
$good_effect = $bad_effect = 1;
$foolartefact = $database->getFoolArtefactInfo(7,$village->wid,$seesion->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$bad_effect = $arte['effect2'];
}else{
$good_effect = $arte['effect2'];
}
}
}
?>
<div id="build" class="gid23"><a href="#" onClick="return Popup(23,4);" class="build_logo">
<img class="building g23" src="img/x.gif" alt="Cranny" title="Cranny" />
</a>
<h1>Cranny <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">The cranny is used to hide some of your resources when the village is attacked. These resources cannot be stolen.</p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th>Currently hidden units per resource:</th>
<?php
if($session->tribe == 3) {
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']*2*CRANNY_CAPACITY; ?></b> units</td>
<?php
}else{
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']*CRANNY_CAPACITY; ?></b> units</td>
<?php
}
?>
</tr>
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
if($next<=10){
?>
<th>Hidden units per resource at level <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master; ?>:</th>
<?php
if($session->tribe == 3) {
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*2*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<?php
}else{
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<?php
}}else{
?>
<th>Hidden units per resource at level 20:</th>
<?php
if($session->tribe == 3) {
?>
<td><b><?php echo $bid23[10]['attri']*2*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<?php
}else{
?>
<td><b><?php echo $bid23[10]['attri']*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<?php
}}}
?>
</tr>
</table>
<?php
include("upgrade.tpl");
?>
</p></div>
+18
View File
@@ -0,0 +1,18 @@
<div id="build" class="gid24"><a href="#" onClick="return Popup(24,4);" class="build_logo">
<img class="building g24" src="img/x.gif" alt="Town Hall" title="Town Hall" />
</a>
<h1>Town Hall <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">You can hold pompous celebrations in the Town Hall. Such a celebration increases your culture points. Building up your Town Hall to a higher level will decrease the length of the celebration.
</p>
<?php
if ($building->getTypeLevel(24) > 0) {
include("Templates/Build/24_1.tpl");
include("Templates/Build/24_2.tpl");
} else {
echo "<p><b>Celebrations can commence when the town hall is completed.</b><br>\n";
}
include("upgrade.tpl");
?>
</p></div>
+74
View File
@@ -0,0 +1,74 @@
<table cellpadding="1" cellspacing="1" class="build_details">
<thead>
<tr>
<td>Celebrations</td>
<td>Action</td>
</tr>
</thead>
<tbody>
<tr>
<?php
$level = $village->resarray['f'.$id];
$inuse = $database->getVillageField($village->wid, 'celebration');
$time = Time();
$i = 1;
echo "<tr><td class=\"desc\"><div class=\"tit\">".$cel[$i]['name']." (".$cel[$i]['attri']." culture points)</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".$cel[$i]['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$cel[$i]['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$cel[$i]['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$cel[$i]['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round($cel[$i]['time'] * ($bid24[$building->getTypeLevel(24)]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".$cel[$i]['wood']."&r2=".$cel[$i]['clay']."&r3=".$cel[$i]['iron']."&r4=".$cel[$i]['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if($inuse > $time){
echo "<td class=\"act\">
<div class=\"none\">Celebration</br>in progress</div>
</td></tr>";
}
else if($cel[$i]['wood'] > $village->awood || $cel[$i]['clay'] > $village->aclay || $cel[$i]['iron'] > $village->airon || $cel[$i]['crop'] > $village->acrop) {
if($village->getProd("crop")>0){
$time = $technology->calculateAvaliable(24,$cel[$i]);
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
} else {
echo "<br><span class=\"none\">Crop production is negative so you will never reach the required resources</span></div></td>";
}
echo "<td class=\"act\"><div class=\"none\">Too few<br>resources</div></td></tr>";
}
else {
echo "</td>";
echo "<td class=\"act\">";
echo "<a class=\"research\" href=\"celebration.php?type=$i&id=$id\">hold</a></td></tr>";
}
if($level >= 10){
$level = $village->resarray['f'.$id];
echo "<tr><td class=\"desc\">
<div class=\"tit\">
Great celebration (2000 culture points)
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />29700|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />33250|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />32000|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />6700|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round($gc[$level]/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=29700&r2=33250&r3=32000&r4=6700\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if($inuse > $time){
echo "<td class=\"act\">
<div class=\"none\">Celebration<br />in progress</div>
</td></tr>";
}
else if(29700 > $village->awood || 33250 > $village->aclay || 32000 > $village->airon || 6700 > $village->acrop) {
$time = $technology->calculateAvaliable(24,$cel[2]);
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
echo "<td class=\"act\">
<div class=\"none\">Too few<br>resources</div>
</td></tr>";
}
else {
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"celebration.php?type=2&id=$id\">hold</a></td></tr>";
}
}
?>
</tbody>
</table>
+18
View File
@@ -0,0 +1,18 @@
<?php
if(!isset($timer)) {
$timer = 1;
}
$timeleft = $database->getVillageField($village->wid, 'celebration');
if($timeleft > Time()){
echo '</br>';
echo '<table cellpadding="0" cellspacing="0" id="building_contract">';
echo '<tr><td>';
echo 'celebration still needs:';
echo "</td><td><span id=\"timer".$timer."\">";
echo $generator->getTimeFormat($timeleft-time());
echo "</span> hrs.</td>";
echo "<td>done at ".date('H:i', $timeleft)."</td></tr>";
echo "</table>";
$timer +=1;
}
?>
+26
View File
@@ -0,0 +1,26 @@
<div id="build" class="gid25"><h1>Residence <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">
<a href="#" onClick="return Popup(25,4, 'gid');"
class="build_logo"> <img
class="building g25"
src="img/x.gif" alt="Residence"
title="Residence" /> </a>
The residence is a small palace, where the king or queen lives when (s)he visits the village. The residence protects the village against enemies who want to conquer it.</p>
<?php
if ($village->capital == 1) {
echo "<p class=\"act\">This is your capital</p>";
}
include("25_menu.tpl");
if($village->resarray['f'.$id] >= 10){
include ("25_train.tpl");
}
else{
echo '<div class="c">In order to found a new village you need a level 10 or 20 residence and 3 settlers. In order to conquer a new village you need a level 10 or 20 residence and a senator, chief or chieftain.</div>';
}
include("upgrade.tpl");
?>
</div>
+28
View File
@@ -0,0 +1,28 @@
<div id="build" class="gid25"><h1>Residence <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">
<a href="#" onClick="return Popup(25,4, 'gid');"
class="build_logo"> <img
class="building g25"
src="img/x.gif" alt="Residence"
title="Residence" /> </a>
The residence is a small palace, where the king or queen lives when (s)he visits the village. The residence protects the village against enemies who want to conquer it.</p>
<?php include("25_menu.tpl"); ?>
<p>In order to extend your empire you need culture points. These culture points increase in the course of time and do so faster as your building levels increase.</p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th>Production of this village:</th>
<?php if($database->getVillageField($village->wid, 'natar') == 0){ ?>
<td><b><?php echo $database->getVillageField($village->wid, 'cp'); ?></b> Culture points per day</td>
<?php }else{ ?>
<td><b>0</b> Culture points per day</td>
<?php } ?>
</tr>
<tr>
<th>Production of all villages:</th>
<td><b><?php echo $database->getVSumField($session->uid, 'cp'); ?></b> Culture points per day</td>
</tr>
</table><p>Your villages have produced <b><?php echo $session->cp; ?></b> points in total. To found or conquer a new village you need <b><?php $mode = CP; $total = count($database->getProfileVillages($session->uid)); echo ${'cp'.$mode}[$total+1]; ?></b> points.</p>
</div>
+13
View File
@@ -0,0 +1,13 @@
<div id="build" class="gid25"><h1>Residence <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">
<a href="#" onClick="return Popup(25,4, 'gid');"
class="build_logo"> <img
class="building g25"
src="img/x.gif" alt="Residence"
title="Residence" /> </a>
The residence is a small palace, where the king or queen lives when (s)he visits the village. The residence protects the village against enemies who want to conquer it.</p>
<?php include("25_menu.tpl"); ?>
By attacking with senators, chiefs or chieftains a village's loyalty can be brought down. If it reaches zero, the village joins the realm of the attacker. The loyalty of this village is currently at <b><?php echo floor($database->getVillageField($village->wid,'loyalty')); ?></b> percent.</div>
+54
View File
@@ -0,0 +1,54 @@
<div id="build" class="gid25"><h1>Residence <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">
<a href="#" onClick="return Popup(25,4, 'gid');"
class="build_logo"> <img
class="building g25"
src="img/x.gif" alt="Residence"
title="Residence" /> </a>
The residence is a small palace, where the king or queen lives when (s)he visits the village. The residence protects the village against enemies who want to conquer it.</p>
<?php include("25_menu.tpl"); ?>
<table cellpadding="1" cellspacing="1" id="expansion">
<thead><tr>
<th colspan="6"><a name="h2"></a>Villages founded or conquered by this village</th>
</tr>
<tr>
<td colspan="2">Village</td>
<td>Player</td>
<td>Inhabitants</td>
<td>Coordinates</td>
<td>Date</td>
</tr></thead>
<tbody>
<?php
$slot1 = $database->getVillageField($village->wid, 'exp1');
$slot2 = $database->getVillageField($village->wid, 'exp2');
$slot3 = $database->getVillageField($village->wid, 'exp3');
if($slot1 != 0 || $slot2 != 0 || $slot3 != 0){
for($i=1; $i <= 3; $i++){
if (${'slot'.$i}<>0) {
$coor = $database->getCoor(${'slot'.$i});
$vname = $database->getVillageField(${'slot'.$i},'name');
$owner = $database->getVillageField(${'slot'.$i},'owner');
$pop = $database->getVillageField(${'slot'.$i},'pop');
$vcreated = $database->getVillageField(${'slot'.$i},'created');
$ownername = $database->getUserField($owner,'username',0);
echo '
<tr>
<td class="ra">'.$i.'.</td>
<td class="vil"><a href="karte.php?d='.${'slot'.$i}.'&c='.$generator->getMapCheck(${'slot'.$i}).'">'.$vname.'</a></td>
<td class="pla"><a href="spieler.php?uid='.$owner.'">'.$ownername.'</a></td>
<td class="ha">'.$pop.'</td>
<td class="aligned_coords"><div class="cox">('.$coor['x'].'</div><div class="pi">|</div><div class="coy">'.$coor['y'].')</div></td>
<td class="dat">'.date('d-m-Y',$vcreated).'</td>
</tr>';
}
}
}
else{
echo '<tr><td colspan="6" class="none">No other village has been founded or conquered by this village yet.</td></tr>';
}
?>
</tbody></table></div>
+65
View File
@@ -0,0 +1,65 @@
<form method="POST" name="snd" action="build.php">
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="hidden" name="ft" value="t1" />
<table cellpadding="1" cellspacing="1" class="build_details">
<thead>
<tr>
<td>Naam</td>
<td>Aantal</td>
<td>max</td>
</tr>
</thead>
<tbody>
<?php
$i = 20;
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span>
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round(${'u'.$i}['time']/SPEED));
//if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
//echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
//}
echo "
<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$technology->maxUnit($i)."; return false;\">(".$technology->maxUnit($i).")</a></td></tr></tbody>
";
?>
</tbody>
</table>
<p>
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
</p>
<?php
$trainlist = $technology->getTrainingList(20);
if(count($trainlist) > 0) {
$timer = 2*count($trainlist);
echo "
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
<thead><tr>
<td>Training</td>
<td>Duration</td>
<td>Finished</td>
</tr></thead>
<tbody>";
foreach($trainlist as $train) {
echo "<tr><td class=\"desc\">";
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />".$train['amt']." ".$train['name']."</td><td class=\"dur\"><span id=timer".$timer.">".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span></td><td class=\"fin\">";
$timer -= 1;
$time = $generator->procMTime($train['commence']+(1*$train['amt']));
if($time[0] != "today") {
echo "on ".$time[0]." at";
}
echo $time[1]."</span><span> o'clock</td>
</tr><tr class=\"next\"><td colspan=\"3\">The next unit will be finished in <span id=timer".$timer.">".$generator->getTimeFormat(($train['commence']+$train['eachtime'])-time())."</span></td></tr>";
}
echo "</tbody></table>";
}
?>
</form>
+7
View File
@@ -0,0 +1,7 @@
<div id="textmenu">
<a href="build.php?id=<?php echo $id; ?>" <?php if(!isset($_GET['s'])) { echo "class=\"selected\""; } ?>>Train</a>
| <a href="build.php?id=<?php echo $id; ?>&amp;s=2" <?php if(isset($_GET['s']) && $_GET['s'] == 2) { echo "class=\"selected\""; } ?>>Culture points</a>
| <a href="build.php?id=<?php echo $id; ?>&amp;s=3" <?php if(isset($_GET['s']) && $_GET['s'] == 3) { echo "class=\"selected\""; } ?>>Loyalty</a>
| <a href="build.php?id=<?php echo $id; ?>&amp;s=4" <?php if(isset($_GET['s']) && $_GET['s'] == 4) { echo "class=\"selected\""; } ?>>Expansion</a>
</div>
+34
View File
@@ -0,0 +1,34 @@
<?php
$trainlist = $technology->getTrainingList(4);
if(count($trainlist) > 0) {
echo "
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
<thead><tr>
<td>Training</td>
<td>Duration</td>
<td>Finished</td>
</tr></thead>
<tbody>";
$TrainCount = 0;
foreach($trainlist as $train) {
$TrainCount++;
echo "<tr><td class=\"desc\">";
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
if ($TrainCount == 1 ) {
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
} else {
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
}
echo "</td><td class=\"fin\">";
$time = $generator->procMTime($train['timestamp']);
if($time[0] != "today") {
echo "on ".$time[0]." at ";
}
echo $time[1];
} ?>
</tr><tr class="next"><td colspan="3">The next unit will be finished in <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
</tbody></table>
<?php }
?>
+88
View File
@@ -0,0 +1,88 @@
<?php
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
if($artefact > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact1 > 0){
$artefact_bonus = 2;
$artefact_bonus2 = 1;
}else if($artefact2 > 0){
$artefact_bonus = 4;
$artefact_bonus2 = 3;
}else{
$artefact_bonus = 1;
$artefact_bonus2 = 1;
}
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename 25_train.tpl ##
## Made by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
$slots = $database->getAvailableExpansionTraining();
if ($slots['settlers']+$slots['chiefs']>0) { ?>
<form method="POST" name="snd" action="build.php">
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="hidden" name="ft" value="t1" />
<table cellpadding="1" cellspacing="1" class="build_details">
<thead>
<tr>
<td>Name</td>
<td>Quantity</td>
<td>Max</td>
</tr>
</thead>
<tbody>
<?php
for ($i=($session->tribe-1)*10+9;$i<=($session->tribe*10);$i++) {
if ($slots['settlers']>0 && $i%10==0 || $slots['chiefs']>0 && $i%10==9 && $session->tribe != 4) {
$maxunit = MIN($technology->maxUnit($i),($i%10==0?$slots['settlers']:$slots['chiefs']));
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span></div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
$dur=round(${'u'.$i}['time'] * ($bid25[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$dur *= $arte['effect2'];
}else{
$dur /= $arte['effect2'];
$dur = round($dur);
}
}
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
<td class=\"max\"><a href=\"#\" onClick=\"document.snd.t".$i.".value=".$maxunit."; return false;\">(".$maxunit.")</a></td></tr></tbody>";
}
} ?>
</div>
</tbody>
</table>
<p>
<input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
</p>
</form>
<?php
} else {
echo '<div class="c">In order to found a new village you need a level 10 or 20 residence and 3 settlers. In order to conquer a new village you need a level 10 or 20 residence and a senator, chief or chieftain.</div>';
}
include ("25_progress.tpl");
?>
+97
View File
@@ -0,0 +1,97 @@
<?php
error_reporting(e_all);
if(time() - $_SESSION['time_p'] > 5) {
$_SESSION['time_p'] = '';
$_SESSION['error_p'] = '';
}
if($_POST AND $_GET['action'] == 'change_capital') {
$pass = mysql_escape_string($_POST['pass']);
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $session->uid);
$data = mysql_fetch_assoc($query);
if($data['password'] == md5($pass)) {
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
$data1 = mysql_fetch_assoc($query1);
$query2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'fdata` WHERE `vref` = ' . $data1['wref']);
$data2 = mysql_fetch_assoc($query2);
if($data2['vref'] != $village->wid) {
for($i = 1; $i<=18; ++$i) {
if($data2['f' . $i] > 10) {
$query2 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . '` = 10 WHERE `vref` = ' . $data2['vref']) or die(mysql_error());
}
}
for($i=19; $i<=40; ++$i) {
if($data2['f' . $i . 't'] == 34) {
$query3 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . $data2['vref']) or die(mysql_error());
}
}
for($i=19; $i<=40; ++$i) {
if($data2['f' . $i . 't'] == 29 or $data2['f' . $i . 't'] == 30 or $data2['f' . $i . 't'] == 38 or $data2['f' . $i . 't'] == 39 or $data2['f' . $i . 't'] == 42) {
$query3 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . $village->wid) or die(mysql_error());
}
}
$query3 = mysql_query('UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 0 WHERE `wref` = ' . $data1['wref']);
$query4 = mysql_query('UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 1 WHERE `wref` = ' . $village->wid);
}
} else {
$error = '<br /><font color="red">password is wrong</font><br />';
$_SESSION['error_p'] = $error;
$_SESSION['time_p'] = time();
print '<script language="javascript">location.href="build.php?id=' . $building->getTypeField(26) . '&confirm=yes";</script>';
}
}
?>
<div id="build" class="gid26"><h1>Palace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">
<a href="#" onClick="return Popup(26,4, 'gid');"
class="build_logo"> <img
class="building g26"
src="img/x.gif" alt="Palace"
title="Palace" /> </a>
The king or queen of the empire lives in the palace. Only one palace can exist in your realm at a time. You need a palace in order to proclaim a village to be your capital.</p>
<?php
if ($building->getTypeLevel(26) > 0) {
include("26_menu.tpl");
$test=$database->getAvailableExpansionTraining();
if($village->resarray['f'.$id] >= 10){
include ("26_train.tpl");
}
else{
echo '<div class="c">In order to found a new village you need a level 10, 15 or 20 palace and 3 settlers. In order to conquer a new village you need a level 10, 15 or 20 palace and a senator, chief or chieftain.</div>';
}
?>
<?php
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
$data = mysql_fetch_assoc($query);
if($data['wref'] == $village->wid) {
?>
<p class="none">This is your capital</p>
<?php
} else {
if($_GET['confirm'] == '') {
print '<p><a href="?id=' . $building->getTypeField(26) . '&confirm=yes">&raquo change capital</a></p>';
} else {
print '<p>Are you sure, that you want to change your capital?<br /><b>You can\'t undone this!</b>.<br />For security you must enter your password to confirm:<br />
<form method="post" action="build.php?id=' . $building->getTypeField(26) . '&action=change_capital">
' . $_SESSION['error_p'] . '
password: <input type="password" name="pass" /><br />
<input type="image" id="btn_ok" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" />
</form>
</p>';
}
}
} else {
echo "<b>Palace under construction</b>";
}
include("upgrade.tpl");
?>
</div>
+27
View File
@@ -0,0 +1,27 @@
<div id="build" class="gid26"><h1>Palace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">
<a href="#" onClick="return Popup(26,4, 'gid');"
class="build_logo"> <img
class="building g26"
src="img/x.gif" alt="Palace"
title="Palace" /> </a>
The king or queen of the empire lives in the palace. Only one palace can exist in your realm at a time. You need a palace in order to proclaim a village to be your capital.</p>
<?php include("26_menu.tpl"); ?>
<p>In order to extend your empire you need culture points. These culture points increase in the course of time and do so faster as your building levels increase.</p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th>Production of this village:</th>
<?php if($database->getVillageField($village->wid, 'natar') == 0){ ?>
<td><b><?php echo $database->getVillageField($village->wid, 'cp'); ?></b> Culture points per day</td>
<?php }else{ ?>
<td><b>0</b> Culture points per day</td>
<?php } ?>
</tr>
<tr>
<th>Production of all villages:</th>
<td><b><?php echo $database->getVSumField($session->uid, 'cp'); ?></b> Culture points per day</td>
</tr>
</table><p>Your villages have produced <b><?php echo $session->cp; ?></b> points in total. To found or conquer a new village you need <b><?php $mode = CP; $total = count($database->getProfileVillages($session->uid)); echo ${'cp'.$mode}[$total+1]; ?></b> points.</p>
</div>
+13
View File
@@ -0,0 +1,13 @@
<div id="build" class="gid26"><h1>Palace <span class="level">level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">
<a href="#" onClick="return Popup(26,4, 'gid');"
class="build_logo"> <img
class="building g26"
src="img/x.gif" alt="Palace"
title="Palace" /> </a>
The king or queen of the empire lives in the palace. Only one palace can exist in your realm at a time. You need a palace in order to proclaim a village to be your capital.</p>
<?php include("26_menu.tpl"); ?>
By attacking with senators, chiefs or chieftains a village's loyalty can be brought down. If it reaches zero, the village joins the realm of the attacker. The loyalty of this village is currently at <b><?php echo floor($database->getVillageField($village->wid,'loyalty')); ?></b> percent.</div>

Some files were not shown because too many files have changed in this diff Show More