From e8d2dd7204b2ae80819905075de1a036c2be9aa6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 30 Apr 2015 18:18:46 +0200 Subject: document [var=wrap]none[/var] for block elements --- doc/Comanche.md | 4 ++++ doc/comanche.bb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/doc/Comanche.md b/doc/Comanche.md index 56bf68457..147988938 100644 --- a/doc/Comanche.md +++ b/doc/Comanche.md @@ -88,6 +88,10 @@ This places the menu called "mymenu" at this location on the page, which must be This places a block named "contributors" in this region. + [block][var=wrap]none[/var]contributors[/block] + +The variable [var=wrap]none[/var] in a block removes the wrapping div element from the block. + **Widgets** diff --git a/doc/comanche.bb b/doc/comanche.bb index 19a74833e..3afe14489 100644 --- a/doc/comanche.bb +++ b/doc/comanche.bb @@ -108,6 +108,10 @@ This places the menu called "mymenu" at this location on the page, whi [/code] This places a block named "contributors" in this region. +[code] + [block][var=wrap]none[/var]contributors[/block] +[/code] +The variable [var=wrap]none[/var] in a block removes the wrapping div element from the block. [b]Widgets[/b] -- cgit v1.2.3 From 097002910ead3ec263f723eb66e659f0469b8bb6 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 30 Apr 2015 17:52:34 -0700 Subject: just a test, please do not try to implement this as there are severe security issues --- include/bbcode.php | 12 ++++++++++-- include/text.php | 10 ++++++++++ version.inc | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index 47a1fd223..fe5f37260 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -420,7 +420,11 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true) { // process [observer] tags before we do anything else because we might // be stripping away stuff that then doesn't need to be worked on anymore - $observer = $a->get_observer(); + if(get_config('system','item_cache')) + $observer = false; + else + $observer = $a->get_observer(); + if ((strpos($Text,'[/observer]') !== false) || (strpos($Text,'[/rpost]') !== false)) { if ($observer) { $Text = preg_replace("/\[observer\=1\](.*?)\[\/observer\]/ism", '$1', $Text); @@ -433,7 +437,11 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true) { } } - $channel = $a->get_channel(); + if(get_config('system','item_cache')) + $channel = false; + else + $channel = $a->get_channel(); + if (strpos($Text,'[/channel]') !== false) { if ($channel) { $Text = preg_replace("/\[channel\=1\](.*?)\[\/channel\]/ism", '$1', $Text); diff --git a/include/text.php b/include/text.php index f8a990f58..05251c580 100644 --- a/include/text.php +++ b/include/text.php @@ -1371,8 +1371,12 @@ function generate_named_map($location) { function prepare_body(&$item,$attach = false) { + if(get_config('system','item_cache') && $item['body']) + return $item['html']; + call_hooks('prepare_body_init', $item); + unobscure($item); $s = prepare_text($item['body'],$item['mimetype']); @@ -1440,6 +1444,12 @@ function prepare_body(&$item,$attach = false) { $prep_arr = array('item' => $item, 'html' => $s); call_hooks('prepare_body_final', $prep_arr); + if(get_config('system','item_cache')) + q("update item set html = '%s' where id = %d", + dbesc($prep_arr['html']), + intval($item['id']) + ); + return $prep_arr['html']; } diff --git a/version.inc b/version.inc index 787afe073..06ead016f 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-04-28.1016 +2015-04-30.1018 -- cgit v1.2.3 From e4fe068ed51c3d92cdb416492c3cc0ad26c28c1c Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 30 Apr 2015 18:16:54 -0700 Subject: more performance work --- include/text.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/text.php b/include/text.php index 05251c580..deb5a4c90 100644 --- a/include/text.php +++ b/include/text.php @@ -1185,6 +1185,14 @@ function unobscure(&$item) { $item['title'] = crypto_unencapsulate(json_decode_plus($item['title']),$key); if($item['body']) $item['body'] = crypto_unencapsulate(json_decode_plus($item['body']),$key); + if(get_config('system','item_cache')) { + q("update item set title = '%s', body = '%s', item_flags = %d where id = %d", + dbesc($item['title']), + dbesc($item['body']), + intval($item['item_flags'] - ITEM_OBSCURED), + intval($item['id']) + ); + } } } @@ -1371,7 +1379,7 @@ function generate_named_map($location) { function prepare_body(&$item,$attach = false) { - if(get_config('system','item_cache') && $item['body']) + if(get_config('system','item_cache') && $item['html']) return $item['html']; call_hooks('prepare_body_init', $item); -- cgit v1.2.3