mirror of
https://github.com/WerySkok/nativegallery.git
synced 2024-11-14 19:19:15 +03:00
add Фотографии избранных авторов
This commit is contained in:
parent
005c93ae0e
commit
099bc1b2c5
5 changed files with 72 additions and 2 deletions
|
@ -36,6 +36,11 @@ class MainController
|
|||
{
|
||||
Page::set('Top30');
|
||||
|
||||
}
|
||||
public static function favauthors()
|
||||
{
|
||||
Page::set('FavAuthors');
|
||||
|
||||
}
|
||||
|
||||
public static function logout()
|
||||
|
|
|
@ -33,6 +33,8 @@ class Routes
|
|||
Router::get('/lk/history', 'ProfileController@lkhistory');
|
||||
Router::get('/lk/profile', 'ProfileController@lkprofile');
|
||||
|
||||
Router::get('/fav_authors', 'MainController@favauthors');
|
||||
|
||||
Router::get('/search', 'SearchController@i');
|
||||
|
||||
Router::post('/api/upload', 'ApiController@upload');
|
||||
|
|
|
@ -40,6 +40,7 @@ if (NGALLERY['root']['title'] != null && NGALLERY['root']['showtitle'] === true)
|
|||
<ul class="mm-level-2">
|
||||
<li><a href="/update.php?time=24" class="mm-item"><span class="mm-label">Новые фотографии</span></a></li>
|
||||
<li><a href="/feed.php" class="mm-item"><span class="mm-label">Лента обновлений</span></a></li>
|
||||
<li><a href="/fav_authors" class="mm-item"><span class="mm-label">Фотографии избранных авторов</span></a></li>
|
||||
<li><a href="/update.php" class="mm-item"><span class="mm-label">Архив обновлений по датам</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
62
views/pages/FavAuthors.php
Normal file
62
views/pages/FavAuthors.php
Normal file
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
use \App\Services\{Auth, DB, Date};
|
||||
use \App\Models\{User, Photo};
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<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>
|
||||
<?php
|
||||
$followimgs = DB::query('SELECT * FROM followers_notifications WHERE follower_id=:id', array(':id'=>Auth::userid()));
|
||||
foreach ($followimgs as $f) {
|
||||
$author = new User($p['user_id']);
|
||||
$p = new Photo($f['photo_id']);
|
||||
echo ' <div class="p20p">
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
<td class="pb_photo" id="p1941865"><a href="/photo/'.$f['photo_id'].'/" target="_blank" class="prw"><img class="f" src="'.$p['photourl'].'" alt="620 КБ">
|
||||
<div class="hpshade">
|
||||
<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>
|
||||
<td class="pb_descr">
|
||||
|
||||
<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/'.$author->i('user_id').'/">'.htmlspecialchars($author->i('username')).'</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Footer.php'); ?>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -251,10 +251,10 @@ if (DB::query('SELECT follower_id FROM followers WHERE user_id=:userid AND follo
|
|||
$class = 'on';
|
||||
}
|
||||
?>
|
||||
<div><div class="toggle <?=$class?>"><div class="handle"></div></div> <label class="toggle-label"><b>Подписка на новые фотографии этого автора</b> (подписаны: <b id="subscr_cnt"><?=DB::query('SELECT COUNT(*) FROM followers WHERE user_id=:uid', array(':uid'=>$userprofile->i('id')))[0]['COUNT(*)'];?></b>)</label></div>
|
||||
<div style="margin-top: 8px;"><div class="toggle <?=$class?>"><div class="handle"></div></div> <label class="toggle-label"><b>Подписка на новые фотографии этого автора</b> (подписаны: <b id="subscr_cnt"><?=DB::query('SELECT COUNT(*) FROM followers WHERE user_id=:uid', array(':uid'=>$userprofile->i('id')))[0]['COUNT(*)'];?></b>)</label></div>
|
||||
|
||||
<?php } else { ?>
|
||||
<div>Пользователей, подписанных на мои фотографии: <b><?=DB::query('SELECT COUNT(*) FROM followers WHERE user_id=:uid', array(':uid'=>$userprofile->i('id')))[0]['COUNT(*)'];?></b></div>
|
||||
<div style="margin-top: 8px;">Пользователей, подписанных на мои фотографии: <b><?=DB::query('SELECT COUNT(*) FROM followers WHERE user_id=:uid', array(':uid'=>$userprofile->i('id')))[0]['COUNT(*)'];?></b></div>
|
||||
<?php } ?>
|
||||
<?php } else { ?>
|
||||
<center><h1>Пользователь не найден</h1></center>
|
||||
|
|
Loading…
Reference in a new issue