Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Travian T4 old file yi12345 90% Fix

Status
Not open for further replies.
Newbie Spellweaver
Joined
Dec 8, 2012
Messages
20
Reaction score
0
Hi Everyone Here ,,,, I Just uploaded my Server on 1freehost ,,,
and it's Nice ,,,, but I have many Problem on Database ,,, but I fix them all "and i am going to pop the oasis"
But I have A problem with the Hero Images ,,, On the Profile account ,, and on the Hero Options ,,
and I don't have these Problems with Localhost server ,,, just on my Freehosting :p

and my "Hero_image.php" is :
PHP:
<?php 
include("GameEngine/Database.php");
if(isset($_GET['uid'])){
    $uid =  $_GET['uid'];
} else {
    $uid = "1";
}
if(isset($_GET['size'])){
	if($_GET['size']=='profile'){
    	$size =  '31x40';
	}elseif($_GET['size']=='inventory'){
    	$size =  '64x82';
	}elseif($_GET['size']=='sideinfo'){
    	$size =  '119x136';
	}
} else {
    $size = "119x136";
}
$herodetail = $database->HeroFace($uid);
if($herodetail['color']==0){
	$color = "black";
}
if($herodetail['color']==1){
	$color = "brown";
}
if($herodetail['color']==2){
	$color = "darkbrown";
}
if($herodetail['color']==3){
	$color = "yellow";
}
if($herodetail['color']==4){
	$color = "red";
}
$geteye = $herodetail['eye'];
$geteyebrow = $herodetail['eyebrow'];
$getnose = $herodetail['nose'];
$getear = $herodetail['ear'];
$getmouth = $herodetail['mouth'];
$getbeard = $herodetail['beard'];
$gethair = $herodetail['hair'];
$getface = $herodetail['face'];



// USAGE EXAMPLE: 
$body = imagecreatefrompng('img/hero/head/'.$size.'/face0.png');
if($getbeard!=5){
	$beard = imagecreatefrompng('img/hero/head/'.$size.'/beard/beard'.$getbeard.'-'.$color.'.png');
}
$ear = imagecreatefrompng('img/hero/head/'.$size.'/ear/ear'.$getear.'.png');
$eye = imagecreatefrompng('img/hero/head/'.$size.'/eye/eye'.$geteye.'.png');
$eyebrow = imagecreatefrompng('img/hero/head/'.$size.'/eyebrow/eyebrow'.$geteyebrow.'-'.$color.'.png');
if($gethair!=5){
	$hair = imagecreatefrompng('img/hero/head/'.$size.'/hair/hair'.$gethair.'-'.$color.'.png');
}
$mouth = imagecreatefrompng('img/hero/head/'.$size.'/mouth/mouth'.$getmouth.'.png');
$nose = imagecreatefrompng('img/hero/head/'.$size.'/nose/nose'.$getnose.'.png');
$face = imagecreatefrompng('img/hero/head/'.$size.'/face/face'.$getface.'.png');



// SAME COMMANDS: 
$database->imagecopymerge_alpha($body, $face, 0, 0, 0, 0, imagesx($face), imagesy($face),100); 
$database->imagecopymerge_alpha($body, $ear, 0, 0, 0, 0, imagesx($ear), imagesy($ear),100);
$database->imagecopymerge_alpha($body, $eye, 0, 0, 0, 0, imagesx($eye), imagesy($eye),100);
$database->imagecopymerge_alpha($body, $eyebrow, 0, 0, 0, 0, imagesx($eyebrow), imagesy($eyebrow),100);
if($gethair!=5){
$database->imagecopymerge_alpha($body, $hair, 0, 0, 0, 0, imagesx($hair), imagesy($hair),100);
}
$database->imagecopymerge_alpha($body, $mouth, 0, 0, 0, 0, imagesx($mouth), imagesy($mouth),100);
$database->imagecopymerge_alpha($body, $nose, 0, 0, 0, 0, imagesx($nose), imagesy($nose),100);
if($getbeard!=5){
$database->imagecopymerge_alpha($body, $beard, 0, 0, 0, 0, imagesx($beard), imagesy($beard),100);
}


// OUTPUT IMAGE: 
header("Content-Type: image/png"); 
imagesavealpha($body, true); 
imagepng($body, NULL); 

?>

and My "hero_body.php" is :
PHP:
<?php 
session_start();
include("GameEngine/Database.php");
if(isset($_GET['uid'])){
    $uid =  $_GET['uid'];
} else {
    $uid = "1";
}
if(isset($_GET['size'])){
	if($_GET['size']=='profile'){
    	$size =  '160x205';
		$fsize = '31x40';
		$w = 79;
		$h = 18;
	}elseif($_GET['size']=='inventory'){
    	$size =  '330x422';
		$fsize = '64x82';
		$w = 163;
		$h = 37;
	}
} else {
    $size = "330x422";
	$fsize = '64x82';
	$w = 163;
	$h = 37;
}
$herodetail = $database->HeroFace($uid);
if($herodetail['color']==0){
	$color = "black";
}
if($herodetail['color']==1){
	$color = "brown";
}
if($herodetail['color']==2){
	$color = "darkbrown";
}
if($herodetail['color']==3){
	$color = "yellow";
}
if($herodetail['color']==4){
	$color = "red";
}
$geteye = $herodetail['eye'];
$geteyebrow = $herodetail['eyebrow'];
$getnose = $herodetail['nose'];
$getear = $herodetail['ear'];
$getmouth = $herodetail['mouth'];
$getbeard = $herodetail['beard'];
$gethair = $herodetail['hair'];
$getface = $herodetail['face'];

