]> git.mxchange.org Git - friendica.git/commitdiff
Support of "share" through the API.
authorMichael Vogel <icarus@dabo.de>
Sun, 30 Dec 2012 20:30:39 +0000 (21:30 +0100)
committerMichael Vogel <icarus@dabo.de>
Sun, 30 Dec 2012 20:30:39 +0000 (21:30 +0100)
include/api.php
view/theme/vier/style.css

index 667629e1393ede3a0d0806332c8190fc073098dd..555315bd86a937fda3e563c23596871c333ba3e2 100644 (file)
                //$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
 
                $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`nick` as `reply_author`,
-                       `contact`.`name`, `contact`.`photo`, `contact`.`url` as `reply_url`, `contact`.`rel`,
+                       `contact`.`name`, `contact`.`photo` as `reply_photo`, `contact`.`url` as `reply_url`, `contact`.`rel`,
                        `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
                        `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
                        FROM `item`, `contact`
                );
 
                if ($r[0]['body'] != "") {
-                       $_REQUEST['body'] = html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8')."[url=".$r[0]['reply_url']."]".$r[0]['reply_author']."[/url] \n".$r[0]['body'];
+                       if (intval(get_config('system','new_share'))) {
+                               $post = "[share author='".str_replace("'", "&#039;", $r[0]['reply_author']).
+                                               "' profile='".$r[0]['reply_url'].
+                                               "' avatar='".$r[0]['reply_photo'].
+                                               "' link='".$r[0]['plink']."']";
+
+                               $post .= $r[0]['body'];
+                               $post .= "[/share]";
+                               $_REQUEST['body'] = $post;
+                       } else
+                               $_REQUEST['body'] = html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8')."[url=".$r[0]['reply_url']."]".$r[0]['reply_author']."[/url] \n".$r[0]['body'];
+
                        $_REQUEST['profile_uid'] = api_user();
                        $_REQUEST['type'] = 'wall';
                        $_REQUEST['api_source'] = true;
index 1701e8ac4c81f0fb60f12de0ac03ab194b0509ff..f97fc2f59091c4e51916b6c3af7aaad057e0842c 100644 (file)
@@ -1258,7 +1258,8 @@ border-bottom: 1px solid #D2D2D2;
 
 #profile-jot-form #profile-jot-text {
   height: 2.0em;
-  width: 99%;
+  /* width: 99%; */
+  width: 752px;
   font-size: 15px;
   color: #999999;
   border: 1px solid #DDD;
@@ -1272,7 +1273,8 @@ border-bottom: 1px solid #D2D2D2;
     font-weight: bold;
     height: 20px;
     margin: 0 0 5px;
-    width: 60%;
+    /* width: 60%; */
+    width: 762px;
     border: 1px solid #d2d2d2;
 }