Перенос отображения подарков в класс.

This commit is contained in:
Igor Barkov (iwork)
2020-07-03 19:37:24 +03:00
parent 16a2b0e5da
commit 25a6f17d7e
2 changed files with 23 additions and 18 deletions

18
inf.php
View File

@@ -22,13 +22,6 @@ function private_access($uid)
return false;
}
//$presents = db::c()->query('SELECT img, sender FROM `users_presents` WHERE expiration_date >= "?s" AND owner = ?i', date('Y-m-d'), $user->id);
function getnumrows()
{
}
$presents = [];
if (empty($user->id)): ?>
<!doctype html>
<html lang="ru">
@@ -86,16 +79,7 @@ if (!empty($user->realname)) {
?>
<p style="font-family: Consolas,monospace;"><?= nl2br($user->info) ?></p>
<hr>
<?php if ($presents->getNumRows()): ?>
<div>
<legend>Подарки</legend>
<?php
while ($row = $presents->fetch_assoc()): ?>
<img src="<?= $row['img'] ?>" title="<?= $row['sender'] ?>" alt="<?= $row['sender'] ?>">
<?php endwhile; ?>
</div>
<?php endif; ?>
<?php $user->showPresents(); ?>
<?php
# Секретный раздел
# Если я любой паладин, и смотрю не админа, или я сам админ.