From 2f80a4a91faf3a331053f8466ae2c71a4686bc4e Mon Sep 17 00:00:00 2001 From: DariusIII Date: Wed, 11 Apr 2018 14:44:31 +0200 Subject: [PATCH] Add MovieController --- Blacklight/Movie.php | 155 +++++---------- Changelog | 1 + app/Http/Controllers/ConsoleController.php | 2 +- app/Http/Controllers/GamesController.php | 2 +- app/Http/Controllers/MovieController.php | 212 +++++++++++++++++++++ public/pages/movie.php | 40 ---- public/pages/movies.php | 117 ------------ public/pages/movietrailer.php | 40 ---- routes/web.php | 14 +- 9 files changed, 278 insertions(+), 305 deletions(-) create mode 100644 app/Http/Controllers/MovieController.php delete mode 100644 public/pages/movie.php delete mode 100644 public/pages/movies.php delete mode 100644 public/pages/movietrailer.php diff --git a/Blacklight/Movie.php b/Blacklight/Movie.php index 928523482..1d41a665f 100755 --- a/Blacklight/Movie.php +++ b/Blacklight/Movie.php @@ -217,122 +217,71 @@ class Movie return MovieInfo::query()->where('imdbid', $imdbId)->first(); } + /** - * Get movie releases with covers for movie browse page. - * - * + * @param $page * @param $cat - * @param $start - * @param $num - * @param $orderBy - * @param int $maxAge - * @param array $excludedCats + * @param array $excludedcats * - * @return array|bool + * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator|mixed + * @throws \Exception */ - public function getMovieRange($cat, $start, $num, $orderBy, $maxAge = -1, array $excludedCats = []) + public function getMovieRange($page, $cat, array $excludedcats = []) { - $catsrch = ''; + + $sql = Release::query()->selectRaw("GROUP_CONCAT(r.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id, + GROUP_CONCAT(r.rarinnerfilecount ORDER BY r.postdate DESC SEPARATOR ',') as grp_rarinnerfilecount, + GROUP_CONCAT(r.haspreview ORDER BY r.postdate DESC SEPARATOR ',') AS grp_haspreview, + GROUP_CONCAT(r.passwordstatus ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_password, + GROUP_CONCAT(r.guid ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_guid, + GROUP_CONCAT(rn.releases_id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_nfoid, + GROUP_CONCAT(g.name ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grpname, + GROUP_CONCAT(r.searchname ORDER BY r.postdate DESC SEPARATOR '#') AS grp_release_name, + GROUP_CONCAT(r.postdate ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_postdate, + GROUP_CONCAT(r.size ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_size, + GROUP_CONCAT(r.totalpart ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_totalparts, + GROUP_CONCAT(r.comments ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_comments, + GROUP_CONCAT(r.grabs ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grabs, + GROUP_CONCAT(df.failed ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_failed, + GROUP_CONCAT(cp.title, ' > ', c.title ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_catname") + ->select( + [ + 'm.*', + 'releases.gamesinfo_id', + 'g.name as group_name', + 'rn.releases_id as nfoid', + ] + ) + ->leftJoin('groups as g', 'g.id', '=', 'releases.groups_id') + ->leftJoin('release_nfos as rn', 'rn.releases_id', '=', 'releases.id') + ->leftJoin('dnzb_failures as df', 'df.release_id', '=', 'releases.id') + ->leftJoin('categories as c', 'c.id', '=', 'releases.categories_id') + ->leftJoin('categories as cp', 'cp.id', '=', 'c.parentid') + ->join('movieinfo as m', 'm.imdbid', '=', 'releases.imdbid') + ->where('releases.nzbstatus', '=', 1) + ->where('m.title', '!=', '') + ->where('m.imdbid', '!=', '0000000'); + Releases::showPasswords($sql, true); + if (\count($excludedcats) > 0) { + $sql->whereNotIn('releases.categories_id', $excludedcats); + } + if (\count($cat) > 0 && $cat[0] !== -1) { - $catsrch = Category::getCategorySearch($cat); + Category::getCategorySearch($cat, $sql, true); } - $order = $this->getMovieOrder($orderBy); - $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); + $sql->groupBy('m.imdbid') + ->orderBy('releases.postdate', 'desc'); - $moviesSql = - sprintf( - " - SELECT SQL_CALC_FOUND_ROWS - m.imdbid, - GROUP_CONCAT(r.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id - FROM movieinfo m - LEFT JOIN releases r USING (imdbid) - WHERE r.nzbstatus = 1 - AND m.title != '' - AND m.imdbid != '0000000' - AND r.passwordstatus %s - %s %s %s %s - GROUP BY m.imdbid - ORDER BY %s %s %s", - $this->showPasswords, - $this->getBrowseBy(), - (! empty($catsrch) ? $catsrch : ''), - ( - $maxAge > 0 - ? 'AND r.postdate > NOW() - INTERVAL '.$maxAge.'DAY ' - : '' - ), - (\count($excludedCats) > 0 ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''), - $order[0], - $order[1], - ($start === false ? '' : ' LIMIT '.$num.' OFFSET '.$start) - ); - $movieCache = Cache::get(md5($moviesSql)); - if ($movieCache !== null) { - $movies = $movieCache; - } else { - $movies = $this->pdo->queryCalc($moviesSql); - Cache::put(md5($moviesSql), $movies, $expiresAt); - } - - $movieIDs = $releaseIDs = []; - - if (\is_array($movies['result'])) { - foreach ($movies['result'] as $movie => $id) { - $movieIDs[] = $id['imdbid']; - $releaseIDs[] = $id['grp_release_id']; - } - } - - $sql = sprintf( - " - SELECT - GROUP_CONCAT(r.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id, - GROUP_CONCAT(r.rarinnerfilecount ORDER BY r.postdate DESC SEPARATOR ',') AS grp_rarinnerfilecount, - GROUP_CONCAT(r.haspreview ORDER BY r.postdate DESC SEPARATOR ',') AS grp_haspreview, - GROUP_CONCAT(r.passwordstatus ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_password, - GROUP_CONCAT(r.guid ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_guid, - GROUP_CONCAT(rn.releases_id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_nfoid, - GROUP_CONCAT(g.name ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grpname, - GROUP_CONCAT(r.searchname ORDER BY r.postdate DESC SEPARATOR '#') AS grp_release_name, - GROUP_CONCAT(r.postdate ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_postdate, - GROUP_CONCAT(r.size ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_size, - GROUP_CONCAT(r.totalpart ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_totalparts, - GROUP_CONCAT(r.comments ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_comments, - GROUP_CONCAT(r.grabs ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grabs, - GROUP_CONCAT(df.failed ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_failed, - GROUP_CONCAT(cp.title, ' > ', c.title ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_catname, - m.*, - g.name AS group_name, - rn.releases_id AS nfoid - FROM releases r - LEFT OUTER JOIN groups g ON g.id = r.groups_id - LEFT OUTER JOIN release_nfos rn ON rn.releases_id = r.id - LEFT OUTER JOIN dnzb_failures df ON df.release_id = r.id - LEFT OUTER JOIN categories c ON c.id = r.categories_id - LEFT OUTER JOIN categories cp ON cp.id = c.parentid - INNER JOIN movieinfo m ON m.imdbid = r.imdbid - WHERE m.imdbid IN (%s) - AND r.id IN (%s) %s - GROUP BY m.imdbid - ORDER BY %s %s", - (\is_array($movieIDs) ? implode(',', $movieIDs) : -1), - (\is_array($releaseIDs) ? implode(',', $releaseIDs) : -1), - (! empty($catsrch) ? $catsrch : ''), - $order[0], - $order[1] - ); - $return = Cache::get(md5($sql)); + $return = Cache::get(md5($page.implode('.', $cat).implode('.', $excludedcats))); if ($return !== null) { return $return; } - $return = $this->pdo->query($sql); - if (! empty($return)) { - $return[0]['_totalcount'] = $movies['total'] ?? 0; - } - Cache::put(md5($sql), $return, $expiresAt); + $return = $sql->paginate(config('nntmux.items_per_cover_page')); + + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long')); + Cache::put(md5($page.implode('.', $cat).implode('.', $excludedcats)), $return, $expiresAt); return $return; } diff --git a/Changelog b/Changelog index 91da818b0..787fa3b61 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-04-11 DariusIII + * Chg: Add MovieController * Chg: Add GamesController, adjust themes and classes * Chg: Update CartController * Chg: Update returned response in FailedReleasesController diff --git a/app/Http/Controllers/ConsoleController.php b/app/Http/Controllers/ConsoleController.php index e3c1903ea..f602c268a 100644 --- a/app/Http/Controllers/ConsoleController.php +++ b/app/Http/Controllers/ConsoleController.php @@ -32,7 +32,7 @@ class ConsoleController extends BasePageController $this->smarty->assign('catlist', $ctmp); $this->smarty->assign('category', $category->title); - $page = \request()->has('page') ? \request()->input('page') : 1; + $page = $request->has('page') ? $request->input('page') : 1; $consoles = []; $results = $console->getConsoleRange($page, $catarray, $this->userdata['categoryexclusions']); diff --git a/app/Http/Controllers/GamesController.php b/app/Http/Controllers/GamesController.php index d1c93ebec..032f53326 100644 --- a/app/Http/Controllers/GamesController.php +++ b/app/Http/Controllers/GamesController.php @@ -36,7 +36,7 @@ class GamesController extends BasePageController $this->smarty->assign('catlist', $ctmp); $this->smarty->assign('category', $category); - $page = \request()->has('page') ? \request()->input('page') : 1; + $page = $request->has('page') ? $request->input('page') : 1; $games2 = []; $results = $games->getGamesRange($page, $catarray, $this->userdata['categoryexclusions']); diff --git a/app/Http/Controllers/MovieController.php b/app/Http/Controllers/MovieController.php new file mode 100644 index 000000000..b55017299 --- /dev/null +++ b/app/Http/Controllers/MovieController.php @@ -0,0 +1,212 @@ +setPrefs(); + if ($request->has('modal') && $request->has('id') && ctype_digit($request->input('id'))) { + $movie = new Movie(['Settings' => $this->settings]); + $mov = $movie->getMovieInfo($request->input('id')); + + if (! $mov) { + $this->show404(); + } + + $mov['actors'] = makeFieldLinks($mov, 'actors', 'movies'); + $mov['genre'] = makeFieldLinks($mov, 'genre', 'movies'); + $mov['director'] = makeFieldLinks($mov, 'director', 'movies'); + + $this->smarty->assign(['movie' => $mov, 'modal' => true]); + + $title = 'Info for '.$mov['title']; + $meta_title = ''; + $meta_keywords = ''; + $meta_description = ''; + $this->smarty->registerPlugin('modifier', 'ss', 'stripslashes'); + + if ($request->has('modal')) { + $content = $this->smarty->fetch('viewmovie.tpl'); + $this->smarty->assign('modal', true); + echo $this->content; + } else { + $content = $this->smarty->fetch('viewmoviefull.tpl'); + } + } + + $this->smarty->assign([ + 'content' => $content, + 'title' => $title, + 'meta_title' => $meta_title, + 'meta_keywords' => $meta_keywords, + 'meta_description' => $meta_description, + ]); + $this->pagerender(); + } + + /** + * @param \Illuminate\Http\Request $request + * + * @throws \Exception + */ + public function showMovies(Request $request) + { + $this->setPrefs(); + $movie = new Movie(['Settings' => $this->settings]); + + $moviecats = Category::getChildren(Category::MOVIE_ROOT); + $mtmp = []; + foreach ($moviecats as $mcat) { + $mtmp[$mcat['id']] = $mcat; + } + + $category = $request->has('imdb') ? -1 : Category::MOVIE_ROOT; + if ($request->has('t') && array_key_exists($request->input('t'), $mtmp)) { + $category = $request->input('t') + 0; + } + + $user = User::find(Auth::id()); + $cpapi = $user['cp_api']; + $cpurl = $user['cp_url']; + $this->smarty->assign('cpapi', $cpapi); + $this->smarty->assign('cpurl', $cpurl); + + $catarray = []; + if ((int) $category !== -1) { + $catarray[] = $category; + } + + $this->smarty->assign('catlist', $mtmp); + $this->smarty->assign('category', $category); + + $page = $request->has('page') ? $request->input('page') : 1; + + $movies = []; + $results = $movie->getMovieRange($page, $catarray, $this->userdata['categoryexclusions']); + foreach ($results as $result) { + $result['genre'] = makeFieldLinks($result, 'genre', 'movies'); + $result['actors'] = makeFieldLinks($result, 'actors', 'movies'); + $result['director'] = makeFieldLinks($result, 'director', 'movies'); + $result['languages'] = explode(', ', $result['language']); + + $movies[] = $result; + } + + $title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; + $this->smarty->assign('title', $title); + + $actors = ($request->has('actors') && ! empty($request->input('actors'))) ? stripslashes($request->input('actors')) : ''; + $this->smarty->assign('actors', $actors); + + $director = ($request->has('director') && ! empty($request->input('director'))) ? stripslashes($request->input('director')) : ''; + $this->smarty->assign('director', $director); + + $ratings = range(1, 9); + $rating = ($request->has('rating') && \in_array($request->input('rating'), $ratings, false)) ? $request->input('rating') : ''; + $this->smarty->assign('ratings', $ratings); + $this->smarty->assign('rating', $rating); + + $genres = $movie->getGenres(); + $genre = ($request->has('genre') && \in_array($request->input('genre'), $genres, false)) ? $request->input('genre') : ''; + $this->smarty->assign('genres', $genres); + $this->smarty->assign('genre', $genre); + + $years = range(1903, Carbon::now()->addYear()->year); + rsort($years); + $year = ($request->has('year') && \in_array($request->input('year'), $years, false)) ? $request->input('year') : ''; + $this->smarty->assign('years', $years); + $this->smarty->assign('year', $year); + + if ((int) $category === -1) { + $this->smarty->assign('catname', 'All'); + } else { + $cdata = Category::find($category); + if ($cdata) { + $this->smarty->assign('catname', $cdata->parent !== null ? $cdata->parent->title.' > '.$cdata->title : $cdata->title); + } else { + $this->show404(); + } + } + + $this->smarty->assign('results', $movies); + + $meta_title = 'Browse Nzbs'; + $meta_keywords = 'browse,nzb,description,details'; + $meta_description = 'Browse for Nzbs'; + + if ($request->has('imdb')) { + $content = $this->smarty->fetch('viewmoviefull.tpl'); + } else { + $content = $this->smarty->fetch('movies.tpl'); + } + + $this->smarty->assign([ + 'content' => $content, + 'meta_title' => $meta_title, + 'meta_keywords' => $meta_keywords, + 'meta_description' => $meta_description, + ]); + $this->pagerender(); + } + + /** + * @param \Illuminate\Http\Request $request + * + * @throws \Exception + */ + public function showTrailer(Request $request) + { + $movie = new Movie; + + if ($request->has('id') && ctype_digit($request->input('id'))) { + $mov = $movie->getMovieInfo($request->input('id')); + + if (! $mov) { + $this->show404(); + } + + $this->smarty->assign('movie', $mov); + + $title = 'Info for '.$mov['title']; + $meta_title = ''; + $meta_keywords = ''; + $meta_description = ''; + $this->smarty->registerPlugin('modifier', 'ss', 'stripslashes'); + + $modal = false; + if ($request->has('modal')) { + $modal = true; + $this->smarty->assign('modal', true); + } + + $content = $this->smarty->fetch('viewmovietrailer.tpl'); + + if ($modal) { + echo $content; + } else { + $this->smarty->assign([ + 'content' => $content, + 'title' => $title, + 'meta_title' => $meta_title, + 'meta_keywords' => $meta_keywords, + 'meta_description' => $meta_description, + ]); + $this->pagerender(); + } + } + } +} diff --git a/public/pages/movie.php b/public/pages/movie.php deleted file mode 100644 index 1175fb28c..000000000 --- a/public/pages/movie.php +++ /dev/null @@ -1,40 +0,0 @@ -show403(); -} - -if (request()->has('modal') && request()->has('id') && ctype_digit(request()->input('id'))) { - $movie = new Movie(['Settings' => $page->settings]); - $mov = $movie->getMovieInfo(request()->input('id')); - - if (! $mov) { - $page->show404(); - } - - $mov['actors'] = makeFieldLinks($mov, 'actors', 'movies'); - $mov['genre'] = makeFieldLinks($mov, 'genre', 'movies'); - $mov['director'] = makeFieldLinks($mov, 'director', 'movies'); - - $page->smarty->assign(['movie' => $mov, 'modal' => true]); - - $page->title = 'Info for '.$mov['title']; - $page->meta_title = ''; - $page->meta_keywords = ''; - $page->meta_description = ''; - $page->smarty->registerPlugin('modifier', 'ss', 'stripslashes'); - - if (request()->has('modal')) { - $page->content = $page->smarty->fetch('viewmovie.tpl'); - $page->smarty->assign('modal', true); - echo $page->content; - } else { - $page->content = $page->smarty->fetch('viewmoviefull.tpl'); - $page->pagerender(); - } -} else { - $page->pagerender(); -} diff --git a/public/pages/movies.php b/public/pages/movies.php deleted file mode 100644 index cac94defb..000000000 --- a/public/pages/movies.php +++ /dev/null @@ -1,117 +0,0 @@ -show403(); -} - -$movie = new Movie(['Settings' => $page->settings]); - -$moviecats = Category::getChildren(Category::MOVIE_ROOT); -$mtmp = []; -foreach ($moviecats as $mcat) { - $mtmp[$mcat['id']] = $mcat; -} - -$category = request()->has('imdb') ? -1 : Category::MOVIE_ROOT; -if (request()->has('t') && array_key_exists(request()->input('t'), $mtmp)) { - $category = request()->input('t') + 0; -} - -$user = User::find(Auth::id()); -$cpapi = $user['cp_api']; -$cpurl = $user['cp_url']; -$page->smarty->assign('cpapi', $cpapi); -$page->smarty->assign('cpurl', $cpurl); - -$catarray = []; -if ((int) $category !== -1) { - $catarray[] = $category; -} - -$page->smarty->assign('catlist', $mtmp); -$page->smarty->assign('category', $category); - -$offset = (request()->has('offset') && ctype_digit(request()->input('offset'))) ? request()->input('offset') : 0; -$ordering = $movie->getMovieOrdering(); -$orderby = request()->has('ob') && in_array(request()->input('ob'), $ordering, false) ? request()->input('ob') : ''; - -$movies = []; -$results = $movie->getMovieRange($catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, -1, $page->userdata['categoryexclusions']); -foreach ($results as $result) { - $result['genre'] = makeFieldLinks($result, 'genre', 'movies'); - $result['actors'] = makeFieldLinks($result, 'actors', 'movies'); - $result['director'] = makeFieldLinks($result, 'director', 'movies'); - $result['languages'] = explode(', ', $result['language']); - - $movies[] = $result; -} - -$title = (request()->has('title') && ! empty(request()->input('title'))) ? stripslashes(request()->input('title')) : ''; -$page->smarty->assign('title', $title); - -$actors = (request()->has('actors') && ! empty(request()->input('actors'))) ? stripslashes(request()->input('actors')) : ''; -$page->smarty->assign('actors', $actors); - -$director = (request()->has('director') && ! empty(request()->input('director'))) ? stripslashes(request()->input('director')) : ''; -$page->smarty->assign('director', $director); - -$ratings = range(1, 9); -$rating = (request()->has('rating') && in_array(request()->input('rating'), $ratings, false)) ? request()->input('rating') : ''; -$page->smarty->assign('ratings', $ratings); -$page->smarty->assign('rating', $rating); - -$genres = $movie->getGenres(); -$genre = (request()->has('genre') && in_array(request()->input('genre'), $genres, false)) ? request()->input('genre') : ''; -$page->smarty->assign('genres', $genres); -$page->smarty->assign('genre', $genre); - -$years = range(1903, Carbon::now()->addYear()->year); -rsort($years); -$year = (request()->has('year') && in_array(request()->input('year'), $years, false)) ? request()->input('year') : ''; -$page->smarty->assign('years', $years); -$page->smarty->assign('year', $year); - -$browseby_link = '&title='.$title.'&actors='.$actors.'&director='.$director.'&rating='.$rating.'&genre='.$genre.'&year='.$year; - -$page->smarty->assign('pagertotalitems', $results[0]['_totalcount'] ?? 0); -$page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_cover_page')); -$page->smarty->assign('pagerquerybase', WWW_TOP.'/movies?t='.$category.$browseby_link.'&ob='.$orderby.'&offset='); -$page->smarty->assign('pagerquerysuffix', '#results'); - -$pager = $page->smarty->fetch('pager.tpl'); -$page->smarty->assign('pager', $pager); - -if ((int) $category === -1) { - $page->smarty->assign('catname', 'All'); -} else { - $cdata = Category::find($category); - if ($cdata) { - $page->smarty->assign('catname', $cdata->parent !== null ? $cdata->parent->title.' > '.$cdata->title : $cdata->title); - } else { - $page->show404(); - } -} - -foreach ($ordering as $ordertype) { - $page->smarty->assign('orderby'.$ordertype, WWW_TOP.'/movies?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0'); -} - -$page->smarty->assign('results', $movies); - -$page->meta_title = 'Browse Nzbs'; -$page->meta_keywords = 'browse,nzb,description,details'; -$page->meta_description = 'Browse for Nzbs'; - -if (request()->has('imdb')) { - $page->content = $page->smarty->fetch('viewmoviefull.tpl'); -} else { - $page->content = $page->smarty->fetch('movies.tpl'); -} -$page->pagerender(); diff --git a/public/pages/movietrailer.php b/public/pages/movietrailer.php deleted file mode 100644 index 6d410b11d..000000000 --- a/public/pages/movietrailer.php +++ /dev/null @@ -1,40 +0,0 @@ -show403(); -} - -$movie = new Movie; - -if (request()->has('id') && ctype_digit(request()->input('id'))) { - $mov = $movie->getMovieInfo(request()->input('id')); - - if (! $mov) { - $page->show404(); - } - - $page->smarty->assign('movie', $mov); - - $page->title = 'Info for '.$mov['title']; - $page->meta_title = ''; - $page->meta_keywords = ''; - $page->meta_description = ''; - $page->smarty->registerPlugin('modifier', 'ss', 'stripslashes'); - - $modal = false; - if (request()->has('modal')) { - $modal = true; - $page->smarty->assign('modal', true); - } - - $page->content = $page->smarty->fetch('viewmovietrailer.tpl'); - - if ($modal) { - echo $page->content; - } else { - $page->pagerender(); - } -} diff --git a/routes/web.php b/routes/web.php index c4c414a2e..aa98f3598 100644 --- a/routes/web.php +++ b/routes/web.php @@ -82,9 +82,17 @@ Route::post('failed', 'FailedReleasesController@show'); Route::get('games', 'GamesController@show'); -Route::get('/movies', function () { - redirect('/movies'); -})->middleware('auth'); +Route::get('movies', 'MovieController@showMovies'); + +Route::get('movie', 'MovieController@showMovie'); + +Route::get('movietrailers', 'MovieController@showTrailer'); + +Route::post('movies', 'MovieController@showMovies'); + +Route::post('movie', 'MovieController@showMovie'); + +Route::post('movietrailers', 'MovieController@showTrailer'); Route::get('/pc', function () { redirect('/pc');