From 6f3bb7aa30df7bc79f13ad8241c9faf7bc710751 Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Sat, 20 Jul 2024 23:20:43 +0300 Subject: [PATCH] decline reasons in history --- app/Models/Photo.php | 22 ++++++++++++++++++++++ views/pages/Profile/LK/History.php | 9 +++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/app/Models/Photo.php b/app/Models/Photo.php index 9578bb3..ca8d5f1 100644 --- a/app/Models/Photo.php +++ b/app/Models/Photo.php @@ -20,5 +20,27 @@ class Photo { $content = json_decode(self::i('content'), true); return $content[$table]; } + public function declineReason($number) { + switch ($number) { + case 1: + return 'Малоинформативный бред'; + break; + case 2: + return 'Не подходит для сайта'; + break; + case 3: + return 'Порнография'; + break; + case 4: + return 'Травля/Издевательство над человеком'; + break; + case 5: + return 'Расчленёнка'; + break; + default: + return 'Не подходит для сайта'; + break; + } + } } \ No newline at end of file diff --git a/views/pages/Profile/LK/History.php b/views/pages/Profile/LK/History.php index 2767f1a..759aed5 100644 --- a/views/pages/Profile/LK/History.php +++ b/views/pages/Profile/LK/History.php @@ -1,7 +1,7 @@ @@ -55,6 +55,7 @@ use \App\Models\User; $color = 's12'; } $author = new User($p['user_id']); + $photo = new Photo($p['id']); echo ' @@ -64,7 +65,11 @@ use \App\Models\User;

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

-

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

+

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

'; + if ($p['moderated'] === 2) { + echo '

Причина отклонения: '.$photo->declineReason($photo->content('declineReason')).'

'; + } + echo '