$getfoot = $herodetail['foot'];
$gethelmet = $herodetail['helmet'];
$gethorse = $herodetail['horse'];
$getleftHand = $herodetail['leftHand'];
$getrightHand = $herodetail['rightHand'];

// HERO FACE:
$face0 = imagecreatefrompng('img/hero/head/'.$fsize.'/face0.png');
$face = imagecreatefrompng('img/hero/head/'.$fsize.'/face/face'.$getface.'.png');
$ear = imagecreatefrompng('img/hero/head/'.$fsize.'/ear/ear'.$getear.'.png');
$eye = imagecreatefrompng('img/hero/head/'.$fsize.'/eye/eye'.$geteye.'.png');
$eyebrow = imagecreatefrompng('img/hero/head/'.$fsize.'/eyebrow/eyebrow'.$geteyebrow.'-'.$color.'.png');
if($gethair!=5){
$hair = imagecreatefrompng('img/hero/head/'.$fsize.'/hair/hair'.$gethair.'-'.$color.'.png');
}
$mouth = imagecreatefrompng('img/hero/head/'.$fsize.'/mouth/mouth'.$getmouth.'.png');
$nose = imagecreatefrompng('img/hero/head/'.$fsize.'/nose/nose'.$getnose.'.png');
if($getbeard!=5){
$beard = imagecreatefrompng('img/hero/head/'.$fsize.'/beard/beard'.$getbeard.'-'.$color.'.png');
}


		if($gethelmet>=1 && $gethelmet<=3){
			$helmet = 1;
		}elseif($gethelmet>=4 && $gethelmet<=6){
			$helmet = 2;
		}elseif($gethelmet>=7 && $gethelmet<=9){
			$helmet = 3;
		}elseif($gethelmet>=10 && $gethelmet<=12){
			$helmet = 4;
		}elseif($gethelmet>=13 && $gethelmet<=15){
			$helmet = 5;
		}
		
		if($getfoot>=94 && $getfoot<=96){
			$shoes = 1;
		}elseif($getfoot>=97 && $getfoot<=99){
			$shoes = 2;
		}elseif($getfoot>=100 && $getfoot<=102){
			$shoes = 3;
		}
		
		if($getleftHand==0){
			$leftHand = 'leftHand';
		}elseif($getleftHand>=61 && $getleftHand<=63){
			$leftHand = 'map0';
		}elseif($getleftHand>=64 && $getleftHand<=66){
			$leftHand = 'flag0';
		}elseif($getleftHand>=67 && $getleftHand<=69){
			$leftHand = 'flag1';
		}elseif($getleftHand>=73 && $getleftHand<=75){
			$leftHand = 'sack0';
		}elseif($getleftHand>=76 && $getleftHand<=78){
			$leftHand = 'shield0';
		}elseif($getleftHand>=79 && $getleftHand<=81){
			$leftHand = 'horn0';
		}
		
		if($getrightHand==0){
			$rightHand = 'rightHand';
		}elseif($getrightHand>=16 && $getrightHand<=18){
			$rightHand = 'sword0';
		}elseif($getrightHand>=19 && $getrightHand<=21){
			$rightHand = 'sword1';
		}elseif($getrightHand>=22 && $getrightHand<=24){
			$rightHand = 'sword2';
		}elseif($getrightHand>=25 && $getrightHand<=27){
			$rightHand = 'sword3';
		}elseif($getrightHand>=28 && $getrightHand<=30){
			$rightHand = 'lance0';
		}elseif($getrightHand>=31 && $getrightHand<=33){
			$rightHand = 'spear0';
		}elseif($getrightHand>=34 && $getrightHand<=36){
			$rightHand = 'sword4';
		}elseif($getrightHand>=37 && $getrightHand<=39){
			$rightHand = 'bow0';
		}elseif($getrightHand>=40 && $getrightHand<=42){
			$rightHand = 'staff0';
		}elseif($getrightHand>=43 && $getrightHand<=45){
			$rightHand = 'spear1';
		}elseif($getrightHand>=46 && $getrightHand<=48){
			$rightHand = 'club0';
		}elseif($getrightHand>=49 && $getrightHand<=51){
			$rightHand = 'spear2';
		}elseif($getrightHand>=52 && $getrightHand<=54){
			$rightHand = 'axe0';
		}elseif($getrightHand>=55 && $getrightHand<=57){
			$rightHand = 'hammer0';
		}elseif($getrightHand>=58 && $getrightHand<=60){
			$rightHand = 'sword5';
		}
		
		
// HERO BODY: 
$body = imagecreatefrompng('img/hero/body/'.$size.'/hero_body0.png'); 
$leftHand = imagecreatefrompng('img/hero/body/'.$size.'/'.$leftHand.'.png'); 
$rightHand = imagecreatefrompng('img/hero/body/'.$size.'/'.$rightHand.'.png');

if($gethelmet!=0){
	$helmet = imagecreatefrompng('img/hero/body/'.$size.'/helmet'.$helmet.'.png'); 
}
if($getfoot!=0){
	$shoes = imagecreatefrompng('img/hero/body/'.$size.'/shoes'.$shoes.'.png'); 
}
if($gethorse!=0){
	$horse = imagecreatefrompng('img/hero/body/'.$size.'/horse0.png'); 
}



