Fix some bugs + added (coded delAli)

Fix some bugs + added (coded delAli)
This commit is contained in:
novgorodschi catalin
2026-05-25 12:37:33 +03:00
parent a4e2c506a8
commit 8c3ab3e5eb
14 changed files with 532 additions and 425 deletions
+90 -99
View File
@@ -108,64 +108,58 @@ if($_GET['aid']) {
</div>
</div>
<div class="grid-2">
<!-- LEFT -->
<div>
<div class="card">
<h3>📋 Alliance Details</h3>
<div class="body">
<table class="info-list">
<tr><th>Tag</th><td><?php echo htmlspecialchars($alidata['tag']); ?></td></tr>
<tr><th>Name</th><td><?php echo htmlspecialchars($alidata['name']); ?></td></tr>
<tr><th>Rank</th><td><b>#<?php echo $allianceRank; ?></b></td></tr>
<tr><th>Points</th><td><?php echo number_format($totalpop); ?></td></tr>
<tr><th>Capacity</th><td>
<?php $now=count($aliusers); $cls=$now>=$maxMembers?'full':'ok'; ?>
<span class="badge-cap <?php echo $cls; ?>"><?php echo "$now/$maxMembers"; ?></span>
</td></tr>
</table>
<!-- ALLIANCE DETAILS -->
<div class="card">
<h3>📋 Alliance Details</h3>
<div class="body">
<table class="info-list">
<tr><th>Tag</th><td><?php echo htmlspecialchars($alidata['tag']); ?></td></tr>
<tr><th>Name</th><td><?php echo htmlspecialchars($alidata['name']); ?></td></tr>
<tr><th>Rank</th><td><b>#<?php echo $allianceRank; ?></b></td></tr>
<tr><th>Points</th><td><?php echo number_format($totalpop); ?></td></tr>
<tr><th>Capacity</th><td>
<?php $now=count($aliusers); $cls=$now>=$maxMembers?'full':'ok'; ?>
<span class="badge-cap <?php echo $cls; ?>"><?php echo "$now/$maxMembers"; ?></span>
</td></tr>
</table>
<div style="margin-top:12px;">
<b style="font-size:12px;">🛡 Alliance Positions</b>
<div class="positions">
<?php
error_reporting(0);
$sql = "SELECT * FROM ".TB_PREFIX."ali_permission WHERE alliance = $aid";
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result)){
$player = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT username FROM ".TB_PREFIX."users WHERE id = ".(int)$row['uid']));
$perms = [];
if($row['opt1']) $perms[]="Assign"; if($row['opt2']) $perms[]="Kick";
if($row['opt3']) $perms[]="Edit Desc"; if($row['opt4']) $perms[]="Invite";
if($row['opt5']) $perms[]="Forum"; if($row['opt6']) $perms[]="Diplomacy";
if($row['opt7']) $perms[]="MM";
echo '<div class="pos-item"><span class="name"><a href="admin.php?p=player&uid='.$row['uid'].'">'.htmlspecialchars($player['username']).'</a></span> <span class="rank">'.htmlspecialchars($row['rank']).'</span><div class="perms">'.implode(' • ', $perms).'</div></div>';
}
?>
</div>
</div>
<div class="btn-row">
<a class="btn edit" href="?p=editAli&aid=<?php echo $alidata['id'];?>"> Edit Alliance</a>
<a class="btn del" href="?p=DelAli&aid=<?php echo $alidata['id'];?>" onclick="return confirm('Delete alliance?')">🗑 Delete</a>
</div>
</div>
</div>
<div class="card">
<h3>📢 Alliance Notice</h3>
<div class="body"><div class="desc-box"><?php echo nl2br(htmlspecialchars($alidata['notice'])); ?></div></div>
<div style="margin-top:12px;">
<b style="font-size:12px;">🛡 Alliance Positions</b>
<div class="positions">
<?php
$sql = "SELECT * FROM ".TB_PREFIX."ali_permission WHERE alliance = $aid";
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result)){
$player = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT username FROM ".TB_PREFIX."users WHERE id = ".(int)$row['uid']));
$perms = [];
if($row['opt1']) $perms[]="Assign"; if($row['opt2']) $perms[]="Kick";
if($row['opt3']) $perms[]="Edit Desc"; if($row['opt4']) $perms[]="Invite";
if($row['opt5']) $perms[]="Forum"; if($row['opt6']) $perms[]="Diplomacy";
if($row['opt7']) $perms[]="MM";
echo '<div class="pos-item"><span class="name"><a href="admin.php?p=player&uid='.$row['uid'].'">'.htmlspecialchars($player['username']).'</a></span> <span class="rank">'.htmlspecialchars($row['rank']).'</span><div class="perms">'.implode(' • ', $perms).'</div></div>';
}
?>
</div>
</div>
<!-- RIGHT -->
<div>
<div class="card">
<h3>📖 Alliance Description</h3>
<div class="body"><div class="desc-box" style="min-height:260px;"><?php echo nl2br(htmlspecialchars($alidata['desc'])); ?></div></div>
</div>
<div class="btn-row">
<a class="btn edit" href="?p=editAli&aid=<?php echo $alidata['id'];?>"> Edit Alliance</a>
<a class="btn del" href="?p=DelAli&aid=<?php echo $alidata['id'];?>" onclick="return confirm('Delete alliance?')">🗑 Delete</a>
</div>
</div>
</div>
<!-- ALLIANCE DESCRIPTION - ACUM SUB DETAILS -->
<div class="card">
<h3>📖 Alliance Description</h3>
<div class="body"><div class="desc-box" style="min-height:120px;"><?php echo nl2br(htmlspecialchars($alidata['desc'])); ?></div></div>
</div>
<!-- ALLIANCE NOTICE - ACUM SUB DESCRIPTION -->
<div class="card">
<h3>📢 Alliance Notice</h3>
<div class="body"><div class="desc-box"><?php echo nl2br(htmlspecialchars($alidata['notice'])); ?></div></div>
</div>
<!-- MEMBERS -->
<div class="card">
@@ -200,54 +194,51 @@ if($_GET['aid']) {
</div>
</div>
<div class="grid-2">
<!-- NEWS -->
<div class="card">
<h3>📰 Alliance News</h3>
<div class="body" style="padding:0;max-height:300px;overflow:auto;">
<table class="mini-table">
<thead><tr><th>Event</th><th style="width:130px;">Time</th></tr></thead>
<tbody>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."ali_log WHERE aid = $aid ORDER BY date DESC LIMIT 50";
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result)){
// --- FIX 4: curata HTML-ul din news ---
$comment = html_entity_decode($row['comment']);
$comment = preg_replace('/<a href="spieler\.php\?uid=(\d+)">([^<]+)<\/a>/i', '<a href="admin.php?p=player&uid=$1">$2</a>', $comment);
$comment = strip_tags($comment, '<a>'); // lasa doar linkurile curate
echo '<tr><td>'.$comment.'</td><td>'.date('d.m.Y H:i', $row['date']).'</td></tr>';
}
?>
</tbody>
</table>
</div>
</div>
<!-- DIPLOMACY -->
<div class="card">
<h3>🤝 Diplomacy</h3>
<div class="body" style="padding:0;">
<table class="mini-table">
<thead><tr><th>Alliance</th><th>Type</th><th style="width:60px;">Status</th></tr></thead>
<tbody>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE alli1 = $aid OR alli2 = $aid ORDER BY accepted DESC";
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result)){
$other = ($row['alli1']==$aid) ? $row['alli2'] : $row['alli1'];
$ally = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT tag FROM ".TB_PREFIX."alidata WHERE id = ".(int)$other));
$type = $row['type']==1?'Confederation':($row['type']==2?'NAP':'War');
$cls = 'diplo-'.$row['type'];
$acc = $row['accepted'] ? '<img src="../../gpack/travian_default/img/a/acc.gif">' : '<img src="../../gpack/travian_default/img/a/del.gif">';
echo '<tr><td><a href="admin.php?p=alliance&aid='.$other.'">'.htmlspecialchars($ally['tag']).'</a></td><td><span class="diplo-type '.$cls.'">'.$type.'</span></td><td>'.$acc.'</td></tr>';
}
?>
</tbody>
</table>
</div>
</div>
<!-- NEWS - FULL WIDTH -->
<div class="card">
<h3>📰 Alliance News</h3>
<div class="body" style="padding:0;max-height:300px;overflow:auto;">
<table class="mini-table">
<thead><tr><th>Event</th><th style="width:130px;">Time</th></tr></thead>
<tbody>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."ali_log WHERE aid = $aid ORDER BY date DESC LIMIT 50";
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result)){
$comment = html_entity_decode($row['comment']);
$comment = preg_replace('/<a href="spieler\.php\?uid=(\d+)">([^<]+)<\/a>/i', '<a href="admin.php?p=player&uid=$1">$2</a>', $comment);
$comment = strip_tags($comment, '<a>');
echo '<tr><td>'.$comment.'</td><td>'.date('d.m.Y H:i', $row['date']).'</td></tr>';
}
?>
</tbody>
</table>
</div>
</div>
<!-- DIPLOMACY - FULL WIDTH -->
<div class="card">
<h3>🤝 Diplomacy</h3>
<div class="body" style="padding:0;">
<table class="mini-table">
<thead><tr><th>Alliance</th><th>Type</th><th style="width:60px;">Status</th></tr></thead>
<tbody>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE alli1 = $aid OR alli2 = $aid ORDER BY accepted DESC";
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result)){
$other = ($row['alli1']==$aid) ? $row['alli2'] : $row['alli1'];
$ally = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT tag FROM ".TB_PREFIX."alidata WHERE id = ".(int)$other));
$type = $row['type']==1?'Confederation':($row['type']==2?'NAP':'War');
$cls = 'diplo-'.$row['type'];
$acc = $row['accepted'] ? '<img src="../../gpack/travian_default/img/a/acc.gif">' : '<img src="../../gpack/travian_default/img/a/del.gif">';
echo '<tr><td><a href="admin.php?p=alliance&aid='.$other.'">'.htmlspecialchars($ally['tag']).'</a></td><span class="diplo-type '.$cls.'">'.$type.'</span></td><td>'.$acc.'</td></tr>';
}
?>
</tbody>
</table>
</div>
</div>
<?php include("allymedals.tpl"); ?>
</div>
+54 -47
View File
@@ -23,51 +23,58 @@ include_once("../GameEngine/Artifacts.php");
$artifact = reset($database->getOwnArtefactInfo($_GET['did']));
$artifactOfTheFool = !empty($artifact) && $artifact['type'] == 8;
$artifactInfo = Artifacts::getArtifactInfo($artifact);
$artifactInfo = $artifact ? Artifacts::getArtifactInfo($artifact) : null;
?>
<table id="member">
<thead>
<tr>
<th colspan="8">Artifact</th>
</tr>
<tr>
<td class="ra"></td>
<td class="ra"></td>
<td colspan="1">Name</td>
<td colspan="1">Bonus</td>
<td colspan="1">Area of effect</td>
<td colspan="1">Time of conquer</td>
<td colspan="1">Time of activation</td>
<?php if($artifactOfTheFool){?>
<td colspan="1">Next activation</td>
<?php } ?>
</tr>
</thead>
<tbody>
<?php
if(empty($artifact)){
?>
<tr>
<td colspan="8"><div style="text-align: center"><?php echo NO_ARTEFACTS; ?></div></td>
</tr>
<?php }else{ ?>
<tr>
<td><a href="?action=delArtifact&artid=<?php echo $artifact['id']; ?>&del=0" onClick="return del('arti', <?php echo $artifact['id']; ?>)"><img src="../img/admin/del.gif"></a></td>
<td class="icon"><img class="artefact_icon_<?php echo $artifact['type']; ?>" src="../img/x.gif"></td>
<td colspan="1"><div style="text-align: center"><?php echo $artifact['name']; ?></div></td>
<td colspan="1"><div style="text-align: center"><?php echo $artifactInfo['bonus']; ?></div></td>
<td colspan="1"><div style="text-align: center"><?php echo $artifactInfo['effectInfluence']; ?></div></td>
<td colspan="1"><div style="text-align: center"><?php echo date("d.m.Y H:i:s", $artifact['conquered']); ?></div></td>
<td colspan="1"><div style="text-align: center"><?php echo $artifactInfo['active']; ?></div></td>
<?php if($artifactOfTheFool){?>
<td colspan="1"><div style="text-align: center"><?php echo $artifactInfo['nextEffect']; ?></div></td>
<?php } ?>
</tr>
<?php } ?>
</tbody>
</table>
<?php
if($village['owner'] != 3 && !empty($artifact)) echo '<a href="admin.php?action=returnArtifact&artid='.$artifact['id'].'">Return to Natars</a>';
?>
<style>
.artifact-modern{font-family:system-ui}
.artifact-table{width:100%;border-collapse:collapse;font-size:12.5px;table-layout:fixed}
.artifact-table th{background:#f8fafc;padding:6px 4px;text-align:center;font-weight:600;color:#475569;border-bottom:1px solid #e5e7eb;font-size:11px;text-transform:uppercase;letter-spacing:.2px}
.artifact-table td{padding:8px 4px;border-bottom:1px solid #f1f5f9;text-align:center;vertical-align:middle;color:#334155;word-break:break-word}
.artifact-table td.icon{width:26px}
.artifact-table td.del{width:26px}
.artifact-table td.name{font-weight:600;color:#0f172a}
.artifact-table tr:last-child td{border-bottom:0}
.artifact-empty{padding:14px;text-align:center;color:#94a3b8;font-style:italic;font-size:12.5px}
.artifact-foot{padding:6px 2px 0;font-size:12.5px}
.artifact-foot a{color:#16a34a;text-decoration:none;font-weight:500}
.artifact-foot a:hover{text-decoration:underline}
</style>
<div class="artifact-modern">
<?php if(empty($artifact)): ?>
<div class="artifact-empty"><?php echo NO_ARTEFACTS; ?></div>
<?php else: ?>
<table class="artifact-table">
<thead>
<tr>
<th class="del"></th>
<th class="icon"></th>
<th>Name</th>
<th>Bonus</th>
<th>Area of effect</th>
<th>Time of conquer</th>
<th>Time of activation</th>
<?php if($artifactOfTheFool) echo '<th>Next activation</th>'; ?>
</tr>
</thead>
<tbody>
<tr>
<td class="del"><a href="?action=delArtifact&artid=<?php echo $artifact['id']; ?>&del=0" onclick="return del('arti',<?php echo $artifact['id']; ?>)"><img src="../img/admin/del.gif"></a></td>
<td class="icon"><img class="artefact_icon_<?php echo $artifact['type']; ?>" src="../img/x.gif"></td>
<td class="name"><?php echo htmlspecialchars($artifact['name']); ?></td>
<td><?php echo $artifactInfo['bonus']; ?></td>
<td><?php echo $artifactInfo['effectInfluence']; ?></td>
<td><?php echo date("d.m.Y H:i:s", $artifact['conquered']); ?></td>
<td><b><?php echo $artifactInfo['active']; ?></b></td>
<?php if($artifactOfTheFool) echo '<td>'.$artifactInfo['nextEffect'].'</td>'; ?>
</tr>
</tbody>
</table>
<?php endif; ?>
<?php if($village['owner'] != 3 && !empty($artifact)): ?>
<div class="artifact-foot">
<a href="admin.php?action=returnArtifact&artid=<?php echo $artifact['id']; ?>">Return to Natars</a>
</div>
<?php endif; ?>
</div>
+54
View File
@@ -0,0 +1,54 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : delAli.tpl ##
## Type : Admin Panel Frontend ##
## --------------------------------------------------------------------------- ##
## Developed by : Dzoki (Original) ##
## Refactored by : Shadow ##
## Redesign by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2025. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
$aid = (int)$_GET['aid'];
$alidata = $database->getAlliance($aid);
if(!$alidata){ echo "<div class='card'><div class='body'>Alliance not found</div></div>"; return; }
$members = $database->getAllMember($aid);
?>
<style>
.del-wrap{max-width:600px;margin:30px auto;font-family:Verdana;}
.del-card{background:#fff;border:1px solid #c00;border-radius:5px;overflow:hidden;}
.del-card h3{margin:0;padding:10px 14px;background:#ffe5e5;color:#900;border-bottom:1px solid #c00;font-size:14px;}
.del-card.body{padding:16px;font-size:13px;line-height:1.5;}
.del-card.warn{background:#fff3cd;border:1px solid #ffc107;padding:8px;margin:10px 0;border-radius:3px;color:#664d03;}
.btn{padding:8px 14px;border-radius:3px;text-decoration:none;font-size:13px;border:1px solid #bbb;display:inline-block;}
.btn.del{background:#c00;color:#fff;border-color:#900;}
.btn.cancel{background:#f5f5f5;color:#333;margin-left:8px;}
</style>
<div class="del-wrap">
<div class="del-card">
<h3>🗑 Delete Alliance</h3>
<div class="body">
<p>Are you sure you want to permanently delete?:</p>
<p style="font-size:16px;margin:10px 0;"><b>[<?php echo htmlspecialchars($alidata['tag']);?>] <?php echo htmlspecialchars($alidata['name']);?></b></p>
<p>Members: <b><?php echo count($members);?></b> | Points: <b><?php echo number_format($database->getVSumField(array_column($members,'id'),'pop')[0]['Total']?? 0);?></b></p>
<div class="warn">⚠ All members will be removed from the alliance, permissions, diplomacy, logs and the alliance forum will be deleted. The action is irreversible!</div>
<form method="POST" action="../GameEngine/Admin/Mods/delAli.php" onsubmit="return confirm('Last warning: DELETE PERMANENTLY?');">
<input type="hidden" name="aid" value="<?php echo $aid;?>">
<input type="hidden" name="admid" value="<?php echo $_SESSION['id'];?>">
<button type="submit" class="btn del">YES, DELETE</button>
<a href="admin.php?p=alliance&aid=<?php echo $aid;?>" class="btn cancel">Cancel</a>
</form>
</div>
</div>
</div>
+2 -2
View File
@@ -82,7 +82,7 @@ function genPw(){
<div class="body">
<div class="warning">
<span></span>
<div><b>Atenție:</b> Parola se schimbă instant. Jucătorul va fi delogat. Nu se trimite email automat.</div>
<div><b>WARNING:</b> The password is changed instantly. The player will be logged out. No automatic email is sent.</div>
</div>
<div class="form-group">
@@ -91,7 +91,7 @@ function genPw(){
<input type="text" id="newpw" name="newpw" value="" placeholder="Introdu parola nouă" autocomplete="new-password" required>
<button type="button" class="toggle-eye" onclick="togglePw()" title="Show/Hide">👁</button>
</div>
<button type="button" class="btn-gen" onclick="genPw()">🎲 Generează parolă sigură</button>
<button type="button" class="btn-gen" onclick="genPw()">🎲 Generate secure password</button>
</div>
</div>
</div>
+1 -1
View File
@@ -98,7 +98,7 @@ function setDays(d){ document.getElementById('protect').value = d; }
<button type="button" onclick="setDays(0)">Remove</button>
</div>
<div class="info">💡 Pune 0 ca scoți protecția. Protecția se adaugă de la momentul salvării.</div>
<div class="info">💡 Set to 0 to remove protection. Protection is added from the time of saving.</div>
</div>
</div>
+1 -1
View File
@@ -76,7 +76,7 @@ function clearSitter(n){ document.getElementById('sit'+n).value = '0'; }
<div class="card">
<h3> Sitter Settings</h3>
<div class="body">
<div class="info">💡 Folosește UID-ul jucătorului. Pune <b>0</b> ca ștergi sitter-ul. Găsești UID-ul din Search.</div>
<div class="info">💡 Use the player's UID. Enter <b>0</b> to delete the sitter. You can find the UID in Search.</div>
<div class="sitter-grid">
<div class="sitter-box">
+10 -11
View File
@@ -25,20 +25,19 @@ if(isset($id) && $id > 0) {
$uid = $id;
?>
<style>
.editUser-wrap { max-width:1100px; margin:0 auto; font-family:Verdana,Arial; }
.editUser-wrap { max-width:1100px; margin:0 auto; font-family:system-ui; }
.editUser-head {
background: linear-gradient(#f8f8f8,#e9e9e9);
border:1px solid #c0c0c0; padding:10px 14px; margin-bottom:12px;
border-radius:4px; display:flex; align-items:center; justify-content:space-between;
background: linear-gradient(135deg,#0f172a,#1e293b); color:#fff;
border:1px solid #0f172a; padding:10px 14px; margin-bottom:12px;
border-radius:10px; display:flex; align-items:center; justify-content:space-between;
}
.editUser-head h2 { margin:0; font-size:18px; color:#333; }
.editUser-head h2 a { color:#71D000; text-decoration:none; }
.editUser-head .meta { font-size:12px; color:#666; }
.editUser-grid { display:grid; grid-template-columns: 380px 1fr; gap:12px; }
.editUser-head h2 { margin:0; font-size:16px; }
.editUser-head h2 a { color:#86efac; text-decoration:none; }
.editUser-head .meta { font-size:12px; color:#cbd5e1; }
@media(max-width:900px){ .editUser-grid{grid-template-columns:1fr;} }
.card { background:#fff; border:1px solid #d0d0d0; border-radius:4px; box-shadow:0 1px 2px rgba(0,0,0,.05); overflow:hidden; }
.card h3 { margin:0; padding:8px 12px; background:#f0f0f0; border-bottom:1px solid #d0d0d0; font-size:13px; text-transform:uppercase; color:#444; letter-spacing:.5px; }
.card { background:#fff; border:1px solid #e5e7eb; border-radius:10px; overflow:hidden; margin-bottom:12px; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.card h3 { margin:0; padding:9px 12px; background:#f8fafc; border-bottom:1px solid #e5e7eb; font-size:12px; text-transform:uppercase; color:#475569; letter-spacing:.5px; }
.card .body { padding:12px; }
.form-row { display:flex; margin-bottom:10px; align-items:center; }
@@ -52,7 +51,7 @@ select.dropdown { width:100%; }
.btn-mini { background:linear-gradient(#7ed321,#5eae0f); border:1px solid #4a8a0c; color:#fff; padding:5px 10px; font-size:11px; font-weight:bold; border-radius:3px; cursor:pointer; margin-left:6px; }
.btn-mini:hover { filter:brightness(1.05); }
.desc-box textarea { width:100%; box-sizing:border-box; border:1px solid #bbb; border-radius:3px; padding:6px; font-family:Consolas,monospace; font-size:12px; resize:vertical; }
.desc-box textarea { width:100%; box-sizing:border-box; border:1px solid #cbd5e1; border-radius:6px; padding:8px; font-family:system-ui; font-size:13px; resize:vertical; }
.desc-box textarea:focus { border-color:#71D000; outline:none; }
.medals-table { width:100%; border-collapse:collapse; font-size:12px; }
+117 -189
View File
@@ -1,4 +1,5 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
@@ -20,203 +21,130 @@
$id = $_GET['did'];
$coor = $database->getCoor($village['wref']);
$varray = $database->getProfileVillages($village['owner']);
$type = $database->getVillageType($village['wref']);
$fdata = $database->getResourceLevel($village['wref']);
if(isset($id))
{
include("search2.tpl"); ?>
<link href="../<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7i" rel="stylesheet" type="text/css">
<form action="../GameEngine/Admin/Mods/editBuildings.php" method="POST">
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
<input type="hidden" name="id" value="<?php echo $_GET['did']; ?>" />
<br />
if(isset($id)) { include("search2.tpl"); ?>
<link href="../<?php echo GP_LOCATE; ?>lang/en/compact.css" rel="stylesheet">
<style>
/* centrează mizeria aia de hartă */
#content.village1 {float: none !important;margin: 0 auto !important;width: 300px;display: block;padding: 20px 0;}
#content.village1 #village_map {float: none !important;margin: 0 auto !important;left: 0 !important;right: 0 !important;position: relative !important;display: block;}
.village-page{font-family:system-ui;max-width:1100px;margin:0 auto;padding:0 6px}
.vcard{background:#fff;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.04);margin-bottom:12px}
.vhead{background:linear-gradient(135deg,#0f172a,#1e293b);color:#fff;padding:8px 12px;font-weight:600;font-size:13px;display:flex;align-items:center}
.vtable{width:100%;border-collapse:collapse;font-size:12.5px}
.vtable th{background:#f8fafc;padding:6px;border-bottom:1px solid #e5e7eb;text-align:left;font-weight:600;color:#475569}
.vtable td{padding:5px 6px;border-bottom:1px solid #f1f5f9;vertical-align:middle}
.vtable tr:last-child td{border-bottom:0}
.input-mini{width:60px;padding:4px 6px;border:1px solid #d1d5db;border-radius:5px;font-size:12.5px;text-align:center}
.btn-save{padding:8px 18px;background:#16a34a;color:#fff;border:0;border-radius:6px;font-weight:600;cursor:pointer}
.btn-save:hover{background:#15803d}
.instr-link{margin-left:auto;color:#93c5fd;font-size:12px;text-decoration:none;cursor:pointer}
.map-wrap{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:900px){.map-wrap{grid-template-columns:1fr}}
.map-box{background:#fcfcfd;border:1px solid #e5e7eb;border-radius:8px;padding:8px;text-align:center}
</style>
<a href="#" onclick="showStuff('instructions'); return false;">Show Instructions</a>
<span id="instructions" style="display: none;">
<h4>Building ID's (Position)</h4>
<div id="content" class="village1" style="min-height: 264px;">
<div id="village_map" class="f<?php echo $database->getVillageType($village['wref']); ?>" style="float: left;">
<?php
for($f = 1; $f < 19; $f++){
##$gid = $fdata['f'.($f).'t'];
##$level = $fdata['f'.($f)];
echo "<img src=\"../img/x.gif\" class=\"reslevel rf".$f." level".$f."\">";
}
?>
</div>
</div>
<div class="village-page">
<form action="../GameEngine/Admin/Mods/editBuildings.php" method="POST">
<input type="hidden" name="admid" value="<?php echo $_SESSION['id']; ?>">
<input type="hidden" name="id" value="<?php echo $_GET['did']; ?>">
<div id="content" class="village2" style="padding: 0; margin-left: -20px;">
<div id="village_map" class="d2_0">
<?php
for($b = 1; $b < 21; $b++){
echo "<img src=\"../img/x.gif\" class=\"building d".$b." iso\">";
}
?>
<div id="levels" class="on">
<?php
for($b = 1; $b < 21; $b++){
echo "<div class=\"d$b\">".($b + 18)."</div>";
}
?>
</div>
</div>
</div>
<div class="vcard">
<div class="vhead">Edit Village <?php echo htmlspecialchars($village['name']); ?> (<?php echo $coor['x'].'|'.$coor['y']; ?>)
<a class="instr-link" onclick="document.getElementById('instr').style.display = document.getElementById('instr').style.display=='none'?'block':'none';return false">Show Instructions</a>
</div>
<div id="instr" style="display:none;padding:12px;background:#fcfcfd;border-bottom:1px solid #e5e7eb">
<div style="display:flex;flex-direction:column;gap:24px;align-items:center">
<div style="text-align:center">
<h4 style="margin:0 8px;font-size:12px;color:#475569">Resource Fields (1-18)</h4>
<div id="content" class="village1" style="min-height:auto">
<div id="village_map" class="f<?php echo $type; ?>" style="margin:0 auto;float:none">
<?php for($f=1;$f<19;$f++) echo '<img src="../img/x.gif" class="reslevel rf'.$f.' level'.$f.'">'; ?>
</div>
</div>
</div>
<table id="member">
<thead>
<tr>
<th colspan="2">Buildings</th>
</tr>
<tr>
<td>GID</td>
<td>Name</td>
</tr>
</thead>
<tbody>
<?php
for($i = 1; $i <= 42; $i++){
$bu = $funct->procResType($i);
echo '
<tr>
<td class="on">'.$i.'.</td>
<td class="on">'.$bu.'</td>
</tr>';
}
?>
</tbody>
</table>
<a href="#" onclick="hideStuff('instructions'); return false;">Hide Instructions</a>
</span>
<div style="text-align:center">
<h4 style="margin:0 0 8px;font-size:12px;color:#475569">Village Center (19-38)</h4>
<div id="content" class="village2" style="padding:0">
<div id="village_map" class="d2_0" style="margin:0 auto;transform:scale(.85);transform-origin:top">
<?php for($b=1;$b<21;$b++) echo '<img src="../img/x.gif" class="building d'.$b.' iso">'; ?>
<div id="levels" class="on"><?php for($b=1;$b<21;$b++) echo '<div class="d'.$b.'">'.($b+18).'</div>'; ?></div>
</div>
</div>
</div>
<br />
</div>
<!-- tabelul cu GID rămâne sub ele -->
<div style="margin-top:10px;max-height:180px;overflow:auto;border:1px solid #e5e7eb;border-radius:6px">
<table class="vtable" style="font-size:11.5px">
<thead><tr><th style="width:50px">GID</th><th>Name</th></tr></thead>
<tbody><?php for($i=1;$i<=42;$i++){ echo '<tr><td>'.$i.'</td><td>'.$funct->procResType($i).'</td></tr>'; } ?></tbody>
</table>
</div>
</div>
</div>
<table id="member" cellpadding="1" cellspacing="1" >
<thead>
<tr>
<th colspan="4">Modify Buildings</th>
</tr>
<tr>
<td class="on">ID</td>
<td class="on">GID</td>
<td class="hab">Name</td>
<td class="on">Level</td>
</tr>
</thead>
<tbody>
<?php
for ($i = 1; $i <= 41; $i++){
if($i == 41) $i = 99;
if($fdata['f'.$i.'t'] == 0) $bu = "-";
else $bu = $funct->procResType($fdata['f'.$i.'t']);
<div class="vcard">
<div class="vhead">Modify Buildings</div>
<div style="overflow-x:auto">
<table class="vtable">
<thead><tr><th style="width:50px">ID</th><th style="width:70px">GID</th><th>Name</th><th style="width:70px">Level</th></tr></thead>
<tbody>
<?php
for($i=1;$i<=41;$i++){
if($i==41)$i=99;
$gid=(int)$fdata['f'.$i.'t']; $lvl=(int)$fdata['f'.$i];
$bu=$gid==0?'-':$funct->procResType($gid);
echo '<tr>
<td style="text-align:center;color:#64748b">'.$i.'</td>
<td><input class="input-mini" name="id'.$i.'gid" value="'.$gid.'"></td>
<td>'.$bu.'</td>
<td><input class="input-mini" name="id'.$i.'level" value="'.$lvl.'"></td>
</tr>';
}
?>
</tbody>
</table>
</div>
<div style="text-align:center;padding:12px;border-top:1px solid #f1f5f9">
<button type="submit" class="btn-save">Save Changes</button>
</div>
</div>
</form>
echo '
<tr>
<td class="on">'.$i.'</td>
<td class="on"><input class="fm" name="id'.$i.'gid" value="'.$fdata['f'.$i.'t'].'"></td>
<td class="hab">'.$bu.'</td>
<td class="on"><input class="fm" name="id'.$i.'level" value="'.$fdata['f'.$i].'"></td>
</tr>';
}
?>
</tbody>
</table>
<div class="vcard">
<div class="vhead">Current Layout Preview</div>
<div style="padding:16px;display:flex;flex-direction:column;gap:28px;align-items:center">
<!-- 1. Resource Fields -->
<div style="text-align:center">
<div style="font-size:12px;font-weight:600;color:#475569;margin-bottom:8px">Resource Fields</div>
<div id="content" class="village1" style="min-height:auto">
<div id="village_map" class="f<?php echo $type; ?>" style="float:none;margin:0 auto">
<?php for($f=1;$f<19;$f++){ $level=$fdata['f'.$f]; echo '<img src="../img/x.gif" class="reslevel rf'.$f.' level'.$level.'">'; } ?>
</div>
</div>
</div>
<br /><br />
<center><input type="image" src="../img/admin/b/ok1.gif" value="submit"></center>
<!-- 2. Village Center -->
<div style="text-align:center">
<div style="font-size:12px;font-weight:600;color:#475569;margin-bottom:8px">Village Center</div>
<?php $WW=$fdata['f99t']; $wall=$fdata['f40t']; $wallType=$wall==0?'d2_0':($user['tribe']==2?'d2_12':($user['tribe']==3?'d2_1':'d2_11')); ?>
<div id="content" class="village2" style="padding:0">
<div id="village_map" class="<?php echo $wallType; ?>" style="margin:0 auto;transform:scale(.9);transform-origin:top">
<?php for($b=1;$b<21;$b++){ $gid=$fdata['f'.($b+18).'t']; echo $gid>0?'<img src="../img/x.gif" class="building d'.$b.' g'.$gid.'">':'<img src="../img/x.gif" class="building d'.$b.' iso">'; }
echo $fdata['f39t']>0?'<img src="../img/x.gif" class="dx1 g16">':'<img src="../img/x.gif" class="dx1 g16e">';
if($WW==40){$l=$fdata['f99'];$c='g40';if($l>19)$c='g40_1';if($l>39)$c='g40_2';if($l>59)$c='g40_3';if($l>79)$c='g40_4';if($l>99)$c='g40_5';echo '<img class="ww '.$c.'" src="img/x.gif">';} ?>
<div id="levels" class="on"><?php for($b=1;$b<21;$b++){ $lv=$fdata['f'.($b+18)]; if($lv>0)echo'<div class="d'.$b.'">'.$lv.'</div>'; } if($fdata['f39t']>0)echo'<div class="l39">'.$fdata['f39'].'</div>'; if($wall>0)echo'<div class="l40">'.$fdata['f40'].'</div>'; if($WW>0)echo'<div class="d40">'.$fdata['f99'].'</div>'; ?></div>
</div>
</div>
</div>
<br />
<div id="content" class="village1" style="min-height: 264px;">
<div id="village_map" class="f<?php echo $database->getVillageType($village['wref']); ?>" style="float: left;">
<?php
for($f = 1; $f < 19; $f++)
{
$gid = $fdata['f'.($f).'t'];
$level = $fdata['f'.($f)];
echo "<img src=\"../img/x.gif\" class=\"reslevel rf".$f." level".$level."\">";
}
?>
</div>
</div>
</div>
<br />
</div>
</div>
<br /><br />
<?php
$WWLevel = $fdata['f99t'];
$wallLevel = $fdata['f40t'];
if($wallLevel == 0) $wallType = "d2_0";
else
{
switch($user['tribe']){
case 1:
case 5:
default: $wallType = "d2_11"; break;
case 2: $wallType = "d2_12"; break;
case 3: $wallType = "d2_1"; break;
}
}
?>
<div id="content" class="village2">
<h1><?php echo $village['name']; ?></h1>
<div id="village_map" class="<?php echo $wallType; ?>">
<?php
for($b =1; $b < 21; $b++){
$gid = $fdata['f'.($b + 18).'t'];
if($gid >0) echo "<img src=\"../img/x.gif\" class=\"building d".$b." g".$gid."\">";
elseif($gid == 0) echo "<img src=\"../img/x.gif\" class=\"building d".$b." iso\">";
}
$rp = 16;
$rplevel = $fdata['f'.$rp];
if($rplevel > 0) echo "<img src=\"../img/x.gif\" class=\"dx1 g16\">";
elseif($rplevel == 0) echo "<img src=\"../img/x.gif\" class=\"dx1 g16e\">";
$resourcearray = $database->getResourceLevel($village['wref']);
if($resourcearray['f99t'] == 40) {
if($resourcearray['f99'] >= 0 && $resourcearray['f99'] <= 19) {
echo '<img class="ww g40" src="img/x.gif" alt="Worldwonder">';
}
elseif($resourcearray['f99'] >= 20 && $resourcearray['f99'] <= 39) {
echo '<img class="ww g40_1" src="img/x.gif" alt="Worldwonder">';
}
elseif($resourcearray['f99'] >= 40 && $resourcearray['f99'] <= 59) {
echo '<img class="ww g40_2" src="img/x.gif" alt="Worldwonder">';
}
elseif($resourcearray['f99'] >= 60 && $resourcearray['f99'] <= 79) {
echo '<img class="ww g40_3" src="img/x.gif" alt="Worldwonder">';
}
elseif($resourcearray['f99'] >= 80 && $resourcearray['f99'] <= 99) {
echo '<img class="ww g40_4" src="img/x.gif" alt="Worldwonder">';
}
elseif($resourcearray['f99'] == 100) {
echo '<img class="ww g40_5" src="img/x.gif" alt="Worldwonder">';
}
}
?>
<div id="levels" class="on">
<?php
for($b = 1; $b < 21; $b++){
$level = $fdata['f'.($b + 18)];
if($level > 0) echo "<div class=\"d$b\">$level</div>";
}
if($rplevel > 0) echo "<div class=\"l39\">".$fdata['f39']."</div>";
if($wallLevel > 0) echo "<div class=\"l40\">".$fdata['f40']."</div>";
if($WWLevel > 0) echo "<div class=\"d40\">".$fdata['f99']."</div>";
?>
</div>
</div>
</div>
</form><?php
}
else
{
include("404.tpl");
}
?>
</div>
<?php } else { include("404.tpl"); } ?>
+3 -5
View File
@@ -28,20 +28,18 @@ $totalpop = 0;
foreach($varray as $vil) $totalpop += $vil['pop'];
?>
<style>
#member.search-modern{border-collapse:separate;border-spacing:0;background:#fff;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.04);margin-bottom:12px}
#member.search-modern{width:100%;border-collapse:separate;border-spacing:0;background:#fff;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.04);margin-bottom:12px}
#member.search-modern th{background:linear-gradient(135deg,#0f172a,#334155);color:#fff;padding:10px 12px;font-weight:600;text-align:left;font-size:13px}
#member.search-modern th font{color:#fca5a5 !important;font-weight:500}
.s-info-wrap{display:grid;grid-template-columns:1fr 1fr;gap:12px;max-width:100%;margin:0 auto 15px}
.s-card{background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:12px 14px;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.s-info-wrap{display:flex;flex-direction:column;gap:10px;width:100%;margin:0 0 12px}
.s-card{width:100%;background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:12px 14px;box-shadow:0 1px 3px rgba(0,0,0,.04);box-sizing:border-box}
.s-card-title{font-size:11px;text-transform:uppercase;color:#64748b;letter-spacing:.5px;margin-bottom:4px;font-weight:600}
.s-card-main{font-size:14px;font-weight:600;color:#0f172a}
.s-card-main a{color:#2563eb;text-decoration:none}
.s-card-main a:hover{text-decoration:underline}
.s-card-sub{font-size:12px;color:#475569;margin-top:3px}
.s-card-sub b{color:#334155;font-weight:600}
@media(max-width:700px){.s-info-wrap{grid-template-columns:1fr}}
</style>
<form action="" method="post">
+8 -8
View File
@@ -23,15 +23,15 @@ $tribe = (int)$user['tribe'];
$img = $tribe==1 ? "" : $tribe-1;
?>
<style>
.upg-modern{font-family:system-ui;background:#fff;border:1px solid #e5e7eb;border-top:0}
.upg-modern{font-family:system-ui;background:#fff;border:0} /* scos border dublu */
.upg-head{display:grid;grid-template-columns:1fr 1fr;background:#f8fafc;border-bottom:1px solid #e5e7eb}
.upg-head div{padding:6px;text-align:center;font-size:12px;font-weight:600;color:#475569;text-transform:uppercase}
.upg-icons{display:grid;grid-template-columns:repeat(16,1fr);gap:0;background:#fff;padding:6px 4px;border-bottom:1px solid #f1f5f9}
.upg-icons img{width:20px;height:20px;margin:0 auto;display:block;image-rendering:pixelated}
.upg-levels{display:grid;grid-template-columns:repeat(16,1fr);gap:0;padding:4px;background:#fff}
.upg-levels div{text-align:center;font-size:12px;font-weight:600;padding:3px 0;color:#0f172a}
.upg-levels div.zero{color:#cbd5e1}
.upg-foot{display:flex;justify-content:space-between;padding:6px 8px;background:#f8fafc;font-size:12.5px}
.upg-head div{padding:6px;text-align:center;font-size:12px;font-weight:600;color:#475569;text-transform:uppercase;letter-spacing:.3px}
.upg-icons{display:grid;grid-template-columns:repeat(16,1fr);gap:0;background:#fff;padding:8px 4px}
.upg-icons img{width:16px;height:16px;margin:0 auto;display:block} /* ORIGINAL, nu 20px */
.upg-levels{display:grid;grid-template-columns:repeat(16,1fr);gap:0;padding:2px 0 6px;background:#fff}
.upg-levels div{text-align:center;font-size:12px;font-weight:600;padding:2px 0;color:#0f172a}
.upg-levels div.zero{color:#cbd5e1;font-weight:500}
.upg-foot{display:flex;justify-content:space-between;padding:8px 2px 2px;background:#fff;font-size:12.5px;border-top:1px solid #f1f5f9}
.upg-foot a{color:#16a34a;text-decoration:none;font-weight:500}
.upg-foot a:hover{text-decoration:underline}
</style>
+3 -2
View File
@@ -26,7 +26,7 @@ $heroCount = $hero ? 1 : 0;
?>
<style>
.troops-modern{font-family:system-ui}
.troops-grid{display:grid;grid-template-columns:repeat(11,1fr);gap:4px;padding:6px;background:#fff}
.troops-grid{display:grid;grid-template-columns:repeat(11,1fr);gap:4px;padding:4px 2px;background:#fff}
.troop-item{text-align:center;padding:4px 2px;border:1px solid #f1f5f9;border-radius:6px;background:#fcfdff}
.troop-item:hover{background:#f8fafc}
.troop-item img, .troop-item svg{width:18px;height:18px;margin:0 auto 2px;display:block}
@@ -34,8 +34,9 @@ $heroCount = $hero ? 1 : 0;
.troop-num.zero{color:#cbd5e1}
.troop-num.has{color:#0f172a}
.troop-hero{background:#fffbeb!important;border-color:#fde68a!important}
.troops-foot{display:flex;justify-content:space-between;padding:6px 8px;background:#f8fafc;border-top:1px solid #e5e7eb;font-size:12px}
.troops-foot{display:flex;justify-content:space-between;padding:8px 2px 2px;background:transparent;font-size:12px} /* FIX: scos background și border */
.troops-foot a{color:#2563eb;text-decoration:none;font-weight:500;display:flex;gap:4px;align-items:center}
.troops-foot a:hover{text-decoration:underline}
</style>
<div class="troops-modern">
+26 -26
View File
@@ -112,21 +112,20 @@ if(isset($id)){
<div class="village-page">
<div class="vgrid">
<div>
<div class="vcard">
<div class="vhead">Village Information</div>
<table class="vtable">
<tr><td class="label">Owner</td><td><a href="admin.php?p=player&uid=<?php echo $village['owner']; ?>" style="color:#2563eb;font-weight:600"><?php echo $user['username']; ?></a></td>
<td style="text-align:right">
<form action="../GameEngine/Admin/Mods/editVillageOwner.php" method="POST" style="display:flex;gap:4px;align-items:center;justify-content:flex-end">
<input type="hidden" name="did" value="<?php echo $_GET['did']; ?>">
<input type="hidden" name="admid" value="<?php echo $_SESSION['id']; ?>">
<input class="input-mini" type="text" name="newowner" value="<?php echo $user['id']; ?>" style="width:65px">
<button class="btn-icon" title="Change"><?php echo $svgEdit; ?></button>
</form>
</td>
</tr>
<!-- 1. VILLAGE INFORMATION - FULL WIDTH -->
<div class="vcard">
<div class="vhead">Village Information</div>
<table class="vtable">
<tr><td class="label">Owner</td><td><a href="admin.php?p=player&uid=<?php echo $village['owner']; ?>" style="color:#2563eb;font-weight:600"><?php echo $user['username']; ?></a></td>
<td style="text-align:right">
<form action="../GameEngine/Admin/Mods/editVillageOwner.php" method="POST" style="display:flex;gap:4px;align-items:center;justify-content:flex-end">
<input type="hidden" name="did" value="<?php echo $_GET['did']; ?>">
<input type="hidden" name="admid" value="<?php echo $_SESSION['id']; ?>">
<input class="input-mini" type="text" name="newowner" value="<?php echo $user['id']; ?>" style="width:65px">
<button class="btn-icon" title="Change"><?php echo $svgEdit; ?></button>
</form>
</td>
</tr>
<tr><td class="label">Name</td><td colspan="2">
<form action="../GameEngine/Admin/Mods/renameVillage.php" method="POST" style="display:flex;gap:4px">
<input type="hidden" name="did" value="<?php echo $_GET['did']; ?>">
@@ -141,16 +140,17 @@ if(isset($id)){
<tr><td class="label">Field</td><td colspan="2" class="badge-field"><?php for ($i = 0; $i <= 3; $i++){ $a = $i + 1; echo $typ[$i].'x <img src="../img/admin/r/'.$a.'.gif">'.($i!=3?' | ':''); } ?></td></tr>
</table>
</div>
<div class="vcard">
<div class="vhead">Resources <a href="admin.php?p=editResources&did=<?php echo $_GET['did']; ?>"><?php echo $svgEdit; ?></a></div>
<table class="vtable" style="text-align:center">
<tr style="background:#f8fafc;font-size:11px;color:#64748b"><td style="text-align:left">Res</td><td>Amt</td><td>Cap</td><td>Prod</td></tr>
<tr><td style="text-align:left" class="res-icon"><img src="../img/admin/r/1.gif"> Wood</td><td><?php echo floor($village['wood']); ?></td><td rowspan="3"><?php echo $village['maxstore'];?></td><td><?php echo $production['wood'];?></td></tr>
<tr><td style="text-align:left" class="res-icon"><img src="../img/admin/r/2.gif"> Clay</td><td><?php echo floor($village['clay']); ?></td><td><?php echo $production['clay'];?></td></tr>
<tr><td style="text-align:left" class="res-icon"><img src="../img/admin/r/3.gif"> Iron</td><td><?php echo floor($village['iron']); ?></td><td><?php echo $production['iron'];?></td></tr>
<tr><td style="text-align:left" class="res-icon"><img src="../img/admin/r/4.gif"> Crop</td><td><?php echo floor($village['crop']); ?></td><td><?php echo $village['maxcrop'];?></td><td><?php echo $production['crop'];?></td></tr>
</table>
</div>
<!-- 2. RESOURCES - FULL WIDTH -->
<div class="vcard">
<div class="vhead">Resources <a href="admin.php?p=editResources&did=<?php echo $_GET['did']; ?>"><?php echo $svgEdit; ?></a></div>
<table class="vtable" style="text-align:center">
<tr style="background:#f8fafc;font-size:11px;color:#64748b"><td style="text-align:left">Res</td><td>Amt</td><td>Cap</td><td>Prod</td></tr>
<tr><td style="text-align:left"><img src="../img/admin/r/1.gif"> Wood</td><td><?php echo floor($village['wood']); ?></td><td rowspan="3"><?php echo $village['maxstore'];?></td><td><?php echo $production['wood'];?></td></tr>
<tr><td style="text-align:left"><img src="../img/admin/r/2.gif"> Clay</td><td><?php echo floor($village['clay']); ?></td><td><?php echo $production['clay'];?></td></tr>
<tr><td style="text-align:left"><img src="../img/admin/r/3.gif"> Iron</td><td><?php echo floor($village['iron']); ?></td><td><?php echo $production['iron'];?></td></tr>
<tr><td style="text-align:left"><img src="../img/admin/r/4.gif"> Crop</td><td><?php echo floor($village['crop']); ?></td><td><?php echo $village['maxcrop'];?></td><td><?php echo $production['crop'];?></td></tr>
</table>
</div>
</div>
<div>
<div class="vcard">
@@ -186,7 +186,7 @@ if(isset($id)){
</div>
</a>
</div>
</br>
<div class="map-card">
<h3>Village Center - <?php echo $village['name']; ?></h3>
<?php $WWLevel = $fdata['f99t']; $wallLevel = $fdata['f40t']; if($wallLevel == 0) $wallType = "d2_0"; else { switch($user['tribe']){ case 1: case 5: default: $wallType = "d2_11"; break; case 2: $wallType = "d2_12"; break; case 3: $wallType = "d2_1"; break; } } ?>
+91
View File
@@ -0,0 +1,91 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename delAli.php ##
## Type BACKEND ##
## Developed by: Shadow (după model editUser) ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
#################################################################################
if (!isset($_SESSION)) {
session_start();
}
if (empty($_SESSION['access']) || $_SESSION['access'] < 9) {
die("Access Denied: You are not Admin!");
}
include_once("../../config.php");
// ---------------------------------------------------------------------------
// Autoloader path - la fel ca în editUser.php
// ---------------------------------------------------------------------------
$autoprefix = '';
for ($i = 0; $i < 5; $i++) {
$autoprefix = str_repeat('../', $i);
if (file_exists($autoprefix . 'autoloader.php')) {
break;
}
}
include_once($autoprefix . "GameEngine/Database.php");
// ---------------------------------------------------------------------------
// Input
// ---------------------------------------------------------------------------
$aid = (int)($_POST['aid'] ?? 0);
$admid = (int)($_POST['admid'] ?? 0);
if ($aid <= 0 || $admid <= 0) {
header("Location: ../../../Admin/admin.php?p=alliance&aid=0&e=bad");
exit;
}
// ---------------------------------------------------------------------------
// Verificare admin
// ---------------------------------------------------------------------------
$admin = $database->getUserArray($admid, 1);
if (!$admin || (int)$admin['access'] !== 9) {
die('<h1><font color="red">Access Denied: You are not Admin!</font></h1>');
}
// ---------------------------------------------------------------------------
// 1. Scoate toți membrii
// ---------------------------------------------------------------------------
$database->query("UPDATE " . TB_PREFIX . "users SET alliance = 0 WHERE alliance = $aid");
// ---------------------------------------------------------------------------
// 2. Șterge structura alianței
// ---------------------------------------------------------------------------
$database->query("DELETE FROM " . TB_PREFIX . "alidata WHERE id = $aid");
$database->query("DELETE FROM " . TB_PREFIX . "ali_permission WHERE alliance = $aid");
$database->query("DELETE FROM " . TB_PREFIX . "ali_invite WHERE alliance = $aid");
$database->query("DELETE FROM " . TB_PREFIX . "ali_log WHERE aid = $aid");
// ---------------------------------------------------------------------------
// 3. Șterge diplomația
// ---------------------------------------------------------------------------
$database->query("DELETE FROM " . TB_PREFIX . "diplomacy WHERE alli1 = $aid OR alli2 = $aid");
// ---------------------------------------------------------------------------
// 4. Șterge forumul
// ---------------------------------------------------------------------------
$database->query("DELETE FROM " . TB_PREFIX . "forum_cat WHERE alliance = $aid");
$database->query("DELETE FROM " . TB_PREFIX . "forum_topic WHERE alliance = $aid");
$database->query("DELETE FROM " . TB_PREFIX . "forum_post WHERE alliance = $aid");
// ---------------------------------------------------------------------------
// Log admin - aceeași structură ca editUser
// ---------------------------------------------------------------------------
$time = time();
$logText = "Deleted alliance ID $aid";
$logEsc = $database->escape($logText);
$database->query(
"INSERT INTO " . TB_PREFIX . "admin_log (`id`, `user`, `log`, `time`) " .
"VALUES (0, '$admid', '$logEsc', $time)"
);
header("Location: ../../../Admin/admin.php?p=search&delali=1");
exit;
?>
+72 -34
View File
@@ -1,53 +1,91 @@
<?php
#################################################################################
## editAli.php - Backend pentru editAli.tpl ##
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editAli.php ##
## Type BACKEND ##
## Developed by: Shadow (după model editUser) ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2025. All rights reserved. ##
#################################################################################
if (!isset($_SESSION)) {
session_start();
}
if (empty($_SESSION['access']) || $_SESSION['access'] < 9) {
die("Access Denied: You are not Admin!");
}
include_once("../../config.php");
include_once("../../Session.php");
include_once("../../Database.php");
$session = new Session();
$database = new Database();
// ---------------------------------------------------------------------------
// Autoloader path - la fel ca în editUser.php
// ---------------------------------------------------------------------------
$autoprefix = '';
for ($i = 0; $i < 5; $i++) {
$autoprefix = str_repeat('../', $i);
if (file_exists($autoprefix . 'autoloader.php')) {
break;
}
}
include_once($autoprefix . "GameEngine/Database.php");
// doar admini
if(!$session->isAdmin()){
header("Location: ../../../Admin/admin.php");
// ---------------------------------------------------------------------------
// Input
// ---------------------------------------------------------------------------
$admid = (int)($_POST['admid'] ?? 0);
$aid = (int)($_POST['aid'] ?? 0);
if ($aid <= 0 || $admid <= 0) {
header("Location: ../../../Admin/admin.php?p=alliance&aid=$aid&e=bad");
exit;
}
$aid = (int)($_POST['aid'] ?? 0);
$admid = (int)($_POST['admid'] ?? 0);
// verificare sesiune
if($admid != $session->uid || $aid <= 0){
die("Access denied");
// ---------------------------------------------------------------------------
// Verificare admin - la fel ca editUser
// ---------------------------------------------------------------------------
$admin = $database->getUserArray($admid, 1);
if (!$admin || (int)$admin['access'] !== 9) {
die('<h1><font color="red">Access Denied: You are not Admin!</font></h1>');
}
$tag = $database->escape(substr(trim($_POST['tag']), 0, 8));
$name = $database->escape(substr(trim($_POST['name']), 0, 25));
$leader = (int)$_POST['leader'];
$max = (int)$_POST['max'];
if($max < 3) $max = 3;
if($max > 60) $max = 60;
// ---------------------------------------------------------------------------
// Câmpuri
// ---------------------------------------------------------------------------
$tag = $database->escape(substr(trim($_POST['tag'] ?? ''), 0, 8));
$name = $database->escape(substr(trim($_POST['name'] ?? ''), 0, 25));
$leader = (int)($_POST['leader'] ?? 0);
$max = (int)($_POST['max'] ?? 0);
$max = max(3, min(60, $max));
$notice = $database->escape($_POST['notice'] ?? '');
$desc = $database->escape($_POST['desc'] ?? '');
$notice = $database->escape($_POST['notice']);
$desc = $database->escape($_POST['desc']);
// ---------------------------------------------------------------------------
// Update
// ---------------------------------------------------------------------------
$database->query(
"UPDATE " . TB_PREFIX . "alidata SET
tag = '$tag',
name = '$name',
leader = $leader,
`max` = $max,
notice = '$notice',
`desc` = '$desc'
WHERE id = $aid"
);
// update alidata
$database->query("UPDATE ".TB_PREFIX."alidata SET
tag = '$tag',
name = '$name',
leader = $leader,
`max` = $max,
notice = '$notice',
`desc` = '$desc'
WHERE id = $aid");
// ---------------------------------------------------------------------------
// Log admin - aceeași structură ca editUser
// ---------------------------------------------------------------------------
$time = time();
$logText = "Edited alliance <a href='admin.php?p=alliance&aid=$aid'>$tag</a>";
$logEsc = $database->escape($logText);
// log admin
$database->query("INSERT INTO ".TB_PREFIX."admin_log (uid, action, time) VALUES ($admid, 'Edited alliance $aid ($tag)', ".time().")");
$database->query(
"INSERT INTO " . TB_PREFIX . "admin_log (`id`, `user`, `log`, `time`) " .
"VALUES (0, '$admid', '$logEsc', $time)"
);
// redirect inapoi
header("Location: ../../../Admin/admin.php?p=alliance&aid=$aid&edited=1");
exit;
?>