From bee09a6d8bbfd0da650aeeb5081648aa1e6c45f6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 2 Aug 2017 22:11:46 -0700 Subject: minor activitypub rendering stuff --- include/bbcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index c408af35d..9f9b5c5e1 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -7,7 +7,7 @@ require_once('include/oembed.php'); require_once('include/event.php'); require_once('include/zot.php'); - +require_once('include/html2plain.php'); function get_bb_tag_pos($s, $name, $occurance = 1) { -- cgit v1.2.3 From e2b6464f83313bd56c2d9c962e089d978927cdfd Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 29 Aug 2017 20:07:26 -0700 Subject: escape 'http' inside code blocks so it doesn't trigger an oembed --- include/bbcode.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index 9f9b5c5e1..470854f06 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1255,6 +1255,9 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) $Text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_unspacefy_and_trim', $Text); } + // replace escaped links in code= blocks + $Text = str_replace('%eY9-!','http', $Text); + $Text = preg_replace('/\[\&\;([#a-z0-9]+)\;\]/', '&$1;', $Text); // fix any escaped ampersands that may have been converted into links -- cgit v1.2.3 From 05654e498034329759351c4a64349734ce6b7204 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 4 Sep 2017 21:02:44 -0700 Subject: card embed improved --- include/bbcode.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index 470854f06..9a2a6eb9b 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -327,11 +327,16 @@ function bb_ShareAttributes($match) { if ($avatar != "") $headline .= '' . $author . ''; + if(strpos($link,'/cards/')) + $type = t('card'); + else + $type = t('post'); + // Bob Smith wrote the following post 2 hours ago $fmt = sprintf( t('%1$s wrote the following %2$s %3$s'), '' . $author . '', - '' . t('post') . '', + '' . $type . '', $reldate ); -- cgit v1.2.3