Homepage
- Add HomepageService with hero, trending (award-weighted), fresh uploads,
popular tags, creator spotlight (weekly uploads ranking), and news sections
- Add React components: HomePage, HomeHero, HomeTrending, HomeFresh,
HomeTags, HomeCreators, HomeNews (lazy-loaded below the fold)
- Wire home.blade.php with JSON props, SEO meta, JSON-LD, and hero preload
- Add HomePage.jsx to vite.config.js inputs
Profile page
- Hero banner with random user artwork as background + dark gradient overlay
- Favourites section uses real Artwork models + <x-artwork-card> for CDN URLs
- Newest artworks grid: gallery-grid → grid grid-cols-2 gap-4
Edit Profile page (user.blade.php)
- Add hero banner (featured wallpaper/photography via artwork_features,
content_type_id IN [2,3]) sourced in UserController
- Remove bg-deep from outer wrapper; card backgrounds: bg-panel → bg-nova-800
- Remove stray AI-generated tag fragment from template
Author profile links
- Fix all /@username routes in: HomepageService, MonthlyCommentatorsController,
LatestCommentsController, MyBuddiesController and corresponding blade views
Legacy view namespace
- Register View::addNamespace('legacy', resource_path('views/_legacy'))
in AppServiceProvider::boot()
- Convert all view('legacy.x') and @include('legacy.x') calls to legacy::x
- Migrate legacy views to resources/views/_legacy/ with namespace support
107 lines
3.4 KiB
PHP
107 lines
3.4 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Legacy;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class InterviewController extends Controller
|
|
{
|
|
public function show(Request $request, $id, $slug = null)
|
|
{
|
|
$id = (int) $id;
|
|
|
|
// Handle comment POST
|
|
if ($request->isMethod('post')) {
|
|
$action = $request->input('action');
|
|
if ($action === 'store' && (!empty($_SESSION['web_login']['user_type']) && $_SESSION['web_login']['user_type'] > 1)) {
|
|
$comment = $request->input('comment');
|
|
$tekst = nl2br(htmlspecialchars($comment ?? '', ENT_QUOTES, 'UTF-8'));
|
|
$interviewId = (int) $request->input('interview_id');
|
|
|
|
try {
|
|
DB::table('interviews_comment')->insert([
|
|
'nid' => $interviewId,
|
|
'author' => $_SESSION['web_login']['username'] ?? 'Anonymous',
|
|
'datum' => DB::raw('CURRENT_TIMESTAMP'),
|
|
'tekst' => $tekst,
|
|
]);
|
|
|
|
$ar2 = DB::table('users')
|
|
->where('uname', $_SESSION['web_login']['username'])
|
|
->first();
|
|
|
|
if (!empty($ar2->user_id)) {
|
|
DB::table('users_statistics')
|
|
->where('user_id', $ar2->user_id)
|
|
->increment('newscomment');
|
|
}
|
|
} catch (\Throwable $e) {
|
|
// fail silently
|
|
}
|
|
}
|
|
}
|
|
|
|
try {
|
|
$ar = DB::table('interviews')->where('id', $id)->first();
|
|
} catch (\Throwable $e) {
|
|
$ar = null;
|
|
}
|
|
|
|
if (! $ar) {
|
|
return redirect('/interviews');
|
|
}
|
|
|
|
try {
|
|
$artworks = DB::table('wallz')
|
|
->where('uname', $ar->username)
|
|
->inRandomOrder()
|
|
->limit(2)
|
|
->get();
|
|
} catch (\Throwable $e) {
|
|
$artworks = collect();
|
|
}
|
|
|
|
try {
|
|
$comments = DB::table('interviews_comment as c')
|
|
->leftJoin('users as u', 'u.uname', '=', 'c.author')
|
|
->where('c.nid', $id)
|
|
->select('c.*', 'u.user_id', 'u.user_type', 'u.signature', 'u.icon')
|
|
->orderBy('c.datum')
|
|
->get();
|
|
} catch (\Throwable $e) {
|
|
$comments = collect();
|
|
}
|
|
|
|
// compute total posts per author across interviews_comment
|
|
$authors = $comments->pluck('author')->unique()->values()->all();
|
|
$postCounts = [];
|
|
if (!empty($authors)) {
|
|
try {
|
|
$counts = DB::table('interviews_comment')
|
|
->select('author', DB::raw('COUNT(*) as cnt'))
|
|
->whereIn('author', $authors)
|
|
->groupBy('author')
|
|
->get();
|
|
|
|
foreach ($counts as $c) {
|
|
$postCounts[$c->author] = $c->cnt;
|
|
}
|
|
} catch (\Throwable $e) {
|
|
// ignore
|
|
}
|
|
}
|
|
|
|
$page_title = 'Interview with ' . ($ar->username ?? '');
|
|
|
|
return view('legacy::interview', [
|
|
'ar' => $ar,
|
|
'artworks' => $artworks,
|
|
'comments' => $comments,
|
|
'postCounts' => $postCounts,
|
|
'page_title' => $page_title,
|
|
]);
|
|
}
|
|
}
|