From f965d9dc9e520800f0fe8e198c31f10e12379c88 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 14 Dec 2017 13:38:56 -0800 Subject: wrong constant name --- Zotlabs/Module/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Module/Item.php') diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 37a3a3a85..6365230f8 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -156,7 +156,7 @@ class Item extends \Zotlabs\Web\Controller { if(! x($_REQUEST,'type')) $_REQUEST['type'] = 'net-comment'; - if($obj_type == ACTIVITY_OBJ_POST) + if($obj_type == ACTIVITY_OBJ_NOTE) $obj_type = ACTIVITY_OBJ_COMMENT; if($parent) { -- cgit v1.2.3 From 91db66b32d2c469a6d0292712666614b48b4c62e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 14 Jan 2018 18:22:58 -0800 Subject: move markdown-in-posts/comments feature to plugin --- Zotlabs/Module/Item.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'Zotlabs/Module/Item.php') diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 6365230f8..ad829137a 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -504,7 +504,12 @@ class Item extends \Zotlabs\Web\Controller { $body = z_input_filter($body,$mimetype,$execflag); } - // Verify ability to use html or php!!! + + $arr = [ 'profile_uid' => $profile_uid, 'content' => $body, 'mimetype' => $mimetype ]; + call_hooks('post_content',$arr); + $body = $arr['content']; + $mimetype = $arr['mimetype']; + $gacl = $acl->get(); $str_contact_allow = $gacl['allow_cid']; @@ -516,13 +521,6 @@ class Item extends \Zotlabs\Web\Controller { require_once('include/text.php'); - if($uid && $uid == $profile_uid && feature_enabled($uid,'markdown')) { - require_once('include/markdown.php'); - $body = preg_replace_callback('/\[share(.*?)\]/ism','\share_shield',$body); - $body = markdown_to_bb($body,true,['preserve_lf' => true]); - $body = preg_replace_callback('/\[share(.*?)\]/ism','\share_unshield',$body); - - } // BBCODE alert: the following functions assume bbcode input // and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.) -- cgit v1.2.3 From 8d479aa1c74169e5b39d6409582c87e59a82d692 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 29 Jan 2018 16:58:55 -0800 Subject: redirect to the email_validation page if login was attempted after account creation but prior to successful verification. This presents the link to resend the verification email and/or allows you to enter it. --- Zotlabs/Module/Item.php | 1 + 1 file changed, 1 insertion(+) (limited to 'Zotlabs/Module/Item.php') diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index ad829137a..db2d64d70 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -753,6 +753,7 @@ class Item extends \Zotlabs\Web\Controller { if ((! $plink) && ($item_thread_top)) { $plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid; + $plink = substr($plink,0,190); } $datarray['aid'] = $channel['channel_account_id']; -- cgit v1.2.3 From fd81a4bdc4f1c80d9dd73358452f50bc6422afef Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 12 Feb 2018 21:43:04 -0800 Subject: initial share refactor --- Zotlabs/Module/Item.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Module/Item.php') diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index db2d64d70..73730bc99 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) { +// $obj = get_share_activity($mtch); + $datarray['obj'] = $obj['obj']; + $datarray['obj_type'] = $obj['obj']['type']; + $body = str_replace($match[1][$i],$obj['body'],$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); -- cgit v1.2.3 From 64809dd2777ae0064addaff765450cf3f05c3bc4 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 13 Feb 2018 20:07:57 -0800 Subject: turn shares into activities - make certain to pull addons or JSON-LD will chuck a wobbly --- Zotlabs/Module/Item.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Zotlabs/Module/Item.php') diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 73730bc99..3f857030b 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -628,10 +628,10 @@ class Item extends \Zotlabs\Web\Controller { $verb = ACTIVITY_SHARE; $i = 0; foreach($match[2] as $mtch) { -// $obj = get_share_activity($mtch); - $datarray['obj'] = $obj['obj']; - $datarray['obj_type'] = $obj['obj']['type']; - $body = str_replace($match[1][$i],$obj['body'],$body); + $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++; } } -- cgit v1.2.3