Update twitter card configuration (the photo card is deprecated) to allow inline previews in Twitter.

This commit is contained in:
cria-cow 2017-07-10 18:51:55 -04:00
parent 27f207dcba
commit f9f4f8da0a
2 changed files with 6 additions and 5 deletions

View File

@ -25,7 +25,7 @@ function getGraphHeader($photoID) {
$parseUrl = parse_url('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$url = '//' . $parseUrl['host'] . $parseUrl['path'] . '?' . $parseUrl['query'];
$picture = '//' . $parseUrl['host'] . $parseUrl['path'] . '/../uploads/' . $dir . '/' . $row->url;
$picture = 'http://' . $parseUrl['host'] . '/uploads/' . $dir . '/' . $row->url;
$url = htmlentities($url);
$picture = htmlentities($picture);
@ -39,9 +39,11 @@ function getGraphHeader($photoID) {
$return .= '<link rel="image_src" type="image/jpeg" href="' . $picture . '">';
$return .= '<!-- Twitter Meta Data -->';
$return .= '<meta name="twitter:card" content="photo">';
$return .= '<meta name="twitter:card" content="summary_large_image">';
$return .= '<meta name="twitter:title" content="' . $row->title . '">';
$return .= '<meta name="twitter:image:src" content="' . $picture . '">';
$return .= '<meta name="twitter:description" content="' . $row->description . ' - via Lychee">';
$return .= '<meta name="twitter:image" content="' . $picture . '">';
$return .= '<meta name="twitter:image:alt" content="' . $row->description . ' - via Lychee">';
$return .= '<!-- Facebook Meta Data -->';
$return .= '<meta property="og:title" content="' . $row->title . '">';

View File

@ -5,4 +5,3 @@ Disallow: /docs/
Disallow: /php/
Disallow: /plugins/
Disallow: /src/
Disallow: /uploads/