This is a discussion on Trafian T4 Beta within the Travian Releases forums, part of the Travian category; Originally Posted by woodcutter Its not all in that i just tested it on wamp and every thing is live ...
[SIGPIC][/SIGPIC]
http://www.facebook.com/TravianPRO
Thanks for this release. But in real T4 servers. When you register you will have a hero already in village. If you want that to happen. add this code to index.php
But first go to Database of your server at %prefix%_users and add to it:PHP Code:$sql = mysql_query("SELECT * FROM s1_users WHERE id = '".$session->uid."'")or die(mysql_error());
while($row = mysql_fetch_array($sql)){
$herocheck = $row["check_hero"];
};
$sql= mysql_query("SELECT * FROM s1_hero WHERE uid = '".$session->uid."'")or die(mysql_error());
while($row = mysql_fetch_array($sql)){
$heroid = $row["id"];
};
if ($herocheck == 0) {
if ($heroid == '') {
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES ('".$session->uid."', '6', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".(time() + ($u2['time'] / SPEED)*3)."', '50')");
mysql_query("UPDATE s1_units SET `hero` = 1 WHERE vref ='".$village->wid."'")or die(mysql_error());
mysql_query("UPDATE s1_users SET `check_hero` = 1 WHERE id ='".$session->uid."'")or die(mysql_error());
}
}
check_hero int 11 default 0
Now it like T4.
This script check if you have created a hero or not. If not it will make a hero for you.
----------
---------
This code doesn't need edit the prefix:
PHP Code:$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."'")or die(mysql_error());
while($row = mysql_fetch_array($sql)){
$herocheck = $row["check_hero"];
};
$sql= mysql_query("SELECT * FROM ".TB_PREFIX."hero WHERE uid = '".$session->uid."'")or die(mysql_error());
while($row = mysql_fetch_array($sql)){
$heroid = $row["id"];
};
if ($herocheck == 0) {
if ($heroid == '') {
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`) VALUES ('".$session->uid."', '6', '".$session->username."', '0', '10', '0', '0', '100', '0', '0', '0', '0', '".(time() + ($u2['time'] / SPEED)*3)."', '50')");
mysql_query("UPDATE ".TB_PREFIX."units SET `hero` = 1 WHERE vref ='".$village->wid."'")or die(mysql_error());
mysql_query("UPDATE ".TB_PREFIX."users SET `check_hero` = 1 WHERE id ='".$session->uid."'")or die(mysql_error());
}
}
Test Ikariam clone: http://izariam.spazze.net
Actually I tried that, all goes well accept for a detail that I for one cannot seem to find:
Dorf1.php / Dorf2.php will have all resource / building fields replaced to the "old spots" these do not move
The whole layout however goes perfect :)
But ye, have the buildings all missplaced and resource fields on other spots then where they should be is rather annoying ^^
Do you perhaps got a solution for this?
It is not in the CSS files
With best of regards, Raven
EDIT: found it already :) Was in the TPL files ^^
Last edited by Ravendk; 19-03-12 at 06:47 AM.
dont have a version english? When go out?
Do people not read the thread before they post?
![]()
odd i have some strange pearl errors after install what version of xampp should use to run those files?
Well, there are more issues...
A lot of the persian language is coded throughout the whole script..
You need to go through almost every single file to edit/translate it.
And another problem is the compact.css and compact1.css.
These 2 files were altered so all the content has been shifted from left to right and vica versa.
This also caused no oases and villages to show on the map... just all of the same images without info.
I hear you think, use the .com css? Well, not gonna work, since in this version they were heavely re-written.
This will take me for one a bit of time to rewrite, which won't be over night lol ^^
![]()
Last edited by Ravendk; 19-03-12 at 04:25 PM. Reason: added pics
Now I have just one question: How to rename the Heroe from U0.
Anyway, I realy like your travian T4, you are awesome!
I have proceed in this way for not rewrite all css
open compact1.css and compact.css
find and replace left whit left1
now replace right whit left
finally replace left1 to right
later this on both css (compact1.css and compact.css)
find and replace rtl whit ltr, download an .com gpack or .net or .it important is LeftToRight
replace the image enjoy
IMPORTANT
You shold fix some think later like map, boxes and popup.
But I'm shure this was faster then rewrite all![]()
dorf2.tpl
<?php
$coords = array(19=>"110,135,132,120,132,121,160,122,179,136,179,151,158,163,128,163,109,149",
"202,93,223,79,223,79,251,80,271,95,271,109,249,121,220,121,200,108",
"290,76,311,61,311,62,339,63,359,77,359,92,337,104,308,104,289,90",
"384,105,406,91,406,91,434,92,453,106,453,121,432,133,402,133,383,120",
"458,147,479,133,479,133,507,134,527,149,527,164,505,175,476,175,457,162",
"71,184,92,170,92,171,120,172,140,186,139,201,118,213,88,213,69,199",
"516,196,538,182,538,182,566,183,585,198,585,212,564,224,534,224,515,211",
"280,113,301,98,301,99,329,100,349,114,348,169,327,181,298,181,278,168",
"97,320,118,306,118,307,146,308,166,322,165,337,144,349,114,349,95,335",
"59,244,80,230,80,230,108,231,128,246,128,260,106,272,77,272,57,259",
"477,249,498,235,498,235,526,236,546,251,545,265,524,277,494,277,475,264",
"181,259,202,245,202,245,230,246,250,261,250,275,228,287,199,287,180,274",
"182,189,203,175,203,175,231,176,251,190,251,205,229,217,200,217,181,204",
"254,308,276,294,276,294,304,295,324,309,323,324,302,336,272,336,253,323",
"505,317,526,303,526,303,554,304,574,319,573,333,552,345,522,345,503,332",
"182,379,204,365,204,365,232,366,251,380,251,395,230,407,200,407,181,394",
"324,370,345,356,345,357,373,358,393,372,392,387,371,398,341,398,322,385",
"433,334,454,320,454,321,482,322,502,336,502,351,480,362,451,362,432,349",
"271,412,292,398,292,399,320,400,340,414,339,429,318,440,289,440,269,427",
"396,396,417,381,417,382,445,383,465,397,464,412,443,424,413,424,394,410",
"398,212,412,250,369,301,394,323,445,286,453,233,427,183",
"71,450,2,374,3,374,-10,243,13,142,120,81,214,34,340,18,500,43,615,130,641,239,643,350,601,425,534,494,358,534,282,532,180,526,77,456,117,378,163,413,242,442,331,454,425,443,499,417,576,344,596,304,598,221,571,157,481,90,385,61,313,56,217,72,135,113,77,165,46,217,44,269,65,326,119,379");
field.tpl
$coorarray = array(1=>"190,88,28","280,89,28","348,101,28","132,127,28","245,140,28","302,147,28","387,145,28","72,178,28","153,179,28","343,179,28","430,179,28","80,239,28","153,229,28","289,265,28","411,234,28","184,319,28","275,324,28","365,301,28");
and take out 1px in all the template for example:
or($i=1;$i<=18;$i++) {
if($village->resarray['f'.$i.'t'] != 0) {
$text = "";
switch($i) {
case 1:
$style = "left:180px;top:80px;";
break;
shold be:
or($i=1;$i<=18;$i++) {
if($village->resarray['f'.$i.'t'] != 0) {
$text = "";
switch($i) {
case 1:
$style = "left:179px;top:79px;";
break;
this to all case..
hope is helpful