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; break;
case 'village': case 'village':
if (!empty($_GET['did'])) { if (!empty($_GET['did'])) {
$village = $database->getVillage($_GET['did']); $did = (int)$_GET['did'];
$user = $database->getUserArray($village['owner'],1); $village = $database->getVillage($did);
$subpage = 'Edit Village ('.$village['name'].' » '.$user['username'].')'; if ($village) {
} else { $user = $database->getUserArray($village['owner'], 1);
$subpage = 'Edit Village (no village)'; $subpage = 'Edit Village ('.$village['name'].' » '.($user['username'] ?? '?').')';
} } else {
break; $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': case 'editResources':
if (!empty($_GET['did'])) { if (!empty($_GET['did'])) {
$village = $database->getVillage($_GET['did']); $village = $database->getVillage($_GET['did']);
$user = $database->getUserArray($village['owner'],1); if ($village) {
$subpage = 'Edit Resources ('.$village['name'].' » '.$user['username'].')'; $user = $database->getUserArray($village['owner'], 1);
} else { $subpage = 'Edit Troops ('.$village['name'].' » '.$user['username'].')';
$subpage = 'Edit Resources (no village)'; } else {
} $subpage = 'Edit Resources (ID '.$did.' not found)';
break; $village = null;
}
} else {
$subpage = 'Edit Resources (no village)';
}
break;
case 'addTroops': case 'addTroops':
if (!empty($_GET['did'])) { if (!empty($_GET['did'])) {
$village = $database->getVillage($_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'].')'; $subpage = 'Edit Troops ('.$village['name'].' » '.$user['username'].')';
} else { } else {
$subpage = 'Edit Troops (no village)'; $subpage = 'Edit Troops (no village)';
+5 -3
View File
@@ -3023,9 +3023,11 @@ class MYSQLi_DB implements IDbConnection {
} }
function getAllianceName($id, $use_cache = true) { function getAllianceName($id, $use_cache = true) {
if (!$id) return '-'; $alliance = $this->getAlliance($id, $use_cache);
$alliance = $this->getAlliance($id, $use_cache); if (!is_array($alliance) || !isset($alliance['tag'])) {
return $alliance['tag'] ?? '-'; return null;
}
return $alliance['tag'];
} }
// no need to cache this method // no need to cache this method
+22 -11
View File
@@ -1,25 +1,36 @@
<body> <body>
<div id="build" class="gid27"> <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> <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> <p class="build_desc"><?php echo TREASURY_DESC; ?></p>
<?php <?php
$treasuryLevel = $building->getTypeLevel(27) ?? 0;
if($building->getTypeLevel(27) > 0){ if($treasuryLevel > 0){
include("27_menu.tpl"); include("27_menu.tpl");
if(isset($_GET['show']) && !empty($_GET['show']) && $_GET['show'] > 0) include("27_show.tpl");
else $show = (int)($_GET['show'] ?? 0);
{ $t = (int)($_GET['t'] ?? 0);
if(!isset($_GET['t'])) include("27_1.tpl");
elseif(isset($_GET['t']) && $_GET['t'] == 2) include("27_2.tpl"); if($show > 0) {
elseif(isset($_GET['t']) && $_GET['t'] == 3) include("27_3.tpl"); 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"); include("upgrade.tpl");
?> ?>
</div> </div>
+29 -34
View File
@@ -1,10 +1,8 @@
<?php <?php
include_once("GameEngine/Artifacts.php"); include_once("GameEngine/Artifacts.php");
$ownArtifacts = $database->getOwnArtefactsInfo($session->uid); $ownArtifacts = $database->getOwnArtefactsInfo($session->uid ?? 0);
$wref = $village->wid; $wref = $village->wid ?? 0;
$coor = $database->getCoor($wref);
?> ?>
<body> <body>
<div class="gid27"> <div class="gid27">
@@ -23,25 +21,25 @@ $coor = $database->getCoor($wref);
<tbody> <tbody>
<?php <?php
if (empty($ownArtifacts)) {
if (empty($ownArtifacts)) echo '<tr><td colspan="4" class="none">'.ANY_ARTEFACTS.'</td></tr>'; echo '<tr><td colspan="4" class="none">'.ANY_ARTEFACTS.'</td></tr>';
else } else {
{
foreach($ownArtifacts as $ownArtifact){ foreach($ownArtifacts as $ownArtifact){
$coor2 = $database->getCoor($ownArtifact['vref']);
$ownArtifactInfo = Artifacts::getArtifactInfo($ownArtifact); $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 '<tr><td class="icon"><img class="artefact_icon_' . $ownArtifact['type'] . '" src="img/x.gif"></td>';
echo '<td class="nam"> echo '<td class="nam">
<a href="build.php?id='.$id . '&show='.$ownArtifact['id'].'">' . $ownArtifact['name'] . '</a> <span class="bon">' . $ownArtifact['effect'] . '</span> <a href="build.php?id='.$id . '&show='.$ownArtifact['id'].'">' . $ownArtifact['name'] . '</a> <span class="bon">' . $ownArtifact['effect'] . '</span>
<div class="info"> <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> </div>
</td>'; </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="pla"><a href="karte.php?d=' . $ownArtifact['vref'] . '&c=' . $generator->getMapCheck($ownArtifact['vref']) . '">' . $villageName . '</a></td>';
echo '<td class="dist">'.date("d.m.Y H:i", $ownArtifact['conquered']) . '</td></tr>'; echo '<td class="dist">'.$conquered.'</td></tr>';
} }
} }
?> ?>
</tbody> </tbody>
</table> </table>
@@ -51,14 +49,10 @@ else
<tr> <tr>
<th colspan="4"><?php echo ARTEFACTS_AREA; ?></th> <th colspan="4"><?php echo ARTEFACTS_AREA; ?></th>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td><?php echo NAME; ?></td> <td><?php echo NAME; ?></td>
<td><?php echo PLAYER; ?></td> <td><?php echo PLAYER; ?></td>
<td><?php echo DISTANCE; ?></td> <td><?php echo DISTANCE; ?></td>
</tr> </tr>
</thead> </thead>
@@ -66,37 +60,38 @@ else
<tbody> <tbody>
<?php <?php
$artifacts = $database->getArtifactsBysize([1, 2, 3]); $artifacts = $database->getArtifactsBysize([1, 2, 3]);
if(count($artifacts) == 0) echo '<td colspan="4" class="none">'.NO_ARTEFACTS_AREA.'</td>'; if(count($artifacts) == 0) {
else echo '<tr><td colspan="4" class="none">'.NO_ARTEFACTS_AREA.'</td></tr>';
{ } else {
$rows = []; $rows = [];
foreach($artifacts as $artifact){ foreach($artifacts as $artifact){
$coordinates = $database->getCoor($artifact['vref']); $coordinates = $database->getCoor($artifact['vref']);
$distance = $database->getDistance($village->coor['x'], $village->coor['y'], $coordinates['x'], $coordinates['y']); $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); 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> 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"> <td class="nam">
<a href="build.php?id='.$id.'&show='.$row['id'].'">'.$row['name'].'</a> <span class="bon">'.$row['effect'].'</span> <a href="build.php?id='.$id.'&show='.$artifact['id'].'">'.$artifact['name'].'</a> <span class="bon">'.$artifact['effect'].'</span>
<div class="info">'; <div class="info">'.TREASURY.' <b>'.($artifactInfo['requiredLevel'] ?? 0).'</b>, '.EFFECT.' <b>'.($artifactInfo['effectInfluence'] ?? '').'</b></div>
</td>
$artifactInfo = Artifacts::getArtifactInfo($row); <td class="pla">
<a href="karte.php?d='.$artifact['vref'].'&c='.$generator->getMapCheck($artifact['vref']).'">'.$ownerName.'</a>
echo '<div class="info">'.TREASURY.' <b>'.$artifactInfo['requiredLevel'] . '</b>, '.EFFECT.' <b>'.$artifactInfo['effectInfluence'].'</b> </td>
</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>
<td class="dist">'.$distance.'</td> <td class="dist">'.$distance.'</td>
</tr>'; </tr>';
} }
} }
?> ?>
</tbody> </tbody>
</table> </table>
+13 -22
View File
@@ -2,19 +2,11 @@
<div id="build" class="gid27"> <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> <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 <h1><?php echo TREASURY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f' . $id] ?? 0; ?></span></h1>
echo $village->resarray['f' . $id];
?></span></h1>
<p class="build_desc"><?php echo TREASURY_DESC; ?></p> <p class="build_desc"><?php echo TREASURY_DESC; ?></p>
<?php <?php include("27_menu.tpl"); ?>
include ("27_menu.tpl");
?>
<table id="show_artefacts" cellpadding="1" cellspacing="1"> <table id="show_artefacts" cellpadding="1" cellspacing="1">
<thead> <thead>
@@ -30,10 +22,9 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php
$artifactsArray = $database->getArtifactsBysize(1); $artifactsArray = $database->getArtifactsBysize(1);
if(count($artifactsArray) == 0) { 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 { } else {
$previous = ""; $previous = "";
foreach($artifactsArray as $artifact){ foreach($artifactsArray as $artifact){
@@ -41,24 +32,24 @@
if($previous != "" && $previous != $artifact['type']) echo '<tr><td colspan="4"></td></tr>'; if($previous != "" && $previous != $artifact['type']) echo '<tr><td colspan="4"></td></tr>';
$previous = $artifact['type']; $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> echo '<tr>
<td class="icon"><img class="artefact_icon_'.$artifact['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"> <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>
<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="pla"><a href="karte.php?d='.$artifact['vref'].'&c='.$generator->getMapCheck($artifact['vref']).'">'.$ownerName.'</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="al">'.($aid ? '<a href="allianz.php?aid='.$aid.'">'.$allianceName.'</a>' : '-').'</td>
</tr>'; </tr>';
} }
} }
?> ?>
</tbody></table> </tbody></table>
<?php <?php include("upgrade.tpl"); ?>
include ("upgrade.tpl");
?>
</div> </div>
+12 -20
View File
@@ -2,19 +2,11 @@
<div id="build" class="gid27"> <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> <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 <h1><?php echo TREASURY; ?> <span class="level"><?php echo LEVEL; ?> <?php echo $village->resarray['f' . $id] ?? 0; ?></span></h1>
echo $Account->resarray['f' . $id];
?></span></h1>
<p class="build_desc"><?php echo TREASURY_DESC; ?></p> <p class="build_desc"><?php echo TREASURY_DESC; ?></p>
<?php <?php include("27_menu.tpl"); ?>
include ("27_menu.tpl");
?>
<table id="show_artefacts" cellpadding="1" cellspacing="1"> <table id="show_artefacts" cellpadding="1" cellspacing="1">
<thead> <thead>
@@ -30,10 +22,9 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php
$artifactsArray = $database->getArtifactsBysize([2, 3]); $artifactsArray = $database->getArtifactsBysize([2, 3]);
if(count($artifactsArray) == 0) { 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 { } else {
$previous = ""; $previous = "";
foreach($artifactsArray as $artifact){ foreach($artifactsArray as $artifact){
@@ -41,23 +32,24 @@
if($previous != "" && $previous != $artifact['type']) echo '<tr><td colspan="4"></td></tr>'; if($previous != "" && $previous != $artifact['type']) echo '<tr><td colspan="4"></td></tr>';
$previous = $artifact['type']; $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> echo '<tr>
<td class="icon"><img class="artefact_icon_'.$artifact['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"> <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> <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>
<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="pla"><a href="karte.php?d='.$artifact['vref'].'&c='.$generator->getMapCheck($artifact['vref']).'">'.$ownerName.'</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="al">'.($aid ? '<a href="allianz.php?aid='.$aid.'">'.$allianceName.'</a>' : '-').'</td>
</tr>'; </tr>';
} }
} }
?> ?>
</tbody></table> </tbody></table>
<?php <?php include("upgrade.tpl"); ?>
include ("upgrade.tpl");
?>
</div> </div>
+3 -21
View File
@@ -1,25 +1,7 @@
<div id="textmenu"> <div id="textmenu">
<a href="build.php?id=<?php echo $id; ?>" <?php <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>
if(!isset($_GET['t']) && $_GET['id'] == $id) { | <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>
echo "class=\"selected\"";
}
?> | <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>
"><?php echo OWN_ARTEFACTS; ?></a>
| <a href="build.php?id=<?php echo $id; ?>&t=2" <?php
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>
</div> </div>
+45 -34
View File
@@ -1,37 +1,39 @@
<?php <?php
include_once("GameEngine/Artifacts.php"); include_once("GameEngine/Artifacts.php");
$artifact = $database->getArtefactDetails($_GET['show']); $showId = (int)($_GET['show'] ?? 0);
$artifact = $database->getArtefactDetails($showId);
if(empty($artifact)){ if(empty($artifact)){
header("location: build.php?gid=27"); header("location: build.php?id=" . ($id ?? 0));
exit; exit;
} }
$artifactInfo = Artifacts::getArtifactInfo($artifact); $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"> <table id="art_details" cellpadding="1" cellspacing="1">
<thead> <thead>
<tr> <tr>
<th colspan="2"><?php echo $artifact['name'];?></th> <th colspan="2"><?php echo $artifact['name'] ?? '-';?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td colspan="2" class="desc"> <td colspan="2" class="desc">
<span class="detail"><?php echo $artifact['desc'] ?? '';?></span>
<span class="detail"><?php echo $artifact['desc'];?></span>
</td> </td>
</tr> </tr>
<tr> <tr>
<th><?php echo OWNER; ?></th> <th><?php echo OWNER; ?></th>
<td> <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> <a href="spieler.php?uid=<?php echo $artifact['owner'];?>"><?php echo $artifactOwnerUsername; ?></a>
<?php }else{?> <?php } else { ?>
<font color="grey"><span>[?]</span></font> <font color="grey"><span>[?]</span></font>
<?php } ?> <?php } ?>
</td> </td>
@@ -39,9 +41,11 @@ $artifactInfo = Artifacts::getArtifactInfo($artifact);
<tr> <tr>
<th><?php echo VILLAGE; ?></th> <th><?php echo VILLAGE; ?></th>
<td> <td>
<?php if($database->checkVilExist($artifact['vref'])){?> <?php if(!empty($artifact['vref']) && $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> $villageName = $database->getVillageField($artifact['vref'], "name") ?? '[?]';
<?php }else{?> ?>
<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> <font color="grey"><span>[?]</span></font>
<?php }?> <?php }?>
</td> </td>
@@ -49,42 +53,46 @@ $artifactInfo = Artifacts::getArtifactInfo($artifact);
<tr> <tr>
<th><?php echo ALLIANCE; ?></th> <th><?php echo ALLIANCE; ?></th>
<td> <td>
<?php if(($alliance = $database->getUserField($artifact['owner'], "alliance", 0)) > 0){ ?> <?php
<a href="allianz.php?aid=<?php echo $alliance;?>"><?php echo $database->getAllianceName($alliance); ?></a> $alliance = (int)($database->getUserField($artifact['owner'] ?? 0, "alliance", 0) ?? 0);
<?php }else{?> if($alliance > 0){
$allianceName = $database->getAllianceName($alliance) ?? '-';
?>
<a href="allianz.php?aid=<?php echo $alliance;?>"><?php echo $allianceName; ?></a>
<?php } else { ?>
<span>-</span> <span>-</span>
<?php }?> <?php }?>
</td> </td>
</tr> </tr>
<tr> <tr>
<th><?php echo AREA_EFFECT; ?></th> <th><?php echo AREA_EFFECT; ?></th>
<td><?php echo $artifactInfo['effectInfluence']; ?></td> <td><?php echo $artifactInfo['effectInfluence'] ?? '-'; ?></td>
</tr> </tr>
<tr> <tr>
<th><?php echo BONUS; ?></th> <th><?php echo BONUS; ?></th>
<td><?php echo $artifactInfo['bonus']; ?></td> <td><?php echo $artifactInfo['bonus'] ?? '-'; ?></td>
</tr> </tr>
<tr> <tr>
<th><?php echo REQUIRED_LEVEL; ?></th> <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>
<tr> <tr>
<th><?php echo TIME_CONQUER; ?></th> <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>
<tr> <tr>
<th><?php echo TIME_ACTIVATION; ?></th> <th><?php echo TIME_ACTIVATION; ?></th>
<td><?php echo $artifactInfo['active'];?></td> <td><?php echo $artifactInfo['active'] ?? '-';?></td>
</tr> </tr>
<?php if($artifact['type'] == 8){?> <?php if(($artifact['type'] ?? 0) == 8){?>
<tr> <tr>
<th><?php echo NEXT_EFFECT; ?></th> <th><?php echo NEXT_EFFECT; ?></th>
<td><?php echo $artifactInfo['nextEffect'];?></td> <td><?php echo $artifactInfo['nextEffect'] ?? '-';?></td>
</tr> </tr>
<?php }?> <?php }?>
@@ -102,30 +110,33 @@ $artifactInfo = Artifacts::getArtifactInfo($artifact);
</thead> </thead>
<tbody> <tbody>
<?php <?php
$owners = $database->getArtifactsChronology($_GET['show']); $owners = $database->getArtifactsChronology($showId);
if(!empty($owners)){ 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> <tr>
<td> <td>
<?php if(($artifactChronoOwnerUsername = $database->getUserField($owner['uid'], "username", 0)) != "[?]"){?> <?php if($chronoUsername != "[?]"){?>
<span class="none"><a href="spieler.php?uid=<?php echo $owner['uid'];?>"><?php echo $artifactChronoOwnerUsername;?></a></span> <span class="none"><a href="spieler.php?uid=<?php echo $owner['uid'];?>"><?php echo $chronoUsername;?></a></span>
<?php }else{?> <?php } else { ?>
<span class="none">[?]</span> <span class="none">[?]</span>
<?php }?> <?php }?>
</td> </td>
<td> <td>
<?php if($database->checkVilExist($owner['vref'])){?> <?php if($chronoVillage != '[?]'){?>
<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> <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{?> <?php } else { ?>
<span class="none">[?]</span> <span class="none">[?]</span>
<?php }?> <?php }?>
</td> </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> </tr>
<?php <?php
} }
}else{ } else {
?> ?>
<tr> <tr>
<td colspan="3"><span class="none"><?php echo NO_PREVIOUS_OWNERS; ?></span></td> <td colspan="3"><span class="none"><?php echo NO_PREVIOUS_OWNERS; ?></span></td>
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ## ## Refactored by Shadow ##
## License: TravianZ Project ## ## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ## ## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ## ## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ## ## Source code: http://github.com/Shadowss/TravianZ/ ##
## ## ## ##
################################################################################# #################################################################################
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ## ## Refactored by Shadow ##
## License: TravianZ Project ## ## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ## ## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ## ## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ## ## Source code: http://github.com/Shadowss/TravianZ/ ##
## ## ## ##
################################################################################# #################################################################################
+1 -1
View File
@@ -11,7 +11,7 @@
## Fixed by: Shadow / Skype : cata7007 ## ## Fixed by: Shadow / Skype : cata7007 ##
## License: TravianZ Project ## ## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ## ## 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/ ## ## Source code: http://github.com/Shadowss/TravianZ-by-Shadow/ ##
## ## ## ##
################################################################################# #################################################################################
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ## ## Refactored by Shadow ##
## License: TravianZ Project ## ## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ## ## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ## ## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ## ## Source code: http://github.com/Shadowss/TravianZ/ ##
## ## ## ##
################################################################################# #################################################################################
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ## ## Refactored by Shadow ##
## License: TravianZ Project ## ## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ## ## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ## ## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ## ## Source code: http://github.com/Shadowss/TravianZ/ ##
## ## ## ##
################################################################################# #################################################################################
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ## ## Refactored by Shadow ##
## License: TravianZ Project ## ## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ## ## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ## ## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ## ## Source code: http://github.com/Shadowss/TravianZ/ ##
## ## ## ##
################################################################################# #################################################################################
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ## ## Refactored by Shadow ##
## License: TravianZ Project ## ## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ## ## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ## ## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ## ## Source code: http://github.com/Shadowss/TravianZ/ ##
## ## ## ##
################################################################################# #################################################################################
+68 -4
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ## ## Refactored by Shadow ##
## License: TravianZ Project ## ## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ## ## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ## ## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ## ## Source code: http://github.com/Shadowss/TravianZ/ ##
## ## ## ##
################################################################################# #################################################################################
@@ -176,7 +176,7 @@ while ($data = mysqli_fetch_assoc($query)) {
// ========================= // =========================
// USER SETTINGS SAVE // 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; $v1 = isset($_POST['v1']) ? 1 : 0;
$v2 = isset($_POST['v2']) ? 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; $timezone = isset($_POST['timezone']) ? (int)$_POST['timezone'] : 1;
$tformat = isset($_POST['tformat']) ? (int)$_POST['tformat'] : 0; $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 // update user preferences
$database->query(" $database->query("
UPDATE " . TB_PREFIX . "users SET UPDATE " . TB_PREFIX . "users SET
@@ -200,10 +218,14 @@ if (isset($_POST['v1']) || isset($_POST['v2']) || isset($_POST['timezone'])) {
v5=$v5, v5=$v5,
v6=$v6, v6=$v6,
timezone=$timezone, timezone=$timezone,
tformat=$tformat tformat=$tformat,
lang='$lang'
WHERE id=" . (int)$session->uid . " WHERE id=" . (int)$session->uid . "
"); ");
// schimbare instant în sesiune
$_SESSION['lang'] = $lang;
header("Location: spieler.php?s=2"); header("Location: spieler.php?s=2");
exit; exit;
} }
@@ -467,7 +489,49 @@ if (isset($_POST['v1']) || isset($_POST['v2']) || isset($_POST['timezone'])) {
</tbody> </tbody>
</table> </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 SAVE BUTTON
========================= --> ========================= -->
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ## ## Refactored by Shadow ##
## License: TravianZ Project ## ## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ## ## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ## ## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ## ## Source code: http://github.com/Shadowss/TravianZ/ ##
## ## ## ##
################################################################################# #################################################################################
+1 -1
View File
@@ -9,7 +9,7 @@
## Refactored by Shadow ## ## Refactored by Shadow ##
## License: TravianZ Project ## ## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ## ## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ## ## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ## ## Source code: http://github.com/Shadowss/TravianZ/ ##
## ## ## ##
################################################################################# #################################################################################
+1 -1
View File
@@ -10,7 +10,7 @@
## Refactored by Shadow ## ## Refactored by Shadow ##
## License: TravianZ Project ## ## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2026. All rights reserved. ## ## Copyright: TravianZ (c) 2010-2026. All rights reserved. ##
## URLs: http://travian.shadowss.ro ## ## URLs: http://travianz.org ##
## Source code: http://github.com/Shadowss/TravianZ/ ## ## 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, `username` varchar(100) DEFAULT NULL,
`password` varchar(100) DEFAULT NULL, `password` varchar(100) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL,
`lang` varchar(5) NOT NULL DEFAULT 'en',
`tribe` tinyint(1) DEFAULT NULL, `tribe` tinyint(1) DEFAULT NULL,
`access` tinyint(1) DEFAULT '1', `access` tinyint(1) DEFAULT '1',
`gold` int(9) DEFAULT '0', `gold` int(9) DEFAULT '0',