updated gallery
This commit is contained in:
@@ -81,7 +81,8 @@ class Chat
|
||||
|
||||
echo '<div class="row well">';
|
||||
if (!empty($_SESSION['web_login']['status'])) {
|
||||
echo '<form action="' . htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8') . '" method="post">';
|
||||
echo '<form action="' . htmlspecialchars(route('community.chat'), ENT_QUOTES, 'UTF-8') . '" method="post">';
|
||||
echo csrf_field();
|
||||
echo '<div class="col-sm-10">';
|
||||
echo '<input type="text" class="form-control" id="chat_txt" name="chat_txt" value="">';
|
||||
echo '</div>';
|
||||
|
||||
@@ -63,6 +63,6 @@ class TodayDownloadsController extends Controller
|
||||
|
||||
$page_title = 'Today Downloaded Artworks';
|
||||
|
||||
return view('legacy::browse', ['page_title' => $page_title, 'artworks' => $paginator]);
|
||||
return view('web.downloads.today', ['page_title' => $page_title, 'artworks' => $paginator]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,21 +35,10 @@ class NewsController extends Controller
|
||||
}
|
||||
|
||||
$articles = $query->paginate($perPage);
|
||||
$categories = NewsCategory::active()->withCount('publishedArticles')->ordered()->get();
|
||||
$trending = NewsArticle::published()
|
||||
->orderByDesc('views')
|
||||
->limit(config('news.trending_limit', 5))
|
||||
->get(['id', 'title', 'slug', 'views', 'published_at']);
|
||||
|
||||
$tags = NewsTag::has('articles')->orderBy('name')->get();
|
||||
|
||||
return view('news.index', [
|
||||
'featured' => $featured,
|
||||
'articles' => $articles,
|
||||
'categories' => $categories,
|
||||
'trending' => $trending,
|
||||
'tags' => $tags,
|
||||
]);
|
||||
] + $this->sidebarData());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@@ -67,13 +56,10 @@ class NewsController extends Controller
|
||||
->orderByDesc('published_at')
|
||||
->paginate($perPage);
|
||||
|
||||
$categories = NewsCategory::active()->withCount('publishedArticles')->ordered()->get();
|
||||
|
||||
return view('news.category', [
|
||||
'category' => $category,
|
||||
'articles' => $articles,
|
||||
'categories' => $categories,
|
||||
]);
|
||||
] + $this->sidebarData());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@@ -91,13 +77,10 @@ class NewsController extends Controller
|
||||
->orderByDesc('published_at')
|
||||
->paginate($perPage);
|
||||
|
||||
$categories = NewsCategory::active()->withCount('publishedArticles')->ordered()->get();
|
||||
|
||||
return view('news.tag', [
|
||||
'tag' => $tag,
|
||||
'articles' => $articles,
|
||||
'categories' => $categories,
|
||||
]);
|
||||
] + $this->sidebarData());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@@ -126,7 +109,7 @@ class NewsController extends Controller
|
||||
return view('news.show', [
|
||||
'article' => $article,
|
||||
'related' => $related,
|
||||
]);
|
||||
] + $this->sidebarData());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@@ -154,4 +137,16 @@ class NewsController extends Controller
|
||||
|
||||
$request->session()->put($session, true);
|
||||
}
|
||||
|
||||
private function sidebarData(): array
|
||||
{
|
||||
return [
|
||||
'categories' => NewsCategory::active()->withCount('publishedArticles')->ordered()->get(),
|
||||
'trending' => NewsArticle::published()
|
||||
->orderByDesc('views')
|
||||
->limit(config('news.trending_limit', 5))
|
||||
->get(['id', 'title', 'slug', 'views', 'published_at']),
|
||||
'tags' => NewsTag::has('articles')->orderBy('name')->get(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +79,9 @@ class StoryController extends Controller
|
||||
'page_meta_description' => 'Long-form creator stories, tutorials, interviews and project breakdowns on Skinbase.',
|
||||
'page_canonical' => route('stories.index'),
|
||||
'page_robots' => 'index,follow',
|
||||
'breadcrumbs' => collect([
|
||||
(object) ['name' => 'Stories', 'url' => route('stories.index')],
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Models\Artwork;
|
||||
use App\Models\ArtworkStats;
|
||||
use App\Models\User;
|
||||
|
||||
class TopAuthorsController extends Controller
|
||||
{
|
||||
@@ -51,7 +49,7 @@ class TopAuthorsController extends Controller
|
||||
];
|
||||
});
|
||||
|
||||
$page_title = 'Top Authors';
|
||||
$page_title = 'Top Creators';
|
||||
|
||||
return view('web.authors.top', compact('page_title', 'authors', 'metric'));
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ class ArtworkService
|
||||
$q->where('af.type', $type);
|
||||
})
|
||||
->with([
|
||||
'user:id,name',
|
||||
'user:id,name,username',
|
||||
'categories' => function ($q) {
|
||||
$q->select('categories.id', 'categories.content_type_id', 'categories.parent_id', 'categories.name', 'categories.slug', 'categories.sort_order');
|
||||
},
|
||||
|
||||
@@ -254,8 +254,25 @@ final class TagService
|
||||
|
||||
public function updateUsageCount(Tag $tag): void
|
||||
{
|
||||
$this->syncUsageCount($tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recalculate and persist the real usage_count from artwork_tag.
|
||||
*
|
||||
* @return array{before:int, after:int, changed:bool}
|
||||
*/
|
||||
public function syncUsageCount(Tag $tag): array
|
||||
{
|
||||
$before = (int) $tag->usage_count;
|
||||
$count = (int) DB::table('artwork_tag')->where('tag_id', $tag->id)->count();
|
||||
$tag->forceFill(['usage_count' => $count])->save();
|
||||
|
||||
return [
|
||||
'before' => $before,
|
||||
'after' => $count,
|
||||
'changed' => $before !== $count,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,8 @@ class AvatarUrl
|
||||
$diskPath = sprintf('avatars/%s/%s/%s/%d.webp', $p1, $p2, $avatarHash, $size);
|
||||
|
||||
// Always use CDN-hosted avatar files.
|
||||
return sprintf('%s/avatars/%s/%s/%s/%d.webp?v=%s', $base, $p1, $p2, $avatarHash, $size, $avatarHash);
|
||||
//return sprintf('%s/avatars/%s/%s/%s/%d.webp?v=%s', $base, $p1, $p2, $avatarHash, $size, $avatarHash);
|
||||
return sprintf('%s/avatars/%s/%s/%s/%d.webp', $base, $p1, $p2, $avatarHash, $size);
|
||||
}
|
||||
|
||||
public static function default(): string
|
||||
|
||||
Reference in New Issue
Block a user