diff options
author | zotlabs <mike@macgirvin.com> | 2018-02-13 20:09:55 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-02-13 20:09:55 -0800 |
commit | 24da5d82db8316a54ccb41616e0e2acb5d73fc84 (patch) | |
tree | a6fb39d3c1d8d79401db5832b5c44bffeea5113a /Zotlabs/Module | |
parent | 6ca3442ba381a3c5b98cd04f4f9e87e48c55b072 (diff) | |
parent | 64809dd2777ae0064addaff765450cf3f05c3bc4 (diff) | |
download | volse-hubzilla-24da5d82db8316a54ccb41616e0e2acb5d73fc84.tar.gz volse-hubzilla-24da5d82db8316a54ccb41616e0e2acb5d73fc84.tar.bz2 volse-hubzilla-24da5d82db8316a54ccb41616e0e2acb5d73fc84.zip |
Merge branch 'share'
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Item.php | 17 | ||||
-rw-r--r-- | Zotlabs/Module/Share.php | 4 |
2 files changed, 20 insertions, 1 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index db2d64d70..3f857030b 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -39,6 +39,7 @@ class Item extends \Zotlabs\Web\Controller { $uid = local_channel(); $channel = null; $observer = null; + $datarray = []; /** @@ -619,6 +620,21 @@ class Item extends \Zotlabs\Web\Controller { $i++; } } + + + if(preg_match_all('/(\[share=(.*?)\](.*?)\[\/share\])/',$body,$match)) { + // process share by id + + $verb = ACTIVITY_SHARE; + $i = 0; + foreach($match[2] as $mtch) { + $reshare = new \Zotlabs\Lib\Share($mtch); + $datarray['obj'] = $reshare->obj(); + $datarray['obj_type'] = $datarray['obj']['type']; + $body = str_replace($match[1][$i],$reshare->bbcode(),$body); + $i++; + } + } } @@ -720,7 +736,6 @@ class Item extends \Zotlabs\Web\Controller { if(!$thr_parent) $thr_parent = $mid; - $datarray = array(); $item_thread_top = ((! $parent) ? 1 : 0); diff --git a/Zotlabs/Module/Share.php b/Zotlabs/Module/Share.php index 5c4811c59..7f4d8b1eb 100644 --- a/Zotlabs/Module/Share.php +++ b/Zotlabs/Module/Share.php @@ -14,6 +14,10 @@ class Share extends \Zotlabs\Web\Controller { if(! $post_id) killme(); + + echo '[share=' . $post_id . '][/share]'; + killme(); + if(! (local_channel() || remote_channel())) killme(); |