Проверка на отсутствие картинки склонности\клана.

This commit is contained in:
Igor Barkov (iwork) 2022-01-25 18:37:12 +02:00
parent cd80c56f93
commit 6b878f4ef9

View File

@ -129,9 +129,25 @@ class UserInfo extends UserStats
$this->bankMoney; $this->bankMoney;
} }
$nameString = null; $nameString = null;
$nameString .= $this->align ? "<img src='/i/align_$this->align.png' alt='Склонность'>" : ""; if ($this->align) {
if (file_exists("/i/align_$this->align.png")) {
$nameString .= "<img src='/i/align_$this->align.png' alt='Склонность'>";
} else {
$nameString .= "<svg width=16 height=16><circle cx=8 cy=8 r=6 stroke=darkorange stroke-width=1 fill=orange></circle></svg>";
}
} else {
$nameString .= "";
}
$nameString .= $this->block ? "<span class='private' style='text-decoration: line-through;'>$this->login</span>" : "<b>$this->login</b>"; $nameString .= $this->block ? "<span class='private' style='text-decoration: line-through;'>$this->login</span>" : "<b>$this->login</b>";
$nameString .= $this->clan ? "<img src='/i/clan/$this->clan.png' alt='Клан'>" : ""; if ($this->clan) {
if (file_exists("/i/clan/$this->clan.png")) {
$nameString .= "<img src='/i/clan/$this->clan.png' alt='Клан'>";
} else {
$nameString .= "<svg width=16 height=16><circle cx=8 cy=8 r=6 stroke=darkred stroke-width=1 fill=red></circle></svg>";
}
} else {
$nameString .= "";
}
echo <<<HTML echo <<<HTML
<div class="user-info"> <div class="user-info">