X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fp.php;h=20d6cfdbafeb181ca263aec232a33d53722dab8a;hb=09931b71247c2261371a5a40b38a2127f79f344d;hp=6bae9925656538552c17dc50546f36213be779f4;hpb=5837fd4f817c06a723af9ad27298b6bef40e37e5;p=friendica.git diff --git a/mod/p.php b/mod/p.php index 6bae992565..20d6cfdbaf 100644 --- a/mod/p.php +++ b/mod/p.php @@ -19,7 +19,7 @@ function p_init($a){ $guid = strtolower(substr($guid, 0, -4)); - $item = q("SELECT `body`, `guid`, `contact-id`, `private`, `created`, `app` FROM `item` WHERE `uid` = 0 AND `guid` = '%s' AND `network` IN ('%s', '%s') LIMIT 1", + $item = q("SELECT `title`, `body`, `guid`, `contact-id`, `private`, `created`, `app` FROM `item` WHERE `uid` = 0 AND `guid` = '%s' AND `network` IN ('%s', '%s') AND `id` = `parent` LIMIT 1", dbesc($guid), NETWORK_DFRN, NETWORK_DIASPORA); if (!$item) { header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found')); @@ -28,21 +28,27 @@ function p_init($a){ $post = array(); - $reshared = diaspora_is_reshare($item[0]["body"]); + $reshared = diaspora::is_reshare($item[0]["body"]); if ($reshared) { $nodename = "reshare"; $post["root_diaspora_id"] = $reshared["root_handle"]; $post["root_guid"] = $reshared["root_guid"]; $post["guid"] = $item[0]["guid"]; - $post["diaspora_handle"] = diaspora_handle_from_contact($item[0]["contact-id"]); + $post["diaspora_handle"] = diaspora::handle_from_contact($item[0]["contact-id"]); $post["public"] = (!$item[0]["private"] ? 'true':'false'); $post["created_at"] = datetime_convert('UTC','UTC',$item[0]["created"]); } else { + + $body = bb2diaspora($item[0]["body"]); + + if(strlen($item[0]["title"])) + $body = "## ".html_entity_decode($item[0]["title"])."\n\n".$body; + $nodename = "status_message"; - $post["raw_message"] = str_replace("&", "&", bb2diaspora($item[0]["body"])); + $post["raw_message"] = str_replace("&", "&", $body); $post["guid"] = $item[0]["guid"]; - $post["diaspora_handle"] = diaspora_handle_from_contact($item[0]["contact-id"]); + $post["diaspora_handle"] = diaspora::handle_from_contact($item[0]["contact-id"]); $post["public"] = (!$item[0]["private"] ? 'true':'false'); $post["created_at"] = datetime_convert('UTC','UTC',$item[0]["created"]); $post["provider_display_name"] = $item[0]["app"];