From dce7aa906a8a6daaac86943ee260e548b641eee9 Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Wed, 12 Feb 2025 16:58:20 +0300 Subject: [PATCH] comments.php --- app/Controllers/MainController.php | 5 + app/Core/Routes.php | 2 +- views/components/Navbar.php | 2 +- views/pages/Comments/Index.php | 167 +++++++++++++++++++++++++++++ 4 files changed, 174 insertions(+), 2 deletions(-) create mode 100644 views/pages/Comments/Index.php diff --git a/app/Controllers/MainController.php b/app/Controllers/MainController.php index d61b707..2e748ae 100644 --- a/app/Controllers/MainController.php +++ b/app/Controllers/MainController.php @@ -77,6 +77,11 @@ class MainController { Page::set('Errors/EmailVerify'); + } + public static function comments() + { + Page::set('Comments/Index'); + } public static function tour() { diff --git a/app/Core/Routes.php b/app/Core/Routes.php index 57b60c8..1114b69 100644 --- a/app/Core/Routes.php +++ b/app/Core/Routes.php @@ -38,7 +38,7 @@ class Routes Router::get('/article/$id', 'MainController@gallery'); Router::get('/voting', 'ContestsController@index'); Router::get('/voting/results', 'ContestsController@results'); - + Router::get('/comments', 'MainController@comments'); if (Auth::userid() > 0) { $user = new \App\Models\User(Auth::userid()); Router::get('/lk', 'ProfileController@lk'); diff --git a/views/components/Navbar.php b/views/components/Navbar.php index f57ab3e..7d1e4a3 100644 --- a/views/components/Navbar.php +++ b/views/components/Navbar.php @@ -51,7 +51,7 @@ if (NGALLERY['root']['registration']['emailverify'] === true && $user->i('status -
+ Лента комментариев+ + + + + i('admin') === 1) { + $admintype = ' · Администратор сервера'; + } else if ($user->i('admin') === 2) { + $admintype = ' · Фотомодератор'; + } + if ((int)Vote::countcommrates($c['id'], -1) >= 1) { + $commclass = 'pro'; + $symb = '+'; + } else if ((int)Vote::countcommrates($c['id'], -1) < 0) { + $commclass = 'con'; + $symb = ''; + } else if ((int)Vote::countcommrates($c['id'], -1) === 0) { + $commclass = ''; + } + echo '
+ ';
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+ Ссылка
+
+
+
+
+ '.$user->i('username').' · '.Date::zmdate($c['posted_at']).'
+
+ Фото: '.Photo::fetchAll($c['user_id']).''.$admintype.'
+
+
+
+
+
+
+
+
+ +
+
+
+
+ –
+ |
+