]> git.mxchange.org Git - friendica-addons.git/commitdiff
fromgplus: Option for enabling and disabling the new "share" element in postings.
authorMichael Vogel <icarus@dabo.de>
Thu, 20 Dec 2012 23:11:06 +0000 (00:11 +0100)
committerMichael Vogel <icarus@dabo.de>
Thu, 20 Dec 2012 23:11:06 +0000 (00:11 +0100)
fromgplus/fromgplus.php

index a6760ca50eda8764af73b7524ede4cb4185652bc..400dd92a7ebfb0dbb6add46135c435bdc2b194dd 100644 (file)
@@ -327,22 +327,27 @@ function fromgplus_fetch($a, $uid) {
 
                                case "activity":
                                        $post = fromgplus_html2bbcode($item->annotation)."\n";
-                                       $post .= fromgplus_html2bbcode("&#x2672;");
-                                       //$post .= html2bbcode("&#x267B;");
-                                       //$post .= fromgplus_html2bbcode("&#x25CC;");
-                                       $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("&#x2672;");
+                                               $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;