mirror of https://github.com/pixelfed/pixelfed.git
Update SiteController
This commit is contained in:
parent
79524a0578
commit
13ceef0f9e
|
@ -42,14 +42,19 @@ class SiteController extends Controller
|
||||||
|
|
||||||
public function about()
|
public function about()
|
||||||
{
|
{
|
||||||
$stats = Cache::remember('site:about', now()->addMinutes(120), function() {
|
return Cache::remember('site:about', now()->addMinutes(120), function() {
|
||||||
return [
|
$page = Page::whereSlug('/site/about')->whereActive(true)->first();
|
||||||
|
$stats = [
|
||||||
'posts' => Status::whereLocal(true)->count(),
|
'posts' => Status::whereLocal(true)->count(),
|
||||||
'users' => User::count(),
|
'users' => User::count(),
|
||||||
'admin' => User::whereIsAdmin(true)->first()
|
'admin' => User::whereIsAdmin(true)->first()
|
||||||
];
|
];
|
||||||
|
if($page) {
|
||||||
|
return View::make('site.about-custom')->with(compact('page', 'stats'))->render();
|
||||||
|
} else {
|
||||||
|
return View::make('site.about')->with(compact('stats'))->render();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return view('site.about', compact('stats'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function language()
|
public function language()
|
||||||
|
|
Loading…
Reference in New Issue