Skip to content

Commit

Permalink
GH-139 Simplify conditions a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
mdziekon committed May 30, 2022
1 parent d11c399 commit b4c1efe
Showing 1 changed file with 14 additions and 21 deletions.
35 changes: 14 additions & 21 deletions fleet2.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,28 +355,21 @@
}
$_Lang['SetDefaultFreeStorage'] = prettyNumber($_Lang['freeStorage']);
$_Lang['ShowTargetPos'] = "<a href=\"galaxy.php?mode=3&galaxy={$Target['galaxy']}&system={$Target['system']}&planet={$Target['planet']}\" target=\"_blank\">[{$Target['galaxy']}:{$Target['system']}:{$Target['planet']}]</a><b class=\"".($Target['type'] == 1 ? 'planet' : ($Target['type'] == 3 ? 'moon' : 'debris'))."\"></b><br/>";
if(!empty($targetPlanetDetails['name']))
{
if($targetOwnerDetails['id'] > 0)
{
$_Lang['ShowTargetPos'] .= '<b class="orange">'.$targetPlanetDetails['name'].'</b>';
}
else
{
$_Lang['ShowTargetPos'] .= '<b class="red">'.$_Lang['fl2_target_abandoned_'.$Target['type']].'</b>';
}
}
else
{
if($Target['type'] == 2)
{
$_Lang['ShowTargetPos'] .= $_Lang['fl2_debrisfield'];
}
else
{
$_Lang['ShowTargetPos'] .= $_Lang['fl2_emptyplanet'];
}

if (!empty($targetPlanetDetails['name'])) {
$_Lang['ShowTargetPos'] .= (
($targetOwnerDetails['id'] > 0) ?
('<b class="orange">'.$targetPlanetDetails['name'].'</b>') :
('<b class="red">'.$_Lang['fl2_target_abandoned_'.$Target['type']].'</b>')
);
} else {
$_Lang['ShowTargetPos'] .= (
($Target['type'] == 2) ?
$_Lang['fl2_debrisfield'] :
$_Lang['fl2_emptyplanet']
);
}

if($targetOwnerDetails['id'] > 0)
{
$_Lang['ShowTargetOwner'] = "<a ".($targetInfo['isPlanetOwnerNonAggressiveAllianceMember'] ? 'class="skyblue"' : '')." href=\"profile.php?uid={$targetOwnerDetails['id']}\" target=\"_blank\">{$targetOwnerDetails['username']}</a>";
Expand Down

0 comments on commit b4c1efe

Please sign in to comment.