Skip to content

Commit

Permalink
Fix #131
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Jul 6, 2020
1 parent dc536f0 commit fcff820
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions system/pages/houses.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,20 @@
if($type == 'guildhalls' && !$db->hasColumn('houses', 'guild'))
$type = 'all';

if(!empty($type) && $type != 'all')
$whereby .= ' AND `guild` ' . ($type == 'guildhalls' ? '!' : '') . '= 0';
if (!empty($type) && $type != 'all')
{
$guildColumn = '';
if ($db->hasColumn('houses', 'guild')) {
$guildColumn = 'guild';
}
else if ($db->hasColumn('houses', 'guildid')) {
$guildColumn = 'guildid';
}

if($guildColumn !== '') {
$whereby .= ' AND `' . $guildColumn . '` ' . ($type == 'guildhalls' ? '!' : '') . '= 0';
}
}

$houses_info = $db->query('SELECT * FROM `houses` WHERE ' . $whereby. ' ORDER BY ' . $orderby);

Expand Down

0 comments on commit fcff820

Please sign in to comment.