From 2efc146a7e0f2c8daa1108b1c009fc9fdb8630e6 Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:13:50 +0300 Subject: [PATCH] fixes --- .gitignore | 3 +- .../Api/Admin/Images/SetVisibility.php | 2 +- app/Core/Routes.php | 2 +- views/components/AdminSidebar.php | 4 +-- views/pages/Admin/Index.php | 9 ++++++ views/pages/Admin/Photo.php | 28 ++++++++++++++++++- views/pages/Rules.php | 2 +- 7 files changed, 43 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 1650713..08507e6 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ ngallery.yaml ngallery.yaml /views/pages/t.php views/pages/t.php -rules.txt \ No newline at end of file +rules.txt +rules.txt diff --git a/app/Controllers/Api/Admin/Images/SetVisibility.php b/app/Controllers/Api/Admin/Images/SetVisibility.php index 4bc2cfd..30cc3e3 100644 --- a/app/Controllers/Api/Admin/Images/SetVisibility.php +++ b/app/Controllers/Api/Admin/Images/SetVisibility.php @@ -12,7 +12,7 @@ class SetVisibility { public function __construct() { - DB::query('UPDATE photos SET moderated=:mod WHERE id=:id', array(':id'=>$_GET['id'], ':mod'=>$_GET['mod'])); + DB::query('UPDATE photos SET moderated=:mod, timeupload=:time WHERE id=:id', array(':id'=>$_GET['id'], ':mod'=>$_GET['mod'], ':time'=>time())); header('Location: ' . $_SERVER['HTTP_REFERER']); } } \ No newline at end of file diff --git a/app/Core/Routes.php b/app/Core/Routes.php index 6573208..8e283a5 100644 --- a/app/Core/Routes.php +++ b/app/Core/Routes.php @@ -42,7 +42,7 @@ class Routes Router::get('/api/photo/comment/rate', 'ApiController@photocommentvote'); if ($user->i('admin') > 0) { Router::any('/admin', 'AdminController@index'); - Router::any('/api/admin/images/setvisibility', 'AdminController@adminsetvis'); + Router::any('/api/admin/images/setvisibility', 'ApiController@adminsetvis'); } Router::get('/logout', 'MainController@logout'); Router::get('/404', 'ExceptionRegister@notfound'); diff --git a/views/components/AdminSidebar.php b/views/components/AdminSidebar.php index a70fa73..1c0a61c 100644 --- a/views/components/AdminSidebar.php +++ b/views/components/AdminSidebar.php @@ -5,12 +5,12 @@ use \App\Core\Page;