$database->imagecopymerge_alpha($body, $face0, $w, $h, 0, 0, imagesx($face0), imagesy($face0),100); 
$database->imagecopymerge_alpha($body, $face, $w, $h, 0, 0, imagesx($face), imagesy($face),100); 
$database->imagecopymerge_alpha($body, $ear, $w, $h, 0, 0, imagesx($ear), imagesy($ear),100);
$database->imagecopymerge_alpha($body, $eye, $w, $h, 0, 0, imagesx($eye), imagesy($eye),100);
$database->imagecopymerge_alpha($body, $eyebrow, $w, $h, 0, 0, imagesx($eyebrow), imagesy($eyebrow),100);
if($gethair!=5){
$database->imagecopymerge_alpha($body, $hair, $w, $h, 0, 0, imagesx($hair), imagesy($hair),100);
}
$database->imagecopymerge_alpha($body, $mouth, $w, $h, 0, 0, imagesx($mouth), imagesy($mouth),100);
$database->imagecopymerge_alpha($body, $nose, $w, $h, 0, 0, imagesx($nose), imagesy($nose),100);
if($getbeard!=5){
$database->imagecopymerge_alpha($body, $beard, $w, $h, 0, 0, imagesx($beard), imagesy($beard),100);
}





if($gethorse!=0){
	$database->imagecopymerge_alpha($body, $horse, 0, 0, 0, 0, imagesx($horse), imagesy($horse),100); 
}
if($getfoot!=0){
	$database->imagecopymerge_alpha($body, $shoes, 0, 0, 0, 0, imagesx($shoes), imagesy($shoes),100); 
}
$database->imagecopymerge_alpha($body, $rightHand, 0, 0, 0, 0, imagesx($rightHand), imagesy($rightHand),100); 
$database->imagecopymerge_alpha($body, $leftHand, 0, 0, 0, 0, imagesx($leftHand), imagesy($leftHand),100); 
if($gethelmet!=0){
	$database->imagecopymerge_alpha($body, $helmet, 0, 0, 0, 0, imagesx($helmet), imagesy($helmet),100); 
}


// OUTPUT IMAGE: 
header("Content-Type: image/png"); 
imagesavealpha($body, true); 
imagepng($body, NULL); 
?>
And my "hero_inventory.php" is :
PHP:
<?php
include("GameEngine/Village.php");
include("GameEngine/Inventory.php");
$start = $generator->pageLoadTimeStart();
include "Templates/html.tpl";

if(isset($_GET['inventory'])){
$uid = $session->uid;
if(isset($_GET['helmet'])){
$database->setHeroInventory($uid, "helmet", 0);
$database->editProcItem($_GET['helmet'], 0);
$database->modifyHeroFace($uid, "helmet", 0);

}elseif(isset($_GET['leftHand'])){
$database->setHeroInventory($uid, "leftHand", 0);
$database->editProcItem($_GET['leftHand'], 0);
$database->modifyHeroFace($uid, "leftHand", 0);

}elseif(isset($_GET['rightHand'])){
$itemData = $database->getHeroInventory($uid);
$itemData2 = $database->getItemData($itemData['rightHand']);
if($itemData2['type']==16){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==17){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==18){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==19){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==20){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==21){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==22){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==23){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==24){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==25){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==26){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==27){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==28){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==29){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==30){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==31){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==32){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==33){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==34){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==35){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==36){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==37){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==38){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==39){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==40){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==41){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==42){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==43){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==44){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==45){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==46){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==47){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==48){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==49){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==50){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==51){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==52){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==53){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==54){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==55){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==56){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==57){
$database->modifyHero2("itempower",1500,$uid,2);
}
if($itemData2['type']==58){
$database->modifyHero2("itempower",500,$uid,2);
}
if($itemData2['type']==59){
$database->modifyHero2("itempower",1000,$uid,2);
}
if($itemData2['type']==60){
$database->modifyHero2("itempower",1500,$uid,2);
}
$database->setHeroInventory($uid, "rightHand", 0);
$database->editProcItem($_GET['rightHand'], 0);
$database->modifyHeroFace($uid, "rightHand", 0);

}elseif(isset($_GET['body'])){
$database->setHeroInventory($uid, "body", 0);
$database->editProcItem($_GET['body'], 0);
$database->modifyHeroFace($uid, "body", 0);

}elseif(isset($_GET['horse'])){
$itemData = $database->getHeroInventory($uid);
$itemData2 = $database->getItemData($itemData['horse']);
if($itemData2['type']==103){
$database->modifyHero2("speed",7,$uid,2);
}
if($itemData2['type']==104){
$database->modifyHero2("speed",10,$uid,2);
}
if($itemData2['type']==105){
$database->modifyHero2("speed",13,$uid,2);
}
$database->setHeroInventory($uid, "horse", 0);
$database->editProcItem($_GET['horse'], 0);
$database->modifyHeroFace($uid, "horse", 0);

}elseif(isset($_GET['bag'])){
$database->setHeroInventory($uid, "bag", 0);
$database->editProcItem($_GET['bag'], 0);
$itemdata = $database->getItemData($_GET['bag']);
if($itemdata['btype']==9){
$database->editHeroType($itemdata['id'], 0, 2);
}
}
}
if(isset($_GET['showhero'])){
$database->modifyHero2('hide', 0, $session->uid, 0);
}
if(isset($_GET['hidehero'])){
$database->modifyHero2('hide', 1, $session->uid, 0);
}
?>
<body class="v35 webkit chrome hero_inventory">
<div id="wrapper">
<img id="staticElements" src="img/x.gif" alt="" />
<div id="logoutContainer">
<a id="logout" href="logout.php" title="<?php echo LOGOUT; ?>"> </a>
</div>
<div class="bodyWrapper">
<div id="header">
<div id="mtop">
<a id="logo" href="<?php echo HOMEPAGE; ?>" target="_blank" title="<?php echo SERVER_NAME ?>"></a>
<ul id="navigation">
<li id="n1" class="resources">
<a class="" href="dorf1.php" accesskey="1" title="<?php echo HEADER_DORF1; ?>"></a>
</li>
<li id="n2" class="village">
<a class="" href="dorf2.php" accesskey="2" title="<?php echo HEADER_DORF2; ?>"></a>
</li>
<li id="n3" class="map">
<a class="" href="karte.php" accesskey="3" title="<?php echo HEADER_MAP; ?>"></a>
</li>
<li id="n4" class="stats">
<a class="" href="statistiken.php" accesskey="4" title="<?php echo HEADER_STATS; ?>"></a>
</li>
<?php
     if(count($database->getMessage2($session->uid)) >= 1000) {
$unmsg = "+1000";
} else { $unmsg = count($database->getMessage2($session->uid)); }

     if(count($database->getNotice5($session->uid)) >= 1000) {
$unnotice = "+1000";
} else { $unnotice = count($database->getNotice5($session->uid)); }
?>
<li id="n5" class="reports">
<a href="berichte.php" accesskey="5" title="<?php echo HEADER_NOTICES; ?><?php if($message->nunread){ echo' ('.count($database->getNotice5($session->uid)).')'; } ?>"></a>
<?php
if($message->nunread){
echo "<div class=\"ltr bubble\" title=\"".$unnotice." ".HEADER_NOTICES_NEW."\" style=\"display:block\">
<div class=\"bubble-background-l\"></div>
<div class=\"bubble-background-r\"></div>
<div class=\"bubble-content\">".$unnotice."</div></div>";
}
?>
</li>
<li id="n6" class="messages">
<a href="nachrichten.php" accesskey="6" title="<?php echo HEADER_MESSAGES; ?><?php if($message->unread){ echo' ('.count($database->getMessage2($session->uid)).')'; } ?>"></a>
<?php
if($message->unread) {
echo "<div class=\"ltr bubble\" title=\"".$unmsg." ".HEADER_MESSAGES_NEW."\" style=\"display:block\">
<div class=\"bubble-background-l\"></div>
<div class=\"bubble-background-r\"></div>
<div class=\"bubble-content\">".$unmsg."</div></div>";
}
?>
</li>

