diff --git a/Changelog b/Changelog index cc79ffc16..0c2325392 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-04-13 DariusIII + * Chg: Add NfoController and route * Chg: Remove unused pages and update xxx route * Chg: Update AdultController and XXX class * Chg: Update used libraries diff --git a/app/Http/Controllers/NfoController.php b/app/Http/Controllers/NfoController.php new file mode 100644 index 000000000..f52f3e06a --- /dev/null +++ b/app/Http/Controllers/NfoController.php @@ -0,0 +1,59 @@ +has('id')) { + $rel = Release::getByGuid($request->input('id')); + + if (! $rel) { + $this->show404(); + } + + $nfo = ReleaseNfo::getReleaseNfo($rel['id']); + $nfo['nfoUTF'] = Utility::cp437toUTF($nfo['nfo']); + + $this->smarty->assign('rel', $rel); + $this->smarty->assign('nfo', $nfo); + + $title = 'NFO File'; + $meta_title = 'View Nfo'; + $meta_keywords = 'view,nzb,nfo,description,details'; + $meta_description = 'View Nfo File'; + + $modal = false; + if ($request->has('modal')) { + $modal = true; + $this->smarty->assign('modal', true); + } + + $content = $this->smarty->fetch('viewnfo.tpl'); + + if ($modal) { + echo $content; + } else { + $this->smarty->assign( + [ + 'title' => $title, + 'content' => $content, + 'meta_title' => $meta_title, + 'meta_keywords' => $meta_keywords, + 'meta_description' => $meta_description, + ] + ); + $this->pagerender(); + } + } + } +} diff --git a/routes/web.php b/routes/web.php index 4d2cd95ab..952f85252 100644 --- a/routes/web.php +++ b/routes/web.php @@ -98,6 +98,10 @@ Route::get('music', 'MusicController@show'); Route::post('music', 'MusicController@show'); +Route::get('nfo', 'NfoController@showNfo'); + +Route::post('nfo', 'NfoController@showNfo'); + Route::get('xxx', 'AdultController@show'); Route::post('xxx', 'AdultController@show');