Fix + Credits + Start Language Coding

Fix Artefacts + Credits + Start Language Coding
This commit is contained in:
novgorodschi catalin
2026-05-27 12:26:24 +03:00
parent 1b119d2a35
commit 31c475e644
20 changed files with 241 additions and 181 deletions
+30 -19
View File
@@ -276,30 +276,41 @@ if (!empty($_GET['p'])) {
}
break;
case 'village':
if (!empty($_GET['did'])) {
$village = $database->getVillage($_GET['did']);
$user = $database->getUserArray($village['owner'],1);
$subpage = 'Edit Village ('.$village['name'].' » '.$user['username'].')';
} else {
$subpage = 'Edit Village (no village)';
}
break;
case 'village':
if (!empty($_GET['did'])) {
$did = (int)$_GET['did'];
$village = $database->getVillage($did);
if ($village) {
$user = $database->getUserArray($village['owner'], 1);
$subpage = 'Edit Village ('.$village['name'].' » '.($user['username'] ?? '?').')';
} else {
$subpage = 'Edit Village (ID '.$did.' not found)';
$village = null; // important, ca să nu crape template-ul mai jos
}
} else {
$subpage = 'Edit Village (no village)';
}
break;
case 'editResources':
if (!empty($_GET['did'])) {
$village = $database->getVillage($_GET['did']);
$user = $database->getUserArray($village['owner'],1);
$subpage = 'Edit Resources ('.$village['name'].' » '.$user['username'].')';
} else {
$subpage = 'Edit Resources (no village)';
}
break;
case 'editResources':
if (!empty($_GET['did'])) {
$village = $database->getVillage($_GET['did']);
if ($village) {
$user = $database->getUserArray($village['owner'], 1);
$subpage = 'Edit Troops ('.$village['name'].' » '.$user['username'].')';
} else {
$subpage = 'Edit Resources (ID '.$did.' not found)';
$village = null;
}
} else {
$subpage = 'Edit Resources (no village)';
}
break;
case 'addTroops':
if (!empty($_GET['did'])) {
$village = $database->getVillage($_GET['did']);
$user = $database->getUserArray($village['owner'],1);
$user = $database->getUserArray($village['owner'], 1);
$subpage = 'Edit Troops ('.$village['name'].' » '.$user['username'].')';
} else {
$subpage = 'Edit Troops (no village)';
+6 -4
View File
@@ -3021,11 +3021,13 @@ class MYSQLi_DB implements IDbConnection {
$q = "DELETE from " . TB_PREFIX . "forum_post where id = '$id'";
return mysqli_query($this->dblink,$q);
}
function getAllianceName($id, $use_cache = true) {
if (!$id) return '-';
$alliance = $this->getAlliance($id, $use_cache);
return $alliance['tag'] ?? '-';
$alliance = $this->getAlliance($id, $use_cache);
if (!is_array($alliance) || !isset($alliance['tag'])) {
return null;
}
return $alliance['tag'];
}
// no need to cache this method
+22 -11
View File
@@ -1,25 +1,36 @@
<body>
<div id="build" class="gid27">
<a href="#" onclick="return Popup(27,4);" class="build_logo"><img class="building g27" src="img/x.gif" alt="Treasury" title="<?php echo TREASURY; ?>"></a>
<h1><?php echo TREASURY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
<h1><?php echo TREASURY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f'.$id] ?? 0; ?></span></h1>
<p class="build_desc"><?php echo TREASURY_DESC; ?></p>
<?php
$treasuryLevel = $building->getTypeLevel(27) ?? 0;
if($building->getTypeLevel(27) > 0){
if($treasuryLevel > 0){
include("27_menu.tpl");
if(isset($_GET['show']) && !empty($_GET['show']) && $_GET['show'] > 0) include("27_show.tpl");
else
{
if(!isset($_GET['t'])) include("27_1.tpl");
elseif(isset($_GET['t']) && $_GET['t'] == 2) include("27_2.tpl");
elseif(isset($_GET['t']) && $_GET['t'] == 3) include("27_3.tpl");
$show = (int)($_GET['show'] ?? 0);
$t = (int)($_GET['t'] ?? 0);
if($show > 0) {
include("27_show.tpl");
} else {
if($t === 0 || $t === 1) {
include("27_1.tpl");
} elseif($t === 2) {
include("27_2.tpl");
} elseif($t === 3) {
include("27_3.tpl");
} else {
include("27_1.tpl");
}
}
} else {
echo '<b>'.TREASURY_COMMENCE.'</b><br>';
}
else echo '<b>'.TREASURY_COMMENCE.'</b><br>';
include("upgrade.tpl");
?>
</div>
+29 -34
View File
@@ -1,10 +1,8 @@
<?php
include_once("GameEngine/Artifacts.php");
$ownArtifacts = $database->getOwnArtefactsInfo($session->uid);
$wref = $village->wid;
$coor = $database->getCoor($wref);
$ownArtifacts = $database->getOwnArtefactsInfo($session->uid ?? 0);
$wref = $village->wid ?? 0;
?>
<body>
<div class="gid27">
@@ -23,25 +21,25 @@ $coor = $database->getCoor($wref);
<tbody>
<?php
if (empty($ownArtifacts)) echo '<tr><td colspan="4" class="none">'.ANY_ARTEFACTS.'</td></tr>';
else
{
if (empty($ownArtifacts)) {
echo '<tr><td colspan="4" class="none">'.ANY_ARTEFACTS.'</td></tr>';
} else {
foreach($ownArtifacts as $ownArtifact){
$coor2 = $database->getCoor($ownArtifact['vref']);
$ownArtifactInfo = Artifacts::getArtifactInfo($ownArtifact);
$conquered = !empty($ownArtifact['conquered']) ? date("d.m.Y H:i", $ownArtifact['conquered']) : '-';
$villageName = $database->getVillageField($ownArtifact['vref'], "name") ?? '-';
echo '<tr><td class="icon"><img class="artefact_icon_' . $ownArtifact['type'] . '" src="img/x.gif"></td>';
echo '<td class="nam">
<a href="build.php?id='.$id . '&show='.$ownArtifact['id'].'">' . $ownArtifact['name'] . '</a> <span class="bon">' . $ownArtifact['effect'] . '</span>
<div class="info">
Treasury <b>'.$ownArtifactInfo['requiredLevel'].'</b>, Effect <b>'.$ownArtifactInfo['effectInfluence'].'</b>
Treasury <b>'.($ownArtifactInfo['requiredLevel'] ?? 0).'</b>, Effect <b>'.($ownArtifactInfo['effectInfluence'] ?? '').'</b>
</div>
</td>';
echo '<td class="pla"><a href="karte.php?d=' . $ownArtifact['vref'] . '&c=' . $generator->getMapCheck($ownArtifact['vref']) . '">' . $database->getVillageField($ownArtifact['vref'], "name") . '</a></td>';
echo '<td class="dist">'.date("d.m.Y H:i", $ownArtifact['conquered']) . '</td></tr>';
echo '<td class="pla"><a href="karte.php?d=' . $ownArtifact['vref'] . '&c=' . $generator->getMapCheck($ownArtifact['vref']) . '">' . $villageName . '</a></td>';
echo '<td class="dist">'.$conquered.'</td></tr>';
}
}
?>
</tbody>
</table>
@@ -51,14 +49,10 @@ else
<tr>
<th colspan="4"><?php echo ARTEFACTS_AREA; ?></th>
</tr>
<tr>
<td></td>
<td><?php echo NAME; ?></td>
<td><?php echo PLAYER; ?></td>
<td><?php echo DISTANCE; ?></td>
</tr>
</thead>
@@ -66,37 +60,38 @@ else
<tbody>
<?php
$artifacts = $database->getArtifactsBysize([1, 2, 3]);
if(count($artifacts) == 0) echo '<td colspan="4" class="none">'.NO_ARTEFACTS_AREA.'</td>';
else
{
if(count($artifacts) == 0) {
echo '<tr><td colspan="4" class="none">'.NO_ARTEFACTS_AREA.'</td></tr>';
} else {
$rows = [];
foreach($artifacts as $artifact){
$coordinates = $database->getCoor($artifact['vref']);
$distance = $database->getDistance($village->coor['x'], $village->coor['y'], $coordinates['x'], $coordinates['y']);
$rows[(string)$distance] = $artifact;
// cheia unică previne suprascrierea când 2 artefacte sunt la aceeași distanță
$rows[$distance.'_'.$artifact['id']] = ['dist' => $distance, 'data' => $artifact];
}
ksort($rows);
foreach($rows as $distance => $row) {
foreach($rows as $row) {
$distance = $row['dist'];
$artifact = $row['data'];
$artifactInfo = Artifacts::getArtifactInfo($artifact);
$ownerName = $database->getUserField($artifact['owner'], "username", 0) ?? 'Natars';
echo '<tr>
<td class="icon"><img class="artefact_icon_'.$row['type'].'" src="img/x.gif" alt="" title=""></td>
<td class="icon"><img class="artefact_icon_'.$artifact['type'].'" src="img/x.gif" alt="" title=""></td>
<td class="nam">
<a href="build.php?id='.$id.'&show='.$row['id'].'">'.$row['name'].'</a> <span class="bon">'.$row['effect'].'</span>
<div class="info">';
$artifactInfo = Artifacts::getArtifactInfo($row);
echo '<div class="info">'.TREASURY.' <b>'.$artifactInfo['requiredLevel'] . '</b>, '.EFFECT.' <b>'.$artifactInfo['effectInfluence'].'</b>
</div></td><td class="pla">
<a href="karte.php?d='.$row['vref'].'&c='.$generator->getMapCheck($row['vref']).'">'.$database->getUserField($row['owner'], "username", 0).'</a>
</td>
<a href="build.php?id='.$id.'&show='.$artifact['id'].'">'.$artifact['name'].'</a> <span class="bon">'.$artifact['effect'].'</span>
<div class="info">'.TREASURY.' <b>'.($artifactInfo['requiredLevel'] ?? 0).'</b>, '.EFFECT.' <b>'.($artifactInfo['effectInfluence'] ?? '').'</b></div>
</td>
<td class="pla">
<a href="karte.php?d='.$artifact['vref'].'&c='.$generator->getMapCheck($artifact['vref']).'">'.$ownerName.'</a>
</td>
<td class="dist">'.$distance.'</td>
</tr>';
}
}
?>
</tbody>
</table>
+14 -23
View File
@@ -2,19 +2,11 @@
<div id="build" class="gid27">
<a href="#" onclick="return Popup(27,4);" class="build_logo"><img class="building g27" src="img/x.gif" alt="Treasury" title="<?php echo TREASURY; ?>"></a>
<h1><?php echo TREASURY; ?> <span class="level"><?php echo LEVEL; ?> <?php
echo $village->resarray['f' . $id];
?></span></h1>
<h1><?php echo TREASURY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f' . $id] ?? 0; ?></span></h1>
<p class="build_desc"><?php echo TREASURY_DESC; ?></p>
<?php
include ("27_menu.tpl");
?>
<?php include("27_menu.tpl"); ?>
<table id="show_artefacts" cellpadding="1" cellspacing="1">
<thead>
@@ -30,10 +22,9 @@
</thead>
<tbody>
<?php
$artifactsArray = $database->getArtifactsBysize(1);
if(count($artifactsArray) == 0) {
echo '<td colspan="4" class="none">'.NO_ARTEFACTS.'</td>';
echo '<tr><td colspan="4" class="none">'.NO_ARTEFACTS.'</td></tr>';
} else {
$previous = "";
foreach($artifactsArray as $artifact){
@@ -41,24 +32,24 @@
if($previous != "" && $previous != $artifact['type']) echo '<tr><td colspan="4"></td></tr>';
$previous = $artifact['type'];
$ownerId = $artifact['owner'];
$aid = $database->getUserField($ownerId, "alliance", 0);
$ownerName = $database->getUserField($ownerId, "username", 0);
$allianceName = $aid ? $database->getAllianceName($aid) : '';
echo '<tr>
<td class="icon"><img class="artefact_icon_'.$artifact['type'].'" src="img/x.gif" alt="" title=""></td>
<td class="nam">
<a href="build.php?id='.$id.'&show='.$artifact['id'].'">'.$artifact['name'] . '</a> <span class="bon">'.$artifact['effect'].'</span><div class="info">'.TREASURY.' <b>10</b>, '.EFFECT.' <b>'.ACCOUNT.'</b></div>
<a href="build.php?id='.$id.'&show='.$artifact['id'].'">'.$artifact['name'] . '</a> <span class="bon">'.$artifact['effect'].'</span><div class="info">'.TREASURY.' <b>10</b>, '.EFFECT.' <b>'.VILLAGE.'</b></div>
</td>
<td class="pla"><a href="karte.php?d='.$artifact['vref'].'&c='.$generator->getMapCheck($artifact['vref']).'">'.$database->getUserField($artifact['owner'], "username", 0).'</a></td>
<td class="al"><a href="allianz.php?aid='.$database->getUserField($artifact['owner'], "alliance", 0).'">'.$database->getAllianceName($database->getUserField($artifact['owner'], "alliance", 0)).'</a></td>
<td class="pla"><a href="karte.php?d='.$artifact['vref'].'&c='.$generator->getMapCheck($artifact['vref']).'">'.$ownerName.'</a></td>
<td class="al">'.($aid ? '<a href="allianz.php?aid='.$aid.'">'.$allianceName.'</a>' : '-').'</td>
</tr>';
}
}
?>
?>
</tbody></table>
<?php
include ("upgrade.tpl");
?>
<?php include("upgrade.tpl"); ?>
</div>
</div>
+13 -21
View File
@@ -2,19 +2,11 @@
<div id="build" class="gid27">
<a href="#" onclick="return Popup(27,4);" class="build_logo"><img class="building g27" src="img/x.gif" alt="Treasury" title="<?php echo TREASURY; ?>"></a>
<h1><?php echo TREASURY; ?> <span class="level"><?php echo LEVEL; ?> <?php
echo $Account->resarray['f' . $id];
?></span></h1>
<h1><?php echo TREASURY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f' . $id] ?? 0; ?></span></h1>
<p class="build_desc"><?php echo TREASURY_DESC; ?></p>
<?php
include ("27_menu.tpl");
?>
<?php include("27_menu.tpl"); ?>
<table id="show_artefacts" cellpadding="1" cellspacing="1">
<thead>
@@ -30,10 +22,9 @@
</thead>
<tbody>
<?php
$artifactsArray = $database->getArtifactsBysize([2, 3]);
if(count($artifactsArray) == 0) {
echo '<td colspan="4" class="none">'.NO_ARTEFACTS.'</td>';
echo '<tr><td colspan="4" class="none">'.NO_ARTEFACTS.'</td></tr>';
} else {
$previous = "";
foreach($artifactsArray as $artifact){
@@ -41,23 +32,24 @@
if($previous != "" && $previous != $artifact['type']) echo '<tr><td colspan="4"></td></tr>';
$previous = $artifact['type'];
$ownerId = $artifact['owner'];
$aid = $database->getUserField($ownerId, "alliance", 0);
$ownerName = $database->getUserField($ownerId, "username", 0);
$allianceName = $aid ? $database->getAllianceName($aid) : '';
echo '<tr>
<td class="icon"><img class="artefact_icon_'.$artifact['type'].'" src="img/x.gif" alt="" title=""></td>
<td class="nam">
<a href="build.php?id='.$id.'&show='.$artifact['id'].'">'.$artifact['name'] . '</a> <span class="bon">'.$artifact['effect'].'</span><div class="info">'.TREASURY.' <b>20</b>, '.EFFECT.' <b>'.ACCOUNT.'</b></div>
</td>
<td class="pla"><a href="karte.php?d='.$artifact['vref'].'&c='.$generator->getMapCheck($artifact['vref']).'">'.$database->getUserField($artifact['owner'], "username", 0).'</a></td>
<td class="al"><a href="allianz.php?aid='.$database->getUserField($artifact['owner'], "alliance", 0).'">'.$database->getAllianceName($database->getUserField($artifact['owner'], "alliance", 0)).'</a></td>
<td class="pla"><a href="karte.php?d='.$artifact['vref'].'&c='.$generator->getMapCheck($artifact['vref']).'">'.$ownerName.'</a></td>
<td class="al">'.($aid ? '<a href="allianz.php?aid='.$aid.'">'.$allianceName.'</a>' : '-').'</td>
</tr>';
}
}
?>
?>
</tbody></table>
<?php
include ("upgrade.tpl");
?>
<?php include("upgrade.tpl"); ?>
</div>
</div>
+3 -21
View File
@@ -1,25 +1,7 @@
<div id="textmenu">
<a href="build.php?id=<?php echo $id; ?>" <?php
if(!isset($_GET['t']) && $_GET['id'] == $id) {
echo "class=\"selected\"";
}
?>
"><?php echo OWN_ARTEFACTS; ?></a>
<a href="build.php?id=<?php echo $id ?? 0; ?>"<?php if(($_GET['t'] ?? 0) == 0 || ($_GET['t'] ?? 0) == 1) echo ' class="selected"'; ?>><?php echo OWN_ARTEFACTS; ?></a>
| <a href="build.php?id=<?php echo $id; ?>&t=2" <?php
| <a href="build.php?id=<?php echo $id ?? 0; ?>&t=2"<?php if(($_GET['t'] ?? 0) == 2) echo ' class="selected"'; ?>><?php echo SMALL_ARTEFACTS; ?></a>
if(isset($_GET['t']) && $_GET['t'] == 2) {
echo "class=\"selected\"";
}
?>"><?php echo SMALL_ARTEFACTS; ?></a>
| <a href="build.php?id=<?php echo $id; ?>&t=3" <?php
if(isset($_GET['t']) && $_GET['t'] == 3) {
echo "class=\"selected\"";
}
?>"><?php echo LARGE_ARTEFACTS; ?></a>
| <a href="build.php?id=<?php echo $id ?? 0; ?>&t=3"<?php if(($_GET['t'] ?? 0) == 3) echo ' class="selected"'; ?>><?php echo LARGE_ARTEFACTS; ?></a>
</div>
+45 -34
View File
@@ -1,37 +1,39 @@
<?php
include_once("GameEngine/Artifacts.php");
$artifact = $database->getArtefactDetails($_GET['show']);
$showId = (int)($_GET['show'] ?? 0);
$artifact = $database->getArtefactDetails($showId);
if(empty($artifact)){
header("location: build.php?gid=27");
header("location: build.php?id=" . ($id ?? 0));
exit;
}
$artifactInfo = Artifacts::getArtifactInfo($artifact);
$imgClass = str_replace(['type', '.gif'], '', $artifact['img'] ?? '');
?>
<div class="artefact image-<?php echo str_replace(['type', '.gif'], '', $artifact['img']); ?>">
<div class="artefact image-<?php echo $imgClass; ?>">
<table id="art_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="2"><?php echo $artifact['name'];?></th>
<th colspan="2"><?php echo $artifact['name'] ?? '-';?></th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" class="desc">
<span class="detail"><?php echo $artifact['desc'];?></span>
<span class="detail"><?php echo $artifact['desc'] ?? '';?></span>
</td>
</tr>
<tr>
<th><?php echo OWNER; ?></th>
<td>
<?php if(($artifactOwnerUsername = $database->getUserField($artifact['owner'], "username", 0)) != "[?]"){?>
<?php
$artifactOwnerUsername = $database->getUserField($artifact['owner'] ?? 0, "username", 0) ?? "[?]";
if($artifactOwnerUsername != "[?]" && !empty($artifact['owner'])){ ?>
<a href="spieler.php?uid=<?php echo $artifact['owner'];?>"><?php echo $artifactOwnerUsername; ?></a>
<?php }else{?>
<?php } else { ?>
<font color="grey"><span>[?]</span></font>
<?php } ?>
</td>
@@ -39,9 +41,11 @@ $artifactInfo = Artifacts::getArtifactInfo($artifact);
<tr>
<th><?php echo VILLAGE; ?></th>
<td>
<?php if($database->checkVilExist($artifact['vref'])){?>
<a href="karte.php?d=<?php echo $artifact['vref'];?>&c=<?php echo $generator->getMapCheck($artifact['vref']);?>"><?php echo $database->getVillageField($artifact['vref'], "name");?> </a>
<?php }else{?>
<?php if(!empty($artifact['vref']) && $database->checkVilExist($artifact['vref'])){
$villageName = $database->getVillageField($artifact['vref'], "name") ?? '[?]';
?>
<a href="karte.php?d=<?php echo $artifact['vref'];?>&c=<?php echo $generator->getMapCheck($artifact['vref']);?>"><?php echo $villageName;?> </a>
<?php } else { ?>
<font color="grey"><span>[?]</span></font>
<?php }?>
</td>
@@ -49,42 +53,46 @@ $artifactInfo = Artifacts::getArtifactInfo($artifact);
<tr>
<th><?php echo ALLIANCE; ?></th>
<td>
<?php if(($alliance = $database->getUserField($artifact['owner'], "alliance", 0)) > 0){ ?>
<a href="allianz.php?aid=<?php echo $alliance;?>"><?php echo $database->getAllianceName($alliance); ?></a>
<?php }else{?>
<?php
$alliance = (int)($database->getUserField($artifact['owner'] ?? 0, "alliance", 0) ?? 0);
if($alliance > 0){
$allianceName = $database->getAllianceName($alliance) ?? '-';
?>
<a href="allianz.php?aid=<?php echo $alliance;?>"><?php echo $allianceName; ?></a>
<?php } else { ?>
<span>-</span>
<?php }?>
</td>
</tr>
<tr>
<th><?php echo AREA_EFFECT; ?></th>
<td><?php echo $artifactInfo['effectInfluence']; ?></td>
<td><?php echo $artifactInfo['effectInfluence'] ?? '-'; ?></td>
</tr>
<tr>
<th><?php echo BONUS; ?></th>
<td><?php echo $artifactInfo['bonus']; ?></td>
<td><?php echo $artifactInfo['bonus'] ?? '-'; ?></td>
</tr>
<tr>
<th><?php echo REQUIRED_LEVEL; ?></th>
<td><?php echo TREASURY; ?> <?php echo LEVEL; ?> <b><?php echo $artifactInfo['requiredLevel']; ?></b></td>
<td><?php echo TREASURY; ?> <?php echo LEVEL; ?> <b><?php echo $artifactInfo['requiredLevel'] ?? 0; ?></b></td>
</tr>
<tr>
<th><?php echo TIME_CONQUER; ?></th>
<td><?php echo ($artifact['owner'] != 3) ? date("d.m.Y H:i:s", $artifact['conquered']) : "-";?></td>
<td><?php echo (!empty($artifact['owner']) && $artifact['owner'] != 3 && !empty($artifact['conquered'])) ? date("d.m.Y H:i:s", $artifact['conquered']) : "-";?></td>
</tr>
<tr>
<th><?php echo TIME_ACTIVATION; ?></th>
<td><?php echo $artifactInfo['active'];?></td>
<td><?php echo $artifactInfo['active'] ?? '-';?></td>
</tr>
<?php if($artifact['type'] == 8){?>
<?php if(($artifact['type'] ?? 0) == 8){?>
<tr>
<th><?php echo NEXT_EFFECT; ?></th>
<td><?php echo $artifactInfo['nextEffect'];?></td>
<td><?php echo $artifactInfo['nextEffect'] ?? '-';?></td>
</tr>
<?php }?>
@@ -102,30 +110,33 @@ $artifactInfo = Artifacts::getArtifactInfo($artifact);
</thead>
<tbody>
<?php
$owners = $database->getArtifactsChronology($_GET['show']);
$owners = $database->getArtifactsChronology($showId);
if(!empty($owners)){
foreach($owners as $owner){
foreach($owners as $owner){
$chronoUsername = $database->getUserField($owner['uid'] ?? 0, "username", 0) ?? "[?]";
$chronoVillage = (!empty($owner['vref']) && $database->checkVilExist($owner['vref'])) ? ($database->getVillageField($owner['vref'], "name") ?? '[?]') : '[?]';
$chronoTime = !empty($owner['conqueredtime']) ? date("d.m.Y H:i:s", $owner['conqueredtime']) : '-';
?>
<tr>
<td>
<?php if(($artifactChronoOwnerUsername = $database->getUserField($owner['uid'], "username", 0)) != "[?]"){?>
<span class="none"><a href="spieler.php?uid=<?php echo $owner['uid'];?>"><?php echo $artifactChronoOwnerUsername;?></a></span>
<?php }else{?>
<?php if($chronoUsername != "[?]"){?>
<span class="none"><a href="spieler.php?uid=<?php echo $owner['uid'];?>"><?php echo $chronoUsername;?></a></span>
<?php } else { ?>
<span class="none">[?]</span>
<?php }?>
</td>
<td>
<?php if($database->checkVilExist($owner['vref'])){?>
<span class="none"><a href="karte.php?d=<?php echo $owner['vref'];?>&c=<?php echo $generator->getMapCheck($owner['vref']);?>"><?php echo $database->getVillageField($owner['vref'], "name");?></a></span>
<?php }else{?>
<?php if($chronoVillage != '[?]'){?>
<span class="none"><a href="karte.php?d=<?php echo $owner['vref'];?>&c=<?php echo $generator->getMapCheck($owner['vref']);?>"><?php echo $chronoVillage;?></a></span>
<?php } else { ?>
<span class="none">[?]</span>
<?php }?>
</td>
<td><span class="none"><?php echo date("d.m.Y H:i:s", $owner['conqueredtime']);?></span></td>
<td><span class="none"><?php echo $chronoTime;?></span></td>
</tr>
<?php
}
}else{
}
} else {
?>
<tr>
<td colspan="3"><span class="none"><?php echo NO_PREVIOUS_OWNERS; ?></span></td>
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ##
## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ##
## ##
#################################################################################
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ##
## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ##
## ##
#################################################################################
+1 -1
View File
@@ -11,7 +11,7 @@
## Fixed by: Shadow / Skype : cata7007 ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ##
## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ-by-Shadow/ ##
## ##
#################################################################################
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ##
## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ##
## ##
#################################################################################
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ##
## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ##
## ##
#################################################################################
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ##
## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ##
## ##
#################################################################################
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ##
## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ##
## ##
#################################################################################
+68 -4
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ##
## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ##
## ##
#################################################################################
@@ -176,7 +176,7 @@ while ($data = mysqli_fetch_assoc($query)) {
// =========================
// USER SETTINGS SAVE
// =========================
if (isset($_POST['v1']) || isset($_POST['v2']) || isset($_POST['timezone'])) {
if (isset($_POST['v1']) || isset($_POST['v2']) || isset($_POST['timezone']) || isset($_POST['lang'])) {
$v1 = isset($_POST['v1']) ? 1 : 0;
$v2 = isset($_POST['v2']) ? 1 : 0;
@@ -189,6 +189,24 @@ if (isset($_POST['v1']) || isset($_POST['v2']) || isset($_POST['timezone'])) {
$timezone = isset($_POST['timezone']) ? (int)$_POST['timezone'] : 1;
$tformat = isset($_POST['tformat']) ? (int)$_POST['tformat'] : 0;
// =========================
// LANGUAGE
// =========================
$lang = LANG;
if(isset($_POST['lang']))
{
$allowedLangs = ['en','ro','de','fr','es','it','ru','tr'];
$selectedLang = strtolower(trim($_POST['lang']));
if(in_array($selectedLang, $allowedLangs))
{
$lang = $selectedLang;
}
}
// update user preferences
$database->query("
UPDATE " . TB_PREFIX . "users SET
@@ -200,10 +218,14 @@ if (isset($_POST['v1']) || isset($_POST['v2']) || isset($_POST['timezone'])) {
v5=$v5,
v6=$v6,
timezone=$timezone,
tformat=$tformat
tformat=$tformat,
lang='$lang'
WHERE id=" . (int)$session->uid . "
");
// schimbare instant în sesiune
$_SESSION['lang'] = $lang;
header("Location: spieler.php?s=2");
exit;
}
@@ -467,7 +489,49 @@ if (isset($_POST['v1']) || isset($_POST['v2']) || isset($_POST['timezone'])) {
</tbody>
</table>
<!-- =========================
LANGUAGE SETTINGS
========================= -->
<table cellpadding="1" cellspacing="1" id="language" class="set">
<thead>
<tr>
<th colspan="2">Language settings</th>
</tr>
</thead>
<tbody>
<tr>
<th>Game language</th>
<td>
<select name="lang" class="dropdown">
<option value="en" <?php if($session->userinfo['lang']=="en") echo 'selected'; ?>>
English
</option>
<option value="ro" <?php if($session->userinfo['lang']=="ro") echo 'selected'; ?>>
Romanian
</option>
<option value="de" <?php if($session->userinfo['lang']=="de") echo 'selected'; ?>>
German
</option>
<option value="fr" <?php if($session->userinfo['lang']=="fr") echo 'selected'; ?>>
French
</option>
<option value="es" <?php if($session->userinfo['lang']=="es") echo 'selected'; ?>>
Spanish
</option>
<option value="it" <?php if($session->userinfo['lang']=="it") echo 'selected'; ?>>
Italian
</option>
<option value="ru" <?php if($session->userinfo['lang']=="ru") echo 'selected'; ?>>
Russian
</option>
<option value="tr" <?php if($session->userinfo['lang']=="tr") echo 'selected'; ?>>
Turkish
</option>
</select>
</td>
</tr>
</tbody>
</table>
<!-- =========================
SAVE BUTTON
========================= -->
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ##
## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ##
## ##
#################################################################################
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ##
## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ##
## ##
#################################################################################
+1 -1
View File
@@ -10,7 +10,7 @@
## Refactored by Shadow ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ##
## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ##
## ##
#################################################################################
+1
View File
@@ -1533,6 +1533,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%users` (
`username` varchar(100) DEFAULT NULL,
`password` varchar(100) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`lang` varchar(5) NOT NULL DEFAULT 'en',
`tribe` tinyint(1) DEFAULT NULL,
`access` tinyint(1) DEFAULT '1',
`gold` int(9) DEFAULT '0',