From 8b8450f9ad96c1ca267e5362457b0200429bf42b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 30 Sep 2010 18:21:38 -0700 Subject: [PATCH] Add helper metadata on individual notice pages to aid sharing to Facebook (use poster's avatar as image, indicate the text content) --- actions/shownotice.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/actions/shownotice.php b/actions/shownotice.php index c8e9cfe66a..005335e3b4 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -298,6 +298,16 @@ class ShownoticeAction extends OwnerDesignAction array(), array('format'=>'xml','url'=>$this->notice->uri)), 'title'=>'oEmbed'),null); + + // Extras to aid in sharing notices to Facebook + $avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE); + $avatarUrl = ($avatar) ? + $avatar->displayUrl() : + Avatar::defaultImage($avatar_size); + $this->element('meta', array('property' => 'og:image', + 'content' => $avatarUrl)); + $this->element('meta', array('property' => 'og:description', + 'content' => $this->notice->content)); } } -- 2.39.5