Skip to content

Commit

Permalink
adding economy on castle
Browse files Browse the repository at this point in the history
adding economy on castle
  • Loading branch information
jowie authored and sanasol committed Nov 23, 2023
1 parent e6ca3bd commit 87c7b7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/castle/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
$castleNames = Flux::config('CastleNames')->toArray();
$ids = implode(',', array_fill(0, count($castleNames), '?'));

$sql = "SELECT castles.castle_id, castles.guild_id, guild.name AS guild_name, guild.emblem_id as emblem ";
$sql = "SELECT castles.castle_id, castles.guild_id, castles.economy, guild.name AS guild_name, guild.emblem_id as emblem ";
$sql .= "FROM {$server->charMapDatabase}.guild_castle AS castles ";
$sql .= "LEFT JOIN guild ON guild.guild_id = castles.guild_id ";
$sql .= "WHERE castles.castle_id IN ($ids)";
Expand All @@ -16,4 +16,4 @@

$castles = $sth->fetchAll();

?>
?>
4 changes: 4 additions & 0 deletions themes/default/castle/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<th>Castle ID</th>
<th>Castle</th>
<th colspan="2">Guild</th>
<th>Economy</th>
</tr>
<?php foreach ($castles as $castle): ?>
<tr>
Expand All @@ -18,8 +19,10 @@
<td>
<?php if ($auth->actionAllowed('guild', 'view') && $auth->allowedToViewGuild): ?>
<?php echo $this->linkToGuild($castle->guild_id, $castle->guild_name) ?>
<td><?php echo htmlspecialchars($castle->economy); ?></td>
<?php else: ?>
<?php echo htmlspecialchars($castle->guild_name) ?>

<?php endif ?>
</td>
<?php else: ?>
Expand All @@ -29,6 +32,7 @@
<td colspan="2"><span class="not-applicable"><?php echo htmlspecialchars(Flux::message('NoneLabel')) ?></span></td>
<?php endif ?>
</tr>

<?php endforeach ?>
</table>
<?php else: ?>
Expand Down

0 comments on commit 87c7b7c

Please sign in to comment.