aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php24
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()