</ul>
<div class="clear"></div>
</div>
</div>
<div id="mid">

<div class="clear"></div>
<div id="contentOuterContainer">
<div class="contentTitle"> </div>

<div class="contentContainer">
<div id="content" class="hero_inventory"><h1 class="titleInHeader">Hero</h1>
<div class="contentNavi subNavi">
<div class="container active">
<div class="background-start"> </div>
<div class="background-end"> </div>
<div class="content"><a href="hero_inventory.php"><span class="tabItem">Attributes</span></a></div>
</div>
<div class="container normal">
<div class="background-start"> </div>
<div class="background-end"> </div>
<div class="content"><a href="hero.php"><span class="tabItem">Appearance</span></a></div>
</div>
<div class="container normal">
<div class="background-start"> </div>
<div class="background-end"> </div>
<div class="content"><a href="hero_adventure.php"><span class="tabItem">Adventures</span></a></div>
</div>
<div class="container normal">
<div class="background-start"> </div>
<div class="background-end"> </div>
<div class="content"><a href="hero_auction.php"><span class="tabItem">Auctions</span></a></div>
</div><div class="clear"></div>
</div>
<script type="text/javascript">
window.addEvent('domready', function()
{
$$('.subNavi').each(function(element)
{
new Travian.Game.Menu(element);
});
});
</script>
<div class="clear"></div>
<?php
include("Templates/hero.tpl");
?>

<div id="bodyOptions">
<div id="hero_body_container">
<div id="hero_body">
<img class="heroBody" src="hero_body.php?uid=<?php echo $session->uid; ?>&size=inventory&<?php echo $hero['hash']; ?>">
<div class="clear"></div>
</div>
<div id="hero_body_content">
<div class="content">

<?php
$gi = $database->getHeroInventory($session->uid);
$dis = '';
if($hero['dead']==1){
$dis = ' disabled';
}
if($gi['helmet']!=0){
$data = $database->getItemData($gi['helmet']);
$item = '<a href="?inventory&helmet='.$gi['helmet'].'"><div id="item_'.$gi['helmet'].'" class="item item_'.$data['type'].' onHero'.$dis.'" style="position: relative; left: 0px; top: 0px; "><div class="amount">'.$data['num'].'</div></div></a>';
echo '<div id="helmet" class="draggable">'.$item.'</div>';
}else{
echo '<div id="helmet" class="draggable"></div>';
}

