diff options
author | Max Kostikov <max@kostikov.co> | 2019-11-18 15:58:35 +0100 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2019-11-18 15:58:35 +0100 |
commit | 148c3f9dc5359ffb0dec61e4f5af07a4b4b968f8 (patch) | |
tree | 6124368824b483b6932ab7f29236cd47b91b63b2 /Zotlabs/Module/Channel.php | |
parent | ef75d27afbbee4cfe7d4441269e350b8f7f432f9 (diff) | |
parent | 6f1188f44feca7055e4fad2a902dca1fa1d1914f (diff) | |
download | volse-hubzilla-148c3f9dc5359ffb0dec61e4f5af07a4b4b968f8.tar.gz volse-hubzilla-148c3f9dc5359ffb0dec61e4f5af07a4b4b968f8.tar.bz2 volse-hubzilla-148c3f9dc5359ffb0dec61e4f5af07a4b4b968f8.zip |
Merge branch 'dev' into 'dev'
Better Opengraph markup for posts
See merge request hubzilla/core!1785
Diffstat (limited to 'Zotlabs/Module/Channel.php')
-rw-r--r-- | Zotlabs/Module/Channel.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 3f617fd18..6034bd7da 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -110,8 +110,20 @@ class Channel extends Controller { // Run profile_load() here to make sure the theme is set before // we start loading content - profile_load($which,$profile); + + // Add Opengraph markup + $mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : ''); + if(strpos($mid,'b64.') === 0) + $mid = @base64url_decode(substr($mid,4)); + + if($mid) + $r = q("SELECT * FROM item WHERE mid = '%s' AND uid = %d AND item_private = 0 LIMIT 1", + dbesc($mid), + intval($channel['channel_id']) + ); + + opengraph_add_meta($r ? $r[0] : [], $channel); } function get($update = 0, $load = false) { @@ -376,7 +388,7 @@ class Channel extends Controller { } // Add Opengraph markup - opengraph_add_meta((isset($decoded) && (! empty($items)) ? $r[0] : array()), App::$profile); + opengraph_add_meta((! empty($items) ? $r[0] : array()), App::$profile); if((! $update) && (! $load)) { |