Version 5.0.0 beta 5
This commit is contained in:
1 parent
2f24f9de48
commit
57d9db6ce2
218 files changed
+5331
-7416
No files matched your search
@@ -448,13 +448,20 @@ class topic extends Controller
|
||||
'name' => $topic->title,
|
||||
'text' => $firstPost ? $firstPost->truncated( TRUE, NULL ) : $topic->comments( 1, 0 )->truncated( TRUE, NULL ),
|
||||
'dateCreated' => DateTime::ts( $topic->start_date )->format( DateTimeInterface::ATOM ),
|
||||
'answerCount' => ( ( $topic->posts > 1 ) ? ( $topic->posts - 1 ) : 0 ),
|
||||
'author' => [
|
||||
'@type' => 'Person',
|
||||
'name' => $topic->author()->name
|
||||
'name' => $topic->author()->name,
|
||||
'image' => $topic->author()->get_photo( TRUE, TRUE )
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
if( $topic->author()->member_id )
|
||||
{
|
||||
Output::i()->jsonLd['topic']['mainEntity']['author']['url'] = (string) $topic->author()->url();
|
||||
}
|
||||
|
||||
if( $topic->topic_answered_pid )
|
||||
{
|
||||
try
|
||||
@@ -508,8 +515,6 @@ class topic extends Controller
|
||||
$authorIdColumn = $lastComment::$databaseColumnMap['author'];
|
||||
$dateColumn = $lastComment::$databaseColumnMap['date'];
|
||||
|
||||
|
||||
Output::i()->jsonLd['topic']['mainEntity']['answerCount'] = $topic->posts ? $topic->posts - 1 : 0;
|
||||
Output::i()->jsonLd['topic']['mainEntity']['suggestedAnswer'] = array(
|
||||
'@type' => 'Answer',
|
||||
'text' => $lastComment->truncated( TRUE, NULL ),
|
||||
@@ -652,6 +657,12 @@ class topic extends Controller
|
||||
Output::i()->httpHeaders += $httpHeaders;
|
||||
}
|
||||
|
||||
/* $current might be null if the topic has no replies AND we are featuring the first post */
|
||||
if( empty( $current ) and Member::loggedIn()->getLayoutValue( 'forum_topic_view_firstpost' ) )
|
||||
{
|
||||
$current = $firstPost;
|
||||
}
|
||||
|
||||
if( $current )
|
||||
{
|
||||
Output::i()->jsonLd['topic'] = array_merge_recursive( array(
|
||||
|
||||
Reference in new issue
Block a user