From b12d4c03cbc2627774b279f17a413860d868e854 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 4 Dec 2016 12:51:23 +0100 Subject: fixes for toc bbcode and bbcode wiki toc --- include/bbcode.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/bbcode.php b/include/bbcode.php index 6794fca96..396cbcb29 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -824,12 +824,14 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) $Text = preg_replace("(\[h6\](.*?)\[\/h6\])ism",'
$1
',$Text); } // Check for table of content without params - if (strpos($Text,'[toc]') !== false) { - $Text = preg_replace("/\[toc\]/ism",'',$Text); + while(strpos($Text,'[toc]') !== false) { + $toc_id = 'toc-' . random_string(10); + $Text = preg_replace("/\[toc\]/ism", '' . t('Contents:') . '', $Text, 1); } // Check for table of content with params - if (strpos($Text,'[toc') !== false) { - $Text = preg_replace("/\[toc([^\]]+?)\]/ism",'',$Text); + while(strpos($Text,'[toc') !== false) { + $toc_id = 'toc-' . random_string(10); + $Text = preg_replace("/\[toc([^\]]+?)\]/ism", '' . t('Contents:') . '', $Text, 1); } // Check for centered text if (strpos($Text,'[/center]') !== false) { -- cgit v1.2.3 From 161572b292600b8f1eab4049ddb6ab07f97a0126 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 4 Dec 2016 14:31:45 +0100 Subject: leave toc title for the author --- include/bbcode.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/bbcode.php b/include/bbcode.php index 396cbcb29..b315255f5 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -826,12 +826,12 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) // Check for table of content without params while(strpos($Text,'[toc]') !== false) { $toc_id = 'toc-' . random_string(10); - $Text = preg_replace("/\[toc\]/ism", '' . t('Contents:') . '
    ', $Text, 1); + $Text = preg_replace("/\[toc\]/ism", '
      ', $Text, 1); } // Check for table of content with params while(strpos($Text,'[toc') !== false) { $toc_id = 'toc-' . random_string(10); - $Text = preg_replace("/\[toc([^\]]+?)\]/ism", '' . t('Contents:') . '
        ', $Text, 1); + $Text = preg_replace("/\[toc([^\]]+?)\]/ism", '
          ', $Text, 1); } // Check for centered text if (strpos($Text,'[/center]') !== false) { -- cgit v1.2.3 From bb7680dc51723d3166bac005fd8f8510be8cfd01 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 4 Dec 2016 15:07:03 +0100 Subject: implement content type in wiki list --- include/wiki.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/wiki.php b/include/wiki.php index dd5dbbe11..542d617b9 100644 --- a/include/wiki.php +++ b/include/wiki.php @@ -19,7 +19,7 @@ function wiki_list($channel, $observer_hash) { $w['htmlName'] = get_iconfig($w, 'wiki', 'htmlName'); $w['urlName'] = get_iconfig($w, 'wiki', 'urlName'); $w['path'] = get_iconfig($w, 'wiki', 'path'); - $w['path'] = get_iconfig($w, 'wiki', 'mimeType'); + $w['mimeType'] = get_iconfig($w, 'wiki', 'mimeType'); } } // TODO: query db for wikis the observer can access. Return with two lists, for read and write access -- cgit v1.2.3