diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-12-18 16:04:07 +0100 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-12-18 16:04:07 +0100 |
commit | 628e565a6c5ee52341ba6de0b5ecf6495cbb78f8 (patch) | |
tree | 737c1027334a211b62b4a278f87be80bb7e17a4c /include/text.php | |
parent | a721f39945bf3213c4305a389946c464b831a5f9 (diff) | |
parent | 84bf7058119bb2ed48358678be9c212a66c8cb83 (diff) | |
download | volse-hubzilla-628e565a6c5ee52341ba6de0b5ecf6495cbb78f8.tar.gz volse-hubzilla-628e565a6c5ee52341ba6de0b5ecf6495cbb78f8.tar.bz2 volse-hubzilla-628e565a6c5ee52341ba6de0b5ecf6495cbb78f8.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/include/text.php b/include/text.php index 4777e7a61..dd52b16b6 100644 --- a/include/text.php +++ b/include/text.php @@ -1416,20 +1416,14 @@ function format_event($jobject) { function prepare_body(&$item,$attach = false) { require_once('include/identity.php'); -// if($item['html']) { -// $s = bb_observer($item['html']); -// } -// else { - call_hooks('prepare_body_init', $item); -// unobscure($item); - $s = prepare_text($item['body'],$item['mimetype'], false); -// } + call_hooks('prepare_body_init', $item); $photo = ''; - $is_photo = (($item['obj_type'] === ACTIVITY_OBJ_PHOTO) ? true : false); + $is_photo = ((($item['verb'] === ACTIVITY_POST) && ($item['obj_type'] === ACTIVITY_OBJ_PHOTO)) ? true : false); if($is_photo) { + $object = json_decode($item['object'],true); // if original photo width is <= 640px prepend it to item body @@ -1444,6 +1438,8 @@ function prepare_body(&$item,$attach = false) { } } + $s = prepare_text($item['body'],$item['mimetype'], false); + $event = (($item['obj_type'] === ACTIVITY_OBJ_EVENT) ? format_event($item['object']) : false); $prep_arr = array( @@ -1602,6 +1598,16 @@ function prepare_text($text, $content_type = 'text/bbcode', $cache = false) { } +function create_export_photo_body(&$item) { + if(($item['verb'] === ACTIVITY_POST) && ($item['obj_type'] === ACTIVITY_OBJ_PHOTO)) { + $j = json_decode($item['object'],true); + if($j) { + $item['body'] .= "\n\n" . (($j['body']) ? $j['body'] : $j['bbcode']); + $item['sig'] = ''; + } + } +} + /** * zidify_callback() and zidify_links() work together to turn any HTML a tags with class="zrl" into zid links * These will typically be generated by a bbcode '[zrl]' tag. This is done inside prepare_text() rather than bbcode() |