From b60cb689417dfe871cca6d39d34c9bae185be5aa Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Sun, 21 Jul 2024 01:35:44 +0300 Subject: [PATCH] add new values --- ngallery-example.yaml | 3 +++ views/pages/Photo.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ngallery-example.yaml b/ngallery-example.yaml index 3f0a2c8..cdbed3a 100644 --- a/ngallery-example.yaml +++ b/ngallery-example.yaml @@ -38,6 +38,9 @@ ngallery: prohibited_usernames: '' access: public: true + video: + upload: + allow: true photo: upload: allow: true diff --git a/views/pages/Photo.php b/views/pages/Photo.php index f75169a..b70b3c8 100644 --- a/views/pages/Photo.php +++ b/views/pages/Photo.php @@ -13,7 +13,7 @@ if ($photo->i('id') !== null) { } else { $moderated = false; } - } else { + } else if ($photo->i('moderated') === 1) { $moderated = true; if (DB::query('SELECT * FROM photos_views WHERE user_id=:uid AND photo_id=:pid ORDER BY id DESC LIMIT 1', array(':uid' => Auth::userid(), ':pid' => $id))[0]['time'] <= time() - 86400) { DB::query('INSERT INTO photos_views VALUES (\'0\', :uid, :pid, :time)', array(':uid' => Auth::userid(), ':pid' => $id, ':time' => time()));