add views & comments icons

This commit is contained in:
themohooks 2024-07-17 04:08:57 +03:00
parent 696be3a0b3
commit f916e1aee2
5 changed files with 13 additions and 3 deletions

View file

@ -234,7 +234,7 @@ a.prw { display:inline-block; position:relative; }
.sec-overlay { position:absolute; left:0; right:0; top:0; bottom:0; z-index:1; background:url('/img/stripes_w.png'); } .sec-overlay { position:absolute; left:0; right:0; top:0; bottom:0; z-index:1; background:url('/img/stripes_w.png'); }
.con-overlay { position:absolute; left:0; right:0; top:0; bottom:0; z-index:1; background:url('/img/questions_bg.png'); } .con-overlay { position:absolute; left:0; right:0; top:0; bottom:0; z-index:1; background:url('/img/questions_bg.png'); }
.com-icon { background:url('/img/comment.svg') no-repeat; display:inline-block; padding-left:18px; } .com-icon { background:url('/static/img/comment.svg') no-repeat; display:inline-block; padding-left:18px; }
.eye-icon { background:url('/static/img/eye.svg') no-repeat; display:inline-block; padding-left:20px; margin-left:10px; } .eye-icon { background:url('/static/img/eye.svg') no-repeat; display:inline-block; padding-left:20px; margin-left:10px; }
.hpshade, .hdshade { position:absolute; z-index:2; bottom:0; text-align:right; box-sizing:border-box; margin:-22px auto 0; width:250px; height:22px; padding:4px 5px 0 0; color:#fff; background:linear-gradient(to top,rgba(0,0,0,.5),transparent); } .hpshade, .hdshade { position:absolute; z-index:2; bottom:0; text-align:right; box-sizing:border-box; margin:-22px auto 0; width:250px; height:22px; padding:4px 5px 0 0; color:#fff; background:linear-gradient(to top,rgba(0,0,0,.5),transparent); }

1
static/img/comment.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path fill="white" d="M256 32C114.6 32 0 125.1 0 240c0 47.6 19.9 91.2 52.9 126.3C38 405.7 7 439.1 6.5 439.5c-6.6 7-8.4 17.2-4.6 26S14.4 480 24 480c61.5 0 110-25.7 139.1-46.3C192 442.8 223.2 448 256 448c141.4 0 256-93.1 256-208S397.4 32 256 32zm0 368c-26.7 0-53.1-4.1-78.4-12.1l-22.7-7.2-19.5 13.8c-14.3 10.1-33.9 21.4-57.5 29 7.3-12.1 14.4-25.7 19.9-40.2l10.6-28.1-20.6-21.8C69.7 314.1 48 282.2 48 240c0-88.2 93.3-160 208-160s208 71.8 208 160-93.3 160-208 160z"/></svg>

After

Width:  |  Height:  |  Size: 711 B

View file

@ -27,7 +27,8 @@ use \App\Models\User;
<h4><img src="/static/img/go-home.png">Общая информация</h4> <h4><img src="/static/img/go-home.png">Общая информация</h4>
<ul class="straight"> <ul class="straight">
<li>Зарегистрировано пользователей: <b><?=DB::query('SELECT COUNT(*) FROM users')[0]['COUNT(*)'];?></b></li> <li>Зарегистрировано пользователей: <b><?=DB::query('SELECT COUNT(*) FROM users')[0]['COUNT(*)'];?></b></li>
<li>Опубликовано фотографий: <b><?=DB::query('SELECT COUNT(*) FROM photos')[0]['COUNT(*)'];?></b></li> <li>Опубликовано фотографий: <b><?=DB::query('SELECT COUNT(*) FROM photos WHERE moderated=1')[0]['COUNT(*)'];?></b></li>
<li>Пользователей онлайн: <b><?=DB::query('SELECT COUNT(*) FROM users WHERE online>=:time-300 ORDER BY online DESC', array(':time'=>time()))[0]['COUNT(*)'];?></b></li>
</ul> </ul>
</div> </div>
<div class="p20"> <div class="p20">

View file

@ -49,6 +49,8 @@ use \App\Models\User;
foreach ($photos as $p) { foreach ($photos as $p) {
if ($p['moderated'] === 0) { if ($p['moderated'] === 0) {
$color = 's0'; $color = 's0';
} else if ($p['moderated'] === 2) {
$color = 's15';
} else { } else {
$color = 's12'; $color = 's12';
} }

View file

@ -28,7 +28,13 @@ use App\Services\{Router, Auth, DB, Date};
<tbody> <tbody>
<tr> <tr>
<td class="pb_photo" id="p1936120"><a href="/photo/'.$p['id'].'" target="_blank" class="prw"><img class="f" src="'.$p['photourl'].'"> <td class="pb_photo" id="p1936120"><a href="/photo/'.$p['id'].'" target="_blank" class="prw"><img class="f" src="'.$p['photourl'].'">
<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>
</a></td> </a></td>
<td class="pb_descr"> <td class="pb_descr">