if($gi['leftHand']!=0){
$data = $database->getItemData($gi['leftHand']);
$item = '<a href="?inventory&leftHand='.$gi['leftHand'].'"><div id="item_'.$gi['leftHand'].'" class="item item_'.$data['type'].' onHero'.$dis.'" style="position: relative; left: 0px; top: 0px; "><div class="amount">'.$data['num'].'</div></div></a>';
echo '<div id="leftHand" class="draggable">'.$item.'</div>';
}else{
echo '<div id="leftHand" class="draggable"></div>';
}

if($gi['rightHand']!=0){
$data = $database->getItemData($gi['rightHand']);
$item = '<a href="?inventory&rightHand='.$gi['rightHand'].'"><div id="item_'.$gi['rightHand'].'" class="item item_'.$data['type'].' onHero'.$dis.'" style="position: relative; left: 0px; top: 0px; "><div class="amount">'.$data['num'].'</div></div></a>';
echo '<div id="rightHand" class="draggable">'.$item.'</div>';
}else{
echo '<div id="rightHand" class="draggable"></div>';
}

if($gi['body']!=0){
$data = $database->getItemData($gi['body']);
$item = '<a href="?inventory&body='.$gi['body'].'"><div id="item_'.$gi['body'].'" class="item item_'.$data['type'].' onHero'.$dis.'" style="position: relative; left: 0px; top: 0px; "><div class="amount">'.$data['num'].'</div></div></a>';
echo '<div id="body" class="draggable">'.$item.'</div>';
}else{
echo '<div id="body" class="draggable"></div>';
}

if($gi['horse']!=0){
$data = $database->getItemData($gi['horse']);
$item = '<a href="?inventory&horse='.$gi['horse'].'"><div id="item_'.$gi['horse'].'" class="item item_'.$data['type'].' onHero'.$dis.'" style="position: relative; left: 0px; top: 0px; "><div class="amount">'.$data['num'].'</div></div></a>';
echo '<div id="horse" class="draggable">'.$item.'</div>';
}else{
echo '<div id="horse" class="draggable"></div>';
}

if($gi['bag']!=0){
$data = $database->getItemData($gi['bag']);
if($data['btype'] != 9){
$item = '<a href="?inventory&bag='.$gi['bag'].'"><div id="item_'.$gi['bag'].'" class="item item_'.$data['type'].' onHero" style="position: relative; left: 0px; top: 0px; "><div class="amount">'.$data['num'].'</div></div></a>';
echo '<div id="bag" class="draggable">'.$item.'</div>';
}else{
$data = $database->getItemData($gi['bag']);
$item = '<a href="?inventory&bag='.$gi['bag'].'"><div id="item_'.$gi['bag'].'" class="item item_114 onHero" style="position: relative; left: 0px; top: 0px; "><div class="amount">'.$data['type'].'</div></div></a>';
echo '<div id="bag" class="draggable">'.$item.'</div>';
}
}else{
echo '<div id="bag" class="draggable"></div>';
}
?>
</div>
</div>
</div>
<div class="heroHidden">
<?php
if($hero['hide'] == 1){
?>
<input type="checkbox" class="check" name="hideShow" onClick="window.location.href = '?showhero=<?php echo $hero['heroid'];?>';" checked="checked"> When checked hero will hide when village attacked.
<?php
}else{
?>
<input type="checkbox" class="check" name="hideShow" onClick="window.location.href = '?hidehero=<?php echo $hero['heroid'];?>';"> When checked hero will hide when village attacked.
<?php } ?>
</div>
</div>
<div id="hero_inventory">
<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">
<div id="itemsToSale"><?php
$prefix = "".TB_PREFIX."heroitems";

$sql = mysql_query("SELECT * FROM ".TB_PREFIX."heroitems WHERE (proc = 0 OR (btype = 9 && num - type != 0)) AND uid = $session->uid");
$query = mysql_num_rows($sql);

$outputList = '';

$inv = 1;
while($row = mysql_fetch_array($sql)){
$id = $row["id"];$uid = $row["uid"];$btype = $row["btype"];$type = $row["type"];$num = $row["num"];$proc = $row["proc"];
include "Templates/Auction/alt.tpl";
if($btype<=10 or $btype==11 or $btype==13){
if($hero['dead']==1){
$dis = ' disabled';
$deadTitle = "
<span class='itemNotMoveable'>You cannot use this item when your hero is dead.</span><br>";
}else{
$dis = '';
$deadTitle = '';
}
}else{
$dis = '';
$deadTitle = '';
}
if($btype == 9){
$amount = '('.$num.') ';
$outputList .= "<div id=\"inventory_".$inv."\" class=\"inventory draggable\">";
$outputList .= "<div id=\"item_".$id."\" title=\"".$amount."".$name."||".$deadTitle."".$title."\" class=\"item item_114".$dis."\" style=\"position:relative;left:0px;top:0px;\">";
$outputList .= "<div class=\"amount\">".($num)."</div>";
$outputList .= "</div>";
$outputList .= '</div>';
}else{
if($num==1){$amount = '';}else{$amount = '('.$num.') ';}
$outputList .= "<div id=\"inventory_".$inv."\" class=\"inventory draggable\">";
$outputList .= "<div id=\"item_".$id."\" title=\"".$amount."".$name."||".$deadTitle."".$title."\" class=\"item item_".$item."".$dis."\" style=\"position:relative;left:0px;top:0px;\">";
$outputList .= "<div class=\"amount\">".($num)."</div>";
$outputList .= "</div>";
$outputList .= '</div>';
$inv++;	
}
}
echo $outputList;

