From 804bf0d980ca1f149bc74999418bf0c6b64605fc Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 21 Dec 2012 00:11:06 +0100 Subject: [PATCH] fromgplus: Option for enabling and disabling the new "share" element in postings. --- fromgplus/fromgplus.php | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index a6760ca5..400dd92a 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -327,22 +327,27 @@ function fromgplus_fetch($a, $uid) { case "activity": $post = fromgplus_html2bbcode($item->annotation)."\n"; - $post .= fromgplus_html2bbcode("♲"); - //$post .= html2bbcode("♻"); - //$post .= fromgplus_html2bbcode("◌"); - $post .= " [url=".$item->object->actor->url."]".$item->object->actor->displayName."[/url] \n"; - /*$post .= "[share author='".$item->object->actor->displayName. - "' profile='".$item->object->actor->url. - "' avatar='".$item->object->actor->image->url. - "' link='".$item->object->url."']\n";*/ + if (intval(get_config('system','new_share'))) { + $post .= "[share author='".$item->object->actor->displayName. + "' profile='".$item->object->actor->url. + "' avatar='".$item->object->actor->image->url. + "' link='".$item->object->url."']"; - $post .= fromgplus_html2bbcode($item->object->content); + $post .= fromgplus_html2bbcode($item->object->content); - if (is_array($item->object->attachments)) - $post .= "\n".trim(fromgplus_handleattachments($item)); + if (is_array($item->object->attachments)) + $post .= "\n".trim(fromgplus_handleattachments($item)); + + $post .= "[/share]"; + } else { + $post .= fromgplus_html2bbcode("♲"); + $post .= " [url=".$item->object->actor->url."]".$item->object->actor->displayName."[/url] \n"; + $post .= fromgplus_html2bbcode($item->object->content); - //$post .= "[/share]"; + if (is_array($item->object->attachments)) + $post .= "\n".trim(fromgplus_handleattachments($item)); + } if (isset($item->address)) $location = $item->address; -- 2.39.5