diff --git a/app/Controllers/Api/Images/Upload.php b/app/Controllers/Api/Images/Upload.php index c259bae..08fd516 100644 --- a/app/Controllers/Api/Images/Upload.php +++ b/app/Controllers/Api/Images/Upload.php @@ -17,7 +17,17 @@ class Upload public static function create($postbody, $content, $exif) { - DB::query('INSERT INTO photos VALUES (\'0\', :userid, :postbody, :photourl, :time, :timeup, :exif, 0, :place, :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())); + $user = new \App\Models\User(Auth::userid()); + if (NGALLERY['root']['photo']['upload']['premoderation'] === true) { + if ($user->content('premoderation') === true) { + $moderated = 1; + } else { + $moderated = 0; + } + } else { + $moderated = 1; + } + DB::query('INSERT INTO photos VALUES (\'0\', :userid, :postbody, :photourl, :time, :timeup, :exif, 0, :moderated, :place, :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)); echo json_encode( array( 'id' => DB::query('SELECT id FROM photos ORDER BY id DESC LIMIT 1')[0]['id'], diff --git a/views/pages/Profile/LK/History.php b/views/pages/Profile/LK/History.php index 85ec966..6d89efb 100644 --- a/views/pages/Profile/LK/History.php +++ b/views/pages/Profile/LK/History.php @@ -47,8 +47,13 @@ use \App\Models\User; Auth::userid())); foreach ($photos as $p) { + if ($p['moderated'] === 0) { + $color = 's0'; + } else { + $color = 's12'; + } $author = new User($p['user_id']); - echo ' + echo '