if($inv <= 12){
for($i=$inv;$i<=((12+$inv)-$inv);$i++){
echo '<div id="inventory_'.$i.'" class="inventory draggable"></div>';
}
}else{
echo '<div id="inventory_'.$i.'" class="inventory draggable"></div>';
}
?>
<div class="market">
<a class="buy arrow" href="hero_auction.php?action=buy">Buy Items</a>
<a class="sell arrow" href="hero_auction.php?action=sell">Sell Items</a>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<div class="clear"></div>
<div id="placeHolder"></div>
<form id="HeroInventory" method="post" action="hero_inventory.php">
<input type="hidden" name="a" value="inventory">
<input type="hidden" name="id" value="<?php echo $_POST['id']; ?>">
<input type="hidden" name="amount" value="<?php echo $_POST['amount']; ?>">
<input type="hidden" name="btype" value="<?php echo $_POST['btype']; ?>">
<input type="hidden" name="type" value="<?php echo $_POST['type']; ?>">
</form>
<script type="text/javascript">
Travian.Game.Hero.Inventory = new (new Class(
{
b10: '<p><div style="color:#F90">Experience: <?php echo $hero['experience']; ?><br>?????? ?????: 10<br>????? ??? ?? ???????: <?php echo ($hero['experience']+10); ?><br></div>',
b15: '<table id="heroInventoryDataDialog" class="transparent" cellspacing="0" cellpadding="0"><tbody><tr class="rowBeforeUse"><th>Jelenlegi kultúrpont arány</th><td><?php echo $database->getUserField($session->uid, 'cp',0); ?></td></tr><tr class="rowUseValue"><th>?????? ?????? ???? ???? ??? ???? ??? ????:</th><td class="displayUseValue"><?php echo $database->getVSumField($session->uid, 'cp'); ?></td></tr><tr class="rowAfterUse"><th>?????? ?????? ??? ?? ???? ??? ????:</th><td class="displayAfterUse"><?php echo ($database->getUserField($session->uid, 'cp',0)+$database->getVSumField($session->uid, 'cp')); ?></td></tr></tbody></table>',
alreadyOpen: false,
textSingle: 'Do you really want to wear this item?',
textMulti: 'Total item used: <input class=\"text\" id=\"amount\" type=\"text\" value=\"\" />'.unescapeHtml(),
initialize: function() {
var $this = this;
<?php
$sql2 = mysql_query("SELECT * FROM ".TB_PREFIX."heroitems WHERE proc = 0 AND uid = $session->uid");

while($row2 = mysql_fetch_array($sql2)){
$id = $row2["id"];$num = $row2["num"];$btype = $row2["btype"];$type = $row2["type"];
if($btype<=10 or $btype==11 or $btype==13){
if($hero['dead']==0){
if($num==1){
?>
$('item_<?php echo $id; ?>').addEvent('click', function() { $this.showItem(<?php echo $id; ?>,<?php echo $num; ?>,<?php echo $btype; ?>,<?php echo $type; ?>);});
<?php	}else{ ?>
$('item_<?php echo $id; ?>').addEvent('click', function() { $this.sellItem(<?php echo $id; ?>,<?php echo $num; ?>,<?php echo $btype; ?>,<?php echo $type; ?>);});
<?php
}
}
}else{
?>
$('item_<?php echo $id; ?>').addEvent('click', function() { $this.sellItem(<?php echo $id; ?>,<?php echo $num; ?>,<?php echo $btype; ?>,<?php echo $type; ?>);});
<?php
}
}
?>
},
showItem: function (id, amount, btype, type){
var $this = this;
$('HeroInventory').id.value = id;
$('HeroInventory').amount.value = amount;
$('HeroInventory').btype.value = btype;
$('HeroInventory').type.value = type;
$('HeroInventory').submit();
},
sellItem: function (id, amount, btype, type){
var html = '';
var $this = this;
if (this.alreadyOpen){
return;
}
this.alreadyOpen = true;
$('HeroInventory').id.value = id;
$('HeroInventory').amount.value = amount;
$('HeroInventory').btype.value = btype;
$('HeroInventory').type.value = type;
if (amount == 1){
if(btype == 10){
html = $this.textSingle;
html += this.b10;
}else
if(btype == 15){
html = $this.textSingle;
html += this.b15;
}else{
html = $this.textSingle;
}
}else{
if(btype == 10){
exp_a = '<?php echo $hero['experience']; ?>';
exp_b = amount*10;
exp_total = <?php echo $hero['experience']; ?>+exp_b;
html = $this.textMulti;
html += '<table id="heroInventoryDataDialog" class="transparent" cellspacing="0" cellpadding="0"><tbody><tr class="rowBeforeUse"><th>??????? ???? ??????:</th><td>'+exp_a+'</td></tr><tr class="rowUseValue"><th>??????? ???? ???? ?? ???? ???? ?????:</th><td class="displayUseValue">'+exp_b+'</td></tr><tr class="rowAfterUse"><th>??????? ?????? ??? ?? ???? ?????:</th><td class="displayAfterUse">'+exp_total+'</td></tr></tbody></table>';

}else
if(btype == 15){
cp = '<?php echo $database->getUserField($session->uid, 'cp',0); ?>';
cp_b = (cp*amount);
cp_total = <?php echo $database->getUserField($session->uid, 'cp',0); ?>+cp_b;
html = $this.textMulti;
html += '<table id="heroInventoryDataDialog" class="transparent" cellspacing="0" cellpadding="0"><tbody><tr class="rowBeforeUse"><th>?????? ?????? ???? ???:</th><td>'+cp+'</td></tr><tr class="rowUseValue"><th>?????? ?????? ???? ???? ?? ???? ???? ??? ????:</th><td class="displayUseValue">'+cp_b+'</td></tr><tr class="rowAfterUse"><th>?????? ?????? ??? ?? ???? ??? ????:</th><td class="displayAfterUse">'+cp_total+'</td></tr></tbody></table>';
}else{
html = $this.textMulti;
}
}
html.dialog({
relativeTo: $('content'),
elementFoucs: 'inventoryAmount',
buttonTextOk: 'Ok',
buttonTextCancel: 'Cancel',
title: 'consumption',
onOpen: function(dialog, contentElement){
if ($('amount')){
$('amount').value = amount;
$('amount').addEvent('change', function(){
$('HeroInventory').amount.value = $('amount').value;
});
}
},
onOkay: function(dialog, contentElement){
if ($('amount')){
$('HeroInventory').amount.value = $('amount').value;
}
$('HeroInventory').submit();
},
onClose: function(dialog, contentElement){
$this.alreadyOpen = false;
}
});
}
}));
</script>
<div class="clear"> </div>
</div>
<div class="clear"></div>
</div>

