nativegallery-weryskok/views/pages/Search.php

58 lines
2.6 KiB
PHP
Raw Normal View History

2024-07-08 23:01:54 +03:00
<?php
use App\Services\{Router, Auth, DB, Date};
?>
<html lang="ru">
<head>
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/LoadHead.php'); ?>
</head>
<body>
<div id="backgr"></div>
<table class="tmain">
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?>
<tr>
<td class="main">
<h1>Результаты поиска</h1>
<div>Найдено изображений: <b><?=DB::query('SELECT COUNT(*) FROM photos WHERE user_id=:uid AND moderated=1 ORDER BY id DESC', array(':uid'=>$_GET['id']))[0]['COUNT(*)']?></b> &nbsp;·&nbsp; <a href="#sf">Новый поиск</a></div><br>
2024-07-08 23:01:54 +03:00
<?php
$photos = DB::query('SELECT * FROM photos WHERE user_id=:uid AND moderated=1 ORDER BY id DESC', array(':uid'=>$_GET['id']));
2024-07-08 23:01:54 +03:00
foreach ($photos as $p) {
2024-07-08 23:06:32 +03:00
echo '<div class="p20p">
2024-07-08 23:01:54 +03:00
<table>
<tbody>
<tr>
<td class="pb_photo" id="p1936120"><a href="/photo/'.$p['id'].'" target="_blank" class="prw"><img class="f" src="'.$p['photourl'].'">
2024-07-17 04:08:57 +03:00
<div class="hpshade">
';
if (DB::query('SELECT COUNT(*) FROM photos_comments WHERE photo_id=:id', array(':id'=>$p['id']))[0]['COUNT(*)'] >= 1) {
echo '<div class="com-icon">'.DB::query('SELECT COUNT(*) FROM photos_comments WHERE photo_id=:id', array(':id'=>$p['id']))[0]['COUNT(*)'].'</div>';
}
echo '
<div class="eye-icon">'.DB::query('SELECT COUNT(*) FROM photos_views WHERE photo_id=:id', array(':id'=>$p['id']))[0]['COUNT(*)'].'</div></div>
2024-07-08 23:01:54 +03:00
</a></td>
<td class="pb_descr">
2024-07-10 13:23:05 +03:00
<p><b class="pw-place">'.htmlspecialchars($p['place']).'</b></p>
<span class="pw-descr">'.htmlspecialchars($p['postbody']).'</span>
<p class="sm"><b>'.Date::zmdate($p['timeupload']).'</b><br>Автор: <a href="/author/'.$p['user_id'].'/">'.htmlspecialchars($p['username']).'</a></p>
2024-07-08 23:01:54 +03:00
</td>
</tr>
</tbody>
</table>
</div>';
}
?>
</tbody>
</table>
</body>
</html>