Отображение эффектов уехало в класс UserInfo. #1
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace Battles;
|
||||
use Battles\Database\DBPDO;
|
||||
use Battles\Models\EffectsModel;
|
||||
|
||||
class UserInfo extends UserStats
|
||||
@@ -206,4 +207,22 @@ INFO;
|
||||
echo '</div><!-- user-info-container -->';
|
||||
}
|
||||
|
||||
public function showUserEffects(): string
|
||||
{
|
||||
$effs = DBPDO::INIT()->ofetchAll('SELECT * FROM users_effects WHERE owner_id = ?', $this->id);
|
||||
$img = UserEffects::$effectImage;
|
||||
$r = '';
|
||||
foreach ($effs as $effect) {
|
||||
$timeleft = timeOut($effect->remaining_time - time());
|
||||
$r .= "
|
||||
<div>
|
||||
<img class='image' src='/i/{$img[$effect->type]}' alt='{$effect->name}'>
|
||||
<span class='title'>{$effect->name}</span>
|
||||
<div class='timeleft'>$timeleft</div>
|
||||
</div>
|
||||
";
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user