diff options
author | Max Kostikov <max@kostikov.co> | 2019-10-12 23:42:35 +0200 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2019-10-12 23:42:35 +0200 |
commit | 0c2657df78b9fe65e01ba4dc027a24d143b6c863 (patch) | |
tree | ac2590d7f806e56a90455e9e09a51e140d6c5e08 | |
parent | e4c57e80318b6e95751f825a9a7c0bf63f69f35d (diff) | |
download | volse-hubzilla-0c2657df78b9fe65e01ba4dc027a24d143b6c863.tar.gz volse-hubzilla-0c2657df78b9fe65e01ba4dc027a24d143b6c863.tar.bz2 volse-hubzilla-0c2657df78b9fe65e01ba4dc027a24d143b6c863.zip |
Add Opengraph image type detection
-rw-r--r-- | include/opengraph.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/opengraph.php b/include/opengraph.php index ab1c90e57..2d72ffca1 100644 --- a/include/opengraph.php +++ b/include/opengraph.php @@ -56,9 +56,13 @@ $ogdesc = sprintf( t('This is the home page of %s.'), $channel['channel_name']); } } + + if(! isset($ogimage)) + $ogimage = $channel['xchan_photo_l']; App::$page['htmlhead'] .= '<meta property="og:title" content="' . htmlspecialchars((isset($ogtitle) ? $ogtitle : $channel['channel_name'])) . '">' . "\r\n"; - App::$page['htmlhead'] .= '<meta property="og:image" content="' . (isset($ogimage) ? $ogimage : $channel['xchan_photo_l']) . '">' . "\r\n"; + App::$page['htmlhead'] .= '<meta property="og:image" content="' . $ogimage . '">' . "\r\n"; + App::$page['htmlhead'] .= '<meta property="og:image:type" content="' . guess_image_type($ogimage) . '">' . "\r\n"; App::$page['htmlhead'] .= '<meta property="og:description" content="' . htmlspecialchars($ogdesc) . '">' . "\r\n"; App::$page['htmlhead'] .= '<meta property="og:type" content="' . (isset($ogtype) ? $ogtype : "profile") . '">' . "\r\n"; |