diff --git a/app/Http/Controllers/AdultController.php b/app/Http/Controllers/AdultController.php index 2fb11988b..52cf65c8e 100644 --- a/app/Http/Controllers/AdultController.php +++ b/app/Http/Controllers/AdultController.php @@ -12,7 +12,7 @@ class AdultController extends BasePageController /** * @throws \Exception */ - public function show(Request $request, string $id = ''): void + public function show(Request $request, string $id = '') { $this->setPreferences(); $adult = new XXX; @@ -37,10 +37,6 @@ class AdultController extends BasePageController $catarray = []; $catarray[] = $category; - $this->smarty->assign('catlist', $mtmp); - $this->smarty->assign('category', $category); - $this->smarty->assign('categorytitle', $id); - $ordering = $adult->getXXXOrdering(); $orderby = $request->has('ob') && \in_array($request->input('ob'), $ordering, false) ? $request->input('ob') : ''; @@ -58,54 +54,51 @@ class AdultController extends BasePageController } $title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; - $this->smarty->assign('title', stripslashes($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); $genres = $adult->getAllGenres(true); $genre = ($request->has('genre') && \in_array($request->input('genre'), $genres, false)) ? $request->input('genre') : ''; - $this->smarty->assign('genres', $genres); - $this->smarty->assign('genre', $genre); - $browseby_link = '&title='.$title.'&actors='.$actors.'&director='.$director.'&genre='.$genre; + $browseby_link = '&title='.$title.'&actors='.$actors.'&director='.$director.'&genre='.$genre; if ((int) $category === -1) { - $this->smarty->assign('catname', 'All'); + $catname = 'All'; } else { $cdata = Category::find($category); if ($cdata !== null) { - $this->smarty->assign('catname', $cdata); + $catname = $cdata->title; } else { - $this->smarty->assign('catname', 'All'); + $catname = 'All'; } } + // Build order by URLs + $orderByUrls = []; foreach ($ordering as $ordertype) { - $this->smarty->assign('orderby'.$ordertype, url('/xxx?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0')); + $orderByUrls['orderby'.$ordertype] = url('/XXX/' . ($id ?: 'All') . '?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0'); } - $this->smarty->assign( - [ - 'resultsadd' => $movies, - 'results' => $results, - 'covgroup' => 'xxx', - ] - ); + $this->viewData = array_merge($this->viewData, [ + 'catlist' => $mtmp, + 'category' => $category, + 'categorytitle' => $id, + 'catname' => $catname, + 'title' => stripslashes($title), + 'actors' => $actors, + 'director' => $director, + 'genres' => $genres, + 'genre' => $genre, + 'resultsadd' => $movies, + 'results' => $results, + 'covgroup' => 'xxx', + 'meta_title' => 'Browse XXX', + 'meta_keywords' => 'browse,xxx,nzb,description,details', + 'meta_description' => 'Browse for XXX Movies', + ], $orderByUrls); - $meta_title = 'Browse XXX'; - $meta_keywords = 'browse,xxx,nzb,description,details'; - $meta_description = 'Browse for XXX Movies'; - - if ($request->has('id')) { - $content = $this->smarty->fetch('viewxxxfull.tpl'); - } else { - $content = $this->smarty->fetch('xxx.tpl'); - } - $this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description')); - $this->pagerender(); + return view('xxx.index', $this->viewData); } } diff --git a/app/Http/Controllers/BooksController.php b/app/Http/Controllers/BooksController.php index d0e88979e..1bb318df1 100644 --- a/app/Http/Controllers/BooksController.php +++ b/app/Http/Controllers/BooksController.php @@ -12,7 +12,7 @@ class BooksController extends BasePageController /** * @throws \Exception */ - public function index(Request $request, string $id = ''): void + public function index(Request $request, string $id = '') { $this->setPreferences(); $book = new Books(['Settings' => $this->settings]); @@ -39,10 +39,6 @@ class BooksController extends BasePageController $catarray = []; $catarray[] = $category; - $this->smarty->assign('catlist', $btmp); - $this->smarty->assign('category', $category); - $this->smarty->assign('categorytitle', $id); - $ordering = $book->getBookOrdering(); $orderby = $request->has('ob') && \in_array($request->input('ob'), $ordering, false) ? $request->input('ob') : ''; @@ -64,42 +60,43 @@ class BooksController extends BasePageController } $author = ($request->has('author') && ! empty($request->input('author'))) ? stripslashes($request->input('author')) : ''; - $this->smarty->assign('author', $author); $title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; - $this->smarty->assign('title', $title); - $browseby_link = '&title='.$title.'&author='.$author; + $browseby_link = '&title='.$title.'&author='.$author; if ((int) $category === -1) { - $this->smarty->assign('catname', 'All'); + $catname = 'All'; } else { $cdata = Category::find($category); if ($cdata !== null) { - $this->smarty->assign('catname', $cdata); + $catname = $cdata->title; } else { - $this->smarty->assign('catname', 'All'); + $catname = 'All'; } } + // Build order by URLs + $orderByUrls = []; foreach ($ordering as $ordertype) { - $this->smarty->assign('orderby'.$ordertype, url('/books?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0')); + $orderByUrls['orderby'.$ordertype] = url('/Books/' . ($id ?: 'All') . '?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0'); } - $this->smarty->assign( - [ - 'resultsadd' => $books, - 'results' => $results, - 'covgroup' => 'books', - ] - ); + $this->viewData = array_merge($this->viewData, [ + 'catlist' => $btmp, + 'category' => $category, + 'categorytitle' => $id, + 'catname' => $catname, + 'author' => $author, + 'title' => $title, + 'resultsadd' => $books, + 'results' => $results, + 'covgroup' => 'books', + 'meta_title' => 'Browse Books', + 'meta_keywords' => 'browse,nzb,books,description,details', + 'meta_description' => 'Browse for Books', + ], $orderByUrls); - $meta_title = 'Browse Books'; - $meta_keywords = 'browse,nzb,books,description,details'; - $meta_description = 'Browse for Books'; - $content = $this->smarty->fetch('books.tpl'); - $this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description')); - - $this->pagerender(); + return view('books.index', $this->viewData); } } diff --git a/app/Http/Controllers/GamesController.php b/app/Http/Controllers/GamesController.php index 0224139b9..a5bd40ecf 100644 --- a/app/Http/Controllers/GamesController.php +++ b/app/Http/Controllers/GamesController.php @@ -12,7 +12,7 @@ class GamesController extends BasePageController /** * @throws \Exception */ - public function show(Request $request): void + public function show(Request $request) { $this->setPreferences(); $games = new Games(['Settings' => $this->settings]); @@ -31,9 +31,6 @@ class GamesController extends BasePageController $catarray = []; $catarray[] = $category; - $this->smarty->assign('catlist', $ctmp); - $this->smarty->assign('category', $category); - $page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1; $ordering = $games->getGamesOrdering(); $orderby = $request->has('ob') && \in_array($request->input('ob'), $ordering, false) ? $request->input('ob') : ''; @@ -42,7 +39,6 @@ class GamesController extends BasePageController $results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query()); $title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; - $this->smarty->assign('title', $title); $genres = $gen->getGenres(Genres::GAME_TYPE, true); $tmpgnr = []; @@ -53,35 +49,42 @@ class GamesController extends BasePageController $years = range(1903, date('Y') + 1); 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); $genre = ($request->has('genre') && array_key_exists($request->input('genre'), $tmpgnr)) ? $request->input('genre') : ''; - $this->smarty->assign('genres', $genres); - $this->smarty->assign('genre', $genre); if ((int) $category === -1) { - $this->smarty->assign('catname', 'All'); + $catname = 'All'; } else { $cdata = Category::find($category); if ($cdata !== null) { - $this->smarty->assign('catname', $cdata); + $catname = $cdata->title; } else { - $this->smarty->assign('catname', 'All'); + $catname = 'All'; } } - $this->smarty->assign('results', $results); - $this->smarty->assign('covgroup', 'games'); + // Build order by URLs + $orderByUrls = []; + foreach ($ordering as $orderType) { + $orderByUrls['orderby'.$orderType] = url('Games?ob='.$orderType); + } - $meta_title = 'Browse Games'; - $meta_keywords = 'browse,nzb,games,description,details'; - $meta_description = 'Browse for Games'; + $this->viewData = array_merge($this->viewData, [ + 'catlist' => $ctmp, + 'category' => $category, + 'catname' => $catname, + 'title' => $title, + 'genres' => $genres, + 'genre' => $genre, + 'years' => $years, + 'year' => $year, + 'results' => $results, + 'covgroup' => 'games', + 'meta_title' => 'Browse Games', + 'meta_keywords' => 'browse,nzb,games,description,details', + 'meta_description' => 'Browse for Games', + ], $orderByUrls); - $content = $this->smarty->fetch('games.tpl'); - $this->smarty->assign( - compact('content', 'meta_title', 'meta_keywords', 'meta_description') - ); - $this->pagerender(); + return view('games.index', $this->viewData); } } diff --git a/app/Http/Controllers/MusicController.php b/app/Http/Controllers/MusicController.php index 3f578861a..39e2a1ae4 100644 --- a/app/Http/Controllers/MusicController.php +++ b/app/Http/Controllers/MusicController.php @@ -13,7 +13,7 @@ class MusicController extends BasePageController /** * @throws \Exception */ - public function show(Request $request, string $id = ''): void + public function show(Request $request, string $id = '') { $this->setPreferences(); $music = new Music(['Settings' => $this->settings]); @@ -41,10 +41,6 @@ class MusicController extends BasePageController $catarray = []; $catarray[] = $category; - $this->smarty->assign('catlist', $mtmp); - $this->smarty->assign('category', $category); - $this->smarty->assign('categorytitle', $id); - $page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1; $offset = ($page - 1) * config('nntmux.items_per_cover_page'); $ordering = $music->getMusicOrdering(); @@ -55,10 +51,8 @@ class MusicController extends BasePageController $results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query()); $artist = ($request->has('artist') && ! empty($request->input('artist'))) ? stripslashes($request->input('artist')) : ''; - $this->smarty->assign('artist', $artist); $title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; - $this->smarty->assign('title', $title); $genres = $gen->getGenres(Genres::MUSIC_TYPE, true); $tmpgnr = []; @@ -73,42 +67,47 @@ class MusicController extends BasePageController } $genre = ($request->has('genre') && array_key_exists($request->input('genre'), $tmpgnr)) ? $request->input('genre') : ''; - $this->smarty->assign('genres', $genres); - $this->smarty->assign('genre', $genre); $years = range(1950, date('Y') + 1); 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'); + $catname = 'All'; } else { $cdata = Category::find($category); if ($cdata !== null) { - $this->smarty->assign('catname', $cdata); + $catname = $cdata->title; } else { - $this->smarty->assign('catname', 'All'); + $catname = 'All'; } } - $this->smarty->assign( - [ - 'resultsadd' => $musics, - 'results' => $results, - 'covgroup' => 'music', - ] - ); + // Build order by URLs + $orderByUrls = []; + foreach ($ordering as $orderType) { + $orderByUrls['orderby'.$orderType] = url('music/' . ($id ?: 'All') . '?ob='.$orderType); + } - $meta_title = 'Browse Albums'; - $meta_keywords = 'browse,nzb,albums,description,details'; - $meta_description = 'Browse for Albums'; + $this->viewData = array_merge($this->viewData, [ + 'catlist' => $mtmp, + 'category' => $category, + 'categorytitle' => $id, + 'catname' => $catname, + 'artist' => $artist, + 'title' => $title, + 'genres' => $genres, + 'genre' => $genre, + 'years' => $years, + 'year' => $year, + 'resultsadd' => $musics, + 'results' => $results, + 'covgroup' => 'music', + 'meta_title' => 'Browse Albums', + 'meta_keywords' => 'browse,nzb,albums,description,details', + 'meta_description' => 'Browse for Albums', + ], $orderByUrls); - $content = $this->smarty->fetch('music.tpl'); - - $this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description')); - - $this->pagerender(); + return view('music.index', $this->viewData); } } diff --git a/resources/views/books/index.blade.php b/resources/views/books/index.blade.php new file mode 100644 index 000000000..b0bf5ca27 --- /dev/null +++ b/resources/views/books/index.blade.php @@ -0,0 +1,152 @@ +@extends('layouts.main') + +@section('content') +
+ +
+ +
+ +
+ +
+
+
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+ +
+ + + Clear + +
+
+
+ + + @if(count($results) > 0) +
+

+ + {{ $catname ?? 'All' }} Books +

+ + {{ $results->total() }} results found + +
+ + + + + +
+ {{ $results->links() }} +
+ @else + +
+ +

No books found

+

Try adjusting your search filters or browse all books.

+ + Browse All Books + +
+ @endif +
+
+@endsection + diff --git a/resources/views/games/index.blade.php b/resources/views/games/index.blade.php new file mode 100644 index 000000000..a075196bb --- /dev/null +++ b/resources/views/games/index.blade.php @@ -0,0 +1,173 @@ +@extends('layouts.main') + +@section('content') +
+ +
+ +
+ +
+ +
+
+
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+ +
+ + + Clear + +
+
+
+ + + @if(count($results) > 0) +
+

+ + {{ $catname ?? 'All' }} Games +

+ + {{ $results->total() }} results found + +
+ + + + + +
+ {{ $results->links() }} +
+ @else + +
+ +

No games found

+

Try adjusting your search filters or browse all games.

+ + Browse All Games + +
+ @endif +
+
+@endsection + diff --git a/resources/views/music/index.blade.php b/resources/views/music/index.blade.php new file mode 100644 index 000000000..5621177c6 --- /dev/null +++ b/resources/views/music/index.blade.php @@ -0,0 +1,166 @@ +@extends('layouts.main') + +@section('content') +
+ +
+ +
+ +
+ +
+
+
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+ +
+ + + Clear + +
+
+
+ + + + @if(count($results) > 0) +
+

+ + {{ $catname ?? 'All' }} Albums +

+ + {{ $results->total() }} results found + +
+ + + + + +
+ {{ $results->links() }} +
+ @else + +
+ +

No albums found

+

Try adjusting your search filters or browse all music.

+ + Browse All Audio + +
+ @endif +
+
+@endsection + diff --git a/resources/views/xxx/index.blade.php b/resources/views/xxx/index.blade.php new file mode 100644 index 000000000..56c213232 --- /dev/null +++ b/resources/views/xxx/index.blade.php @@ -0,0 +1,167 @@ +@extends('layouts.main') + +@section('content') +
+ +
+ +
+ +
+ +
+
+
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+ +
+ + + Clear + +
+
+
+ + + @if(count($results) > 0) +
+

+ + {{ $catname ?? 'All' }} XXX +

+ + {{ $results->total() }} results found + +
+ + + + + +
+ {{ $results->links() }} +
+ @else + +
+ +

No content found

+

Try adjusting your search filters or browse all content.

+ + Browse All XXX + +
+ @endif +
+
+@endsection +