Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -110,7 +110,7 @@ class _entry extends \IPS\Content\Controller
|
||||
'@context' => "http://schema.org",
|
||||
'@type' => "Blog",
|
||||
'url' => (string) $this->entry->container()->url(),
|
||||
'name' => htmlspecialchars( $this->entry->container()->_title, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
|
||||
'name' => $this->entry->container()->_title,
|
||||
'description' => strip_tags( $this->entry->container()->description ),
|
||||
'commentCount' => $this->entry->container()->_comments,
|
||||
'interactionStatistic' => array(
|
||||
@@ -140,21 +140,21 @@ class _entry extends \IPS\Content\Controller
|
||||
'@type' => "BlogPosting",
|
||||
'url' => (string) $this->entry->url(),
|
||||
'mainEntityOfPage' => (string) $this->entry->url(),
|
||||
'name' => htmlspecialchars( $this->entry->mapped('title'), ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
|
||||
'headline' => htmlspecialchars( $this->entry->mapped('title'), ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
|
||||
'name' => $this->entry->mapped('title'),
|
||||
'headline' => $this->entry->mapped('title'),
|
||||
'articleBody' => strip_tags( $this->entry->truncated() ),
|
||||
'commentCount' => $this->entry->mapped('num_comments'),
|
||||
'dateCreated' => \IPS\DateTime::ts( $this->entry->date )->format( \IPS\DateTime::ISO8601 ),
|
||||
'datePublished' => \IPS\DateTime::ts( $this->entry->publish_date )->format( \IPS\DateTime::ISO8601 ),
|
||||
'author' => array(
|
||||
'@type' => 'Person',
|
||||
'name' => htmlspecialchars( \IPS\Member::load( $this->entry->mapped('author') )->name, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
|
||||
'name' => \IPS\Member::load( $this->entry->mapped('author') )->name,
|
||||
'url' => (string) \IPS\Member::load( $this->entry->mapped('author') )->url(),
|
||||
'image' => \IPS\Member::load( $this->entry->mapped('author') )->get_photo()
|
||||
),
|
||||
'publisher' => array(
|
||||
'@type' => 'Organization',
|
||||
'name' => htmlspecialchars( \IPS\Member::load( $this->entry->mapped('author') )->name, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
|
||||
'name' => \IPS\Member::load( $this->entry->mapped('author') )->name,
|
||||
'url' => (string) \IPS\Member::load( $this->entry->mapped('author') )->url(),
|
||||
'image' => \IPS\Member::load( $this->entry->mapped('author') )->get_photo(),
|
||||
'logo' => array(
|
||||
@@ -182,6 +182,15 @@ class _entry extends \IPS\Content\Controller
|
||||
)
|
||||
);
|
||||
|
||||
if( $this->entry->averageRating() )
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['blog']['blogPost']['aggregateRating'] = array(
|
||||
'@type' => 'AggregateRating',
|
||||
'ratingValue' => $this->entry->averageRating(),
|
||||
'ratingCount' => $this->entry->numberOfRatings(),
|
||||
);
|
||||
}
|
||||
|
||||
if( $this->entry->container()->coverPhoto()->file )
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['blog']['image'] = (string) $this->entry->container()->coverPhoto()->file->url;
|
||||
@@ -191,7 +200,7 @@ class _entry extends \IPS\Content\Controller
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['blog']['author'] = array(
|
||||
'@type' => 'Person',
|
||||
'name' => htmlspecialchars( \IPS\Member::load( $this->entry->container()->member_id )->name, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
|
||||
'name' => \IPS\Member::load( $this->entry->container()->member_id )->name,
|
||||
'url' => (string) \IPS\Member::load( $this->entry->container()->member_id )->url(),
|
||||
'image' => \IPS\Member::load( $this->entry->container()->member_id )->get_photo()
|
||||
);
|
||||
@@ -235,6 +244,8 @@ class _entry extends \IPS\Content\Controller
|
||||
}
|
||||
/* File does not exist */
|
||||
catch( \RuntimeException $e ) {}
|
||||
/* Image is invalid */
|
||||
catch( \InvalidArgumentException $e ){}
|
||||
}
|
||||
|
||||
/* Display */
|
||||
|
||||
Reference in new issue
Block a user