From e65d3402d2eb483c8bcc4821523230a85356f67a Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Wed, 9 Oct 2024 21:59:15 +0300 Subject: [PATCH] fixes admin & upload --- app/Controllers/Api/Images/Upload.php | 10 +++++----- views/pages/Admin/UserEdit.php | 8 ++++---- views/pages/Photo.php | 4 ++-- views/pages/Profile/UploadPhoto.php | 20 +++++++++++++++----- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/app/Controllers/Api/Images/Upload.php b/app/Controllers/Api/Images/Upload.php index fe4ea99..5337c4d 100644 --- a/app/Controllers/Api/Images/Upload.php +++ b/app/Controllers/Api/Images/Upload.php @@ -33,7 +33,7 @@ class Upload } else { $moderated = 1; } - DB::query('INSERT INTO photos VALUES (\'0\', :userid, :postbody, :photourl, :time, :timeup, :exif, 0, :moderated, :place, 0, :content)', array(':postbody' => $postbody, ':userid' => Auth::userid(), ':time' => mktime(0, 0, 0, $_POST['month'], $_POST['day'], $_POST['year']), ':content' => $content, ':photourl' => self::$photourl, ':exif' => $exif, ':place' => $_POST['place'], ':timeup' => time(), ':moderated' => $moderated)); + DB::query('INSERT INTO photos VALUES (\'0\', :userid, :postbody, :photourl, :time, :timeup, :exif, 0, :moderated, :place, 0, :gallery, :content)', array(':postbody' => $postbody, ':userid' => Auth::userid(), ':time' => mktime(0, 0, 0, $_POST['month'], $_POST['day'], $_POST['year']), ':content' => $content, ':photourl' => self::$photourl, ':exif' => $exif, ':place' => $_POST['place'], ':timeup' => time(), ':moderated' => $moderated, ':gallery'=>$_POST['gallery'])); if (($moderated === 1) && (self::$subsnotify != 'disabled')) { $followers = DB::query('SELECT * FROM followers WHERE user_id=:uid', array(':uid' => Auth::userid())); foreach ($followers as $f) { @@ -134,16 +134,16 @@ class Upload $_POST['lat'] = null; $_POST['lng'] = null; } - if ($_POST['disablecomments'] === 1) { + if ((int)$_POST['disablecomments'] === 1) { self::$comments = 'disabled'; } - if ($_POST['disablerating'] === 1) { + if ((int)$_POST['disablerating'] === 1) { self::$rating = 'disabled'; } - if ($_POST['disableshowtop'] === 1) { + if ((int)$_POST['disableshowtop'] === 1) { self::$showtop = 'disabled'; } - if ($_POST['disablesubsnotify'] === 1) { + if ((int)$_POST['disablesubsnotify'] === 1) { self::$subsnotify = 'disabled'; } if ($upload->getType() !== null) { diff --git a/views/pages/Admin/UserEdit.php b/views/pages/Admin/UserEdit.php index 4b2740b..50b970b 100644 --- a/views/pages/Admin/UserEdit.php +++ b/views/pages/Admin/UserEdit.php @@ -68,10 +68,10 @@ if (isset($_POST['subbtn'])) {
Статус аккаунта
diff --git a/views/pages/Photo.php b/views/pages/Photo.php index 31db6fa..ee5d7f8 100644 --- a/views/pages/Photo.php +++ b/views/pages/Photo.php @@ -225,7 +225,7 @@ if ($photo->i('id') !== null) { - i('moderated') === 1 && json_decode($c['content'], true)['rating'] != 'disabled') { ?> + i('moderated') === 1 && $photo->content('rating') != 'disabled') { ?>

Оценка

@@ -369,7 +369,7 @@ if ($photo->i('id') !== null) { $commcount++; } } - if (json_decode($c['content'], true)['comments'] != 'disabled') { ?> + if ($photo->content('comments') != 'disabled') { ?>
0) { ?> diff --git a/views/pages/Profile/UploadPhoto.php b/views/pages/Profile/UploadPhoto.php index 2f86a47..5a6229a 100644 --- a/views/pages/Profile/UploadPhoto.php +++ b/views/pages/Profile/UploadPhoto.php @@ -493,7 +493,17 @@ $user = new User(Auth::userid()); Галерея: - + + + @@ -860,7 +870,7 @@ $user = new User(Auth::userid()); - + @@ -873,7 +883,7 @@ $user = new User(Auth::userid()); - + @@ -885,7 +895,7 @@ $user = new User(Auth::userid()); - + @@ -897,7 +907,7 @@ $user = new User(Auth::userid()); - +