From f1dfb968649589c16ae9fc2475f82b4e5c149beb Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Sun, 6 Oct 2024 01:08:10 +0300 Subject: [PATCH] feed page --- app/Controllers/MainController.php | 5 ++ app/Core/Routes.php | 1 + views/components/Navbar.php | 2 +- views/pages/Feed.php | 99 ++++++++++++++++++++++++++++++ 4 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 views/pages/Feed.php diff --git a/app/Controllers/MainController.php b/app/Controllers/MainController.php index 4cf8cf9..01979ee 100644 --- a/app/Controllers/MainController.php +++ b/app/Controllers/MainController.php @@ -52,6 +52,11 @@ class MainController { Page::set('Vehicle'); + } + public static function feed() + { + Page::set('Feed'); + } public static function favauthors() { diff --git a/app/Core/Routes.php b/app/Core/Routes.php index d2bd5eb..026b6f5 100644 --- a/app/Core/Routes.php +++ b/app/Core/Routes.php @@ -26,6 +26,7 @@ class Routes Router::get('/rules/pub', 'MainController@publicationRules'); Router::get('/rules/photo', 'MainController@photoRules'); Router::get('/rules/video', 'MainController@videoRules'); + Router::get('/feed', 'MainController@feed'); Router::get('/update', 'MainController@update'); Router::get('/top30', 'MainController@top30'); Router::get('/photoext', 'PhotoController@photoext'); diff --git a/views/components/Navbar.php b/views/components/Navbar.php index b5fa4f3..13e715b 100644 --- a/views/components/Navbar.php +++ b/views/components/Navbar.php @@ -50,7 +50,7 @@ if ($noncheckedimgs > 0) {
diff --git a/views/pages/Feed.php b/views/pages/Feed.php new file mode 100644 index 0000000..84d10c8 --- /dev/null +++ b/views/pages/Feed.php @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+

Лента обновлений

+ +
Показаны последние 100 фотографий

+
+ + + + + + + +
'.Date::zmdate($p['timeupload']).'598 КБ +
+
'.DB::query('SELECT COUNT(*) FROM photos_views WHERE photo_id=:id', array(':id'=>$p['id']))[0]['COUNT(*)'].'
+
+
+

'.htmlspecialchars($p['postbody']).'

+

'.htmlspecialchars($p['place']).'

+

'.Date::zmdate($p['posted_at']).'
Автор: '.$user->i('username').'

+
+
'; + } + ?> + + + +
+
+ + + + \ No newline at end of file