<div class="contentFooter"> </div>

</div>
<?php
include("Templates/sideinfo.tpl");
include("Templates/footer.tpl");
include("Templates/header.tpl");
include("Templates/res.tpl");
include("Templates/vname.tpl");
include("Templates/quest.tpl");
?>

</div>
<div id="ce"></div>
</div>
</body>
</html>
 

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
Mar 5, 2012
Messages
29
Reaction score
20
I noticed that on some server code must be different to be functioning
 
Newbie Spellweaver
Joined
Dec 8, 2012
Messages
20
Reaction score
0
okay the code was work perfectly on the Localhost ,,,, But on the server it doesn't
Any Ideas about this problem bro ?

I have The Same Error But with the installations "Multihunter" and with the registrations ,,,,,,

I think It solved for me ,,,, On the Freehost They Will Limited your Database Cells till 5000 maximum ,,,, So the travian will not be able to make more cells for the W_data "40401 Cells"
So you must importing the table "w_data" manually ,,, with " odata "
then continue your Install for multihunter step ,,, and jumping to the 6 step ,,, and open the Game ,,,, If you Have A problem On Automation.php Tell me ,,, I will Tell you how to fix it ,,,, ^_*

this is my Version and i Have Only Problem With The Hero Images ,,,
 
Last edited:
Newbie Spellweaver
Joined
Dec 28, 2011
Messages
36
Reaction score
0
i have noticed that on 1freehosting in all versions of travian map is not working
it just cant move can you help me? is it because of mysql connections limit?
 
Joined
Sep 25, 2011
Messages
710
Reaction score
318
i have noticed that on 1freehosting in all versions of travian map is not working
it just cant move can you help me? is it because of mysql connections limit?

It's because of java script.

Every version is not working well on free host.

Use VPS or dedicated server.

There are cheap VPS servers for just 5eur/month
 
Newbie Spellweaver
Joined
May 15, 2013
Messages
5
Reaction score
0
Hi
Tank u because thise travian
Please update thise travian and fixed bug also "tasks - hero -map and admin panel"

Bug list
1.in hero to send adventures some time lost hero
2. in the auctions when i shop item for exampel 2 cage im paid 200 silver but im buy thise item by 3 silver
3. in the allianc Forum error "froum_2.tpl on line 161
4.in the admin panel sections ww Village Troop Formula
and when creare natar Account ,natar accound hase baned
and admin panel hase Incomplete
please update and fix this bug
very tanx
sorry for bad English
 
Initiate Mage
Joined
Aug 9, 2013
Messages
3
Reaction score
0
when come update?

bug when add WWvillage

Notice: Use of undefined constant SQL_SERVER - assumed 'SQL_SERVER' in /home/r58454/domains/rate2me.eu/public_html/traktorist/GameEngine/config.php on line 2 Notice: Use of undefined constant SQL_USER - assumed 'SQL_USER' in /home/r58454/domains/rate2me.eu/public_html/traktorist/GameEngine/config.php on line 2 Notice: Use of undefined constant SQL_PASS - assumed 'SQL_PASS' in /home/r58454/domains/rate2me.eu/public_html/traktorist/GameEngine/config.php on line 2 Warning: mysql_connect(): Unknown MySQL server host 'SQL_SERVER' (25) in /home/r58454/domains/rate2me.eu/public_html/traktorist/GameEngine/config.php on line 2 Notice: Use of undefined constant SQL_DB - assumed 'SQL_DB' in /home/r58454/domains/rate2me.eu/public_html/traktorist/GameEngine/config.php on line 3 Warning: mysql_select_db(): Access denied for user 'r58454'@'localhost' (using password: NO) in /home/r58454/domains/rate2me.eu/public_html/traktorist/GameEngine/config.php on line 3 Warning: mysql_select_db(): A link to the server could not be established in /home/r58454/domains/rate2me.eu/public_html/traktorist/GameEngine/config.php on line 3 Notice: Use of undefined constant TB_PREFIX - assumed 'TB_PREFIX' in /home/r58454/domains/rate2me.eu/public_html/traktorist/GameEngine/config.php on line 4 Warning: mysql_query(): Access denied for user 'r58454'@'localhost' (using password: NO) in /home/r58454/domains/rate2me.eu/public_html/traktorist/GameEngine/config.php on line 4 Warning: mysql_query(): A link to the server could not be established in /home/r58454/domains/rate2me.eu/public_html/traktorist/GameEngine/config.php on line 4 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/r58454/domains/rate2me.eu/public_html/traktorist/GameEngine/config.php on line 5 Warning: mysql_close(): no MySQL-Link resource supplied in /home/r58454/domains/rate2me.eu/public_html/traktorist/GameEngine/config.php on line 6 Warning: mysql_connect(): Unknown MySQL server host 'SQL_SERVER' (0) in /home/r58454/domains/rate2me.eu/public_html/traktorist/GameEngine/Database/db_MYSQL.php on line 6 Unknown MySQL server host 'SQL_SERVER' (0)
 
