mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Use config where possible
This commit is contained in:
@@ -79,14 +79,10 @@ class BasePageController extends Controller
|
||||
if (Auth::check()) {
|
||||
$this->userdata = User::find(Auth::id());
|
||||
$this->setUserPreferences();
|
||||
if ($this->theme === 'None') {
|
||||
$this->theme = Settings::settingValue('site.main.style');
|
||||
}
|
||||
} else {
|
||||
$this->theme = Settings::settingValue('site.main.style');
|
||||
// Tell Smarty which directories to use for templates
|
||||
$this->smarty->setTemplateDir([
|
||||
'user' => config('ytake-laravel-smarty.template_path').DIRECTORY_SEPARATOR.$this->theme,
|
||||
'user' => config('ytake-laravel-smarty.template_path').'/Gentele',
|
||||
'shared' => config('ytake-laravel-smarty.template_path').'/shared',
|
||||
'default' => config('ytake-laravel-smarty.template_path').'/Gentele',
|
||||
]);
|
||||
@@ -102,7 +98,7 @@ class BasePageController extends Controller
|
||||
|
||||
$this->smarty->assign(
|
||||
[
|
||||
'theme' => $this->theme,
|
||||
'theme' => 'Gentele',
|
||||
'site' => $this->settings,
|
||||
]
|
||||
);
|
||||
@@ -139,16 +135,6 @@ class BasePageController extends Controller
|
||||
{
|
||||
$this->userdata->categoryexclusions = User::getCategoryExclusionById(Auth::id());
|
||||
|
||||
// Change the theme to user's selected theme if they selected one, else use the admin one.
|
||||
if ((int) Settings::settingValue('site.main.userselstyle') === 1) {
|
||||
$this->theme = $this->userdata->style ?? 'None';
|
||||
if ($this->theme === 'None') {
|
||||
$this->theme = Settings::settingValue('site.main.style');
|
||||
}
|
||||
} else {
|
||||
$this->theme = Settings::settingValue('site.main.style');
|
||||
}
|
||||
|
||||
// Update last login every 15 mins.
|
||||
if (now()->subHours(3) > $this->userdata->lastlogin) {
|
||||
event(new UserLoggedIn($this->userdata));
|
||||
@@ -167,7 +153,7 @@ class BasePageController extends Controller
|
||||
|
||||
// Tell Smarty which directories to use for templates
|
||||
$this->smarty->setTemplateDir([
|
||||
'user' => config('ytake-laravel-smarty.template_path').DIRECTORY_SEPARATOR.$this->theme,
|
||||
'user' => config('ytake-laravel-smarty.template_path').'/Gentele',
|
||||
'shared' => config('ytake-laravel-smarty.template_path').'/shared',
|
||||
'default' => config('ytake-laravel-smarty.template_path').'/Gentele',
|
||||
]);
|
||||
@@ -178,10 +164,6 @@ class BasePageController extends Controller
|
||||
}
|
||||
|
||||
$content = new Contents;
|
||||
if ($this->userdata !== null) {
|
||||
$this->smarty->assign('recentforumpostslist', Forumpost::getPosts(Settings::settingValue('..showrecentforumposts')));
|
||||
}
|
||||
|
||||
$parentcatlist = Category::getForMenu($this->userdata->categoryexclusions);
|
||||
|
||||
$this->smarty->assign('parentcatlist', $parentcatlist);
|
||||
|
||||
Reference in New Issue
Block a user