diff options
author | Brion Vibber <brion@pobox.com> | 2010-09-30 18:21:38 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-09-30 18:21:38 -0700 |
commit | 8b8450f9ad96c1ca267e5362457b0200429bf42b (patch) | |
tree | 695892e0887f8846f772d51fdd13f3d78a8f4bb9 | |
parent | d8df140ebb3a051a9b95583e5b6564177b643173 (diff) |
Add helper metadata on individual notice pages to aid sharing to Facebook (use poster's avatar as image, indicate the text content)
-rw-r--r-- | actions/shownotice.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actions/shownotice.php b/actions/shownotice.php index c8e9cfe66..005335e3b 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)); } } |