Implement academy analytics, billing, and web stories updates
This commit is contained in:
@@ -75,21 +75,29 @@
|
||||
|
||||
return array_filter([
|
||||
'name' => $name,
|
||||
'url' => $username !== '' ? url('/@' . ltrim($username, '@')) : null,
|
||||
]);
|
||||
'url' => $username !== '' ? route('profile.show', ['username' => $username]) : null,
|
||||
], fn ($value) => $value !== null && $value !== '');
|
||||
};
|
||||
|
||||
// Ensure we always provide a top-level author object for structured data.
|
||||
$topAuthor = $makeForumAuthor($author ?? $opPost?->user ?? null);
|
||||
$topAuthor = $makeForumAuthor($author ?? $opPost?->user ?? $thread->user ?? null);
|
||||
if (! $topAuthor) {
|
||||
$topAuthor = ['name' => (string) ($opPost?->user?->name ?? $thread->user?->name ?? 'Skinbase')];
|
||||
$topAuthor = ['name' => (string) (config('app.name') ?: 'Skinbase')];
|
||||
}
|
||||
|
||||
$threadText = $threadDescription;
|
||||
if ($threadText === null || $threadText === '') {
|
||||
$threadBody = trim((string) strip_tags((string) ($thread->content ?? '')));
|
||||
$threadText = $threadBody !== ''
|
||||
? Str::limit($threadBody, 220)
|
||||
: Str::limit((string) $thread->title, 220);
|
||||
}
|
||||
|
||||
$forumMicrodata = [
|
||||
'kind' => 'topic',
|
||||
'canonical' => route('forum.thread.show', ['thread' => $thread->id, 'slug' => $thread->slug]),
|
||||
'title' => (string) $thread->title,
|
||||
'text' => $threadDescription,
|
||||
'text' => $threadText,
|
||||
'date_published' => $thread->created_at?->toIso8601String(),
|
||||
'date_modified' => ($thread->last_post_at ?? $thread->updated_at)?->toIso8601String(),
|
||||
'comment_count' => (int) ($reply_count ?? 0),
|
||||
@@ -119,7 +127,7 @@
|
||||
'text' => Str::limit($text, 300),
|
||||
'date_published' => $post->created_at?->toIso8601String(),
|
||||
'date_modified' => ($post->edited_at ?? $post->created_at)?->toIso8601String(),
|
||||
'author' => $makeForumAuthor($post->user ?? null) ?: ['name' => (string) ($post->user?->name ?? 'Skinbase')],
|
||||
'author' => $makeForumAuthor($post->user ?? null) ?: $topAuthor,
|
||||
], fn ($value) => $value !== null && $value !== '');
|
||||
})
|
||||
->values()
|
||||
|
||||
Reference in New Issue
Block a user