Last edited:
Initiate Mage
Joined
Oct 6, 2013
Messages
2
Reaction score
0
Warning: session_start() [ ]: Cannot send session cache limiter - headers already sent (output started at /home/fasttrac/public_html/Travian/dorf1.php:1) in /home/fasttrac/public_html/Travian/GameEngine/Session.php on line 49

why ??
 
Newbie Spellweaver
Joined
Mar 31, 2009
Messages
10
Reaction score
1
when i try to install the T4 version on my domain.

i already got an error at the installation on constant.php 5

and oasis cant install at all.


some one suggest .?

or could some one help me out

regards cliffsmits
 
Newbie Spellweaver
Joined
Mar 20, 2013
Messages
5
Reaction score
0
Warning: include(../../GameEngine/lang/en.php): failed to open stream: No such file or directory in /home/u421091977/public_html/install/include/multihunter.php on line 7 Warning: include(../../GameEngine/lang/en.php): failed to open stream: No such file or directory in /home/u421091977/public_html/install/include/multihunter.php on line 7 Warning: include(): Failed opening '../../GameEngine/lang/en.php' for inclusion (include_path='.:/usr/lib/php') in /home/u421091977/public_html/install/include/multihunter.php on line 7 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/u421091977/public_html/GameEngine/Database/db_MYSQL.php on line 544 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/u421091977/public_html/GameEngine/Database/db_MYSQL.php on line 497 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/u421091977/public_html/GameEngine/Database/db_MYSQL.php on line 544 Duplicate entry '0' for key 'PRIMARY'


why?
 
Skilled Illusionist
Joined
Mar 9, 2011
Messages
391
Reaction score
120
I think on T4 version is a lot of work to fix all version. It`s very very imcomplete :)
 
Newbie Spellweaver
Joined
Mar 5, 2012
Messages
29
Reaction score
20
yes I know more with their version 4.2 is worse
 
Newbie Spellweaver
Joined
Jan 1, 2014
Messages
97
Reaction score
21
First time i noticed sorry i dont wanna insults any member will explain why im writing, but yes first time i noticed bumb code when i was fiixng ww bugs, if ixed all of them but just look at this........

in: Templates/Build/ww.tpl u can find these lines.....

PHP:
if($village->resarray['f99'] < 5){
echo '<center>'.WWNAME.': <input class="text" name="wwname" id="wwname" disabled="disabled" value="'.$wwname.'" maxlength="20"> 
<button type="submit" value="ok" name="s1" id="btn_train" value="ok" class="startTraining" disabled="disabled">
                    <div class="button-container"><div class="button-position"><div class="btl"><div class="btr"><div class="btc"></div></div></div><div class="bml"><div class="bmr"><div class="bmc"></div></div></div><div class="bbl"><div class="bbr"><div class="bbc"></div></div></div></div><div class="button-contents">'.OK.'</div></div>
                    </button>
</center>';
} else if($village->resarray['f99'] >= 5) {
echo '<center><br />'.WWNAME.': <input class="text" name="wwname" id="wwname" value="'.$wwname.'" maxlength="20"> <button type="submit" value="ok" name="s1" id="btn_train" value="ok" class="startTraining">
                    <div class="button-container"><div class="button-position"><div class="btl"><div class="btr"><div class="btc"></div></div></div><div class="bml"><div class="bmr"><div class="bmc"></div></div></div><div class="bbl"><div class="bbr"><div class="bbc"></div></div></div></div><div class="button-contents">'.OK.'</div></div>
                    </button></center>'; 
} ?>


i mean what the hell? ok i will explain maybe i dont understand something but please me explin this things:
first if says that ww level is lower lvl 5 u cant change ww name
second if says that if ww lvl is above or equel 5 u can chancge ww name so we all know that travian doesnt work like that. U can chancge name of wonder from 1 lvl to 10 i think abd if ww lvl above 10 u cant change name.


So my question:

Who wrote this code yi12345????? If not maybe i can get information who wrote this code and all files that person touched, again no offence, but maybe i dont udnerstand something please explain me than..
 
Initiate Mage
Joined
Jul 18, 2014
Messages
1
Reaction score
0
i saw some bugs
1 map
2 hero
3 attacks
.
.
.
i dont remember others now:D
 
Newbie Spellweaver
Joined
Dec 8, 2012
Messages
20
Reaction score
0
everyone ,,,, Please Write the Bugs Of this Version ,,,,, I will Try To fix them ,,,,,
 
Status
Not open for further replies.
Back
Top