View Issue Details

IDProjectCategoryView StatusLast Update
0003491mantisbtfeaturepublic2018-03-30 05:53
ReporterchipuxAssigned Tovboctor 
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionwon't fix 
Product Version 
Target VersionFixed in Version 
Summary0003491: Add More BBCode for Mantis Output
Description
  • Adds another function to the string API todo BB Code Transformations.
  • Adds the 'g_html_allow_bb_code' configuration var
Additional Information

http://force-elite.com/~chip/patches/mantis/bbcode.patch

Tagsbbcode, patch

Relationships

has duplicate 0004115 closedgrangeway Allow UBB code in bugnotes, description, etc 
has duplicate 0004482 closedvboctor Support for quoting 
has duplicate 0003658 closedgrangeway html-code in bug-note 

Activities

vboctor

vboctor

2004-03-17 17:05

manager   ~0005229

chipux, lets discuss the addition of bbcode on irc and if we decide to go with it, then we can add the feature to cvs.

joakimwg

joakimwg

2004-07-26 14:17

reporter   ~0006373

How did the irc discussion turn out? Is this a feature that will be added?

thraxisp

thraxisp

2004-07-29 11:38

reporter   ~0006442

duplicate resolved

grangeway

grangeway

2004-09-05 16:04

reporter   ~0007443

hmm, should this have been closed? - i.e. what's it a dupe of?

thraxisp

thraxisp

2004-09-05 17:08

reporter   ~0007446

Oops, 4115 was marked as a duplicate of this one about the same time as it was marked as a duplicate of this one.

This still needs to be done.

deboutv

deboutv

2007-06-17 11:35

reporter   ~0014770

I have written a plugin to allow BBCode (with an editor):
http://deboutv.free.fr/mantis/
http://deboutv.free.fr/mantis/plugin.php?plugin=bbcode

2008-07-13 11:22

 

bbcode.patch (3,622 bytes)
Index: core/string_api.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/string_api.php,v
retrieving revision 1.40
diff -u -r1.40 string_api.php
--- core/string_api.php	24 Aug 2003 02:59:56 -0000	1.40
+++ core/string_api.php	7 Jan 2004 06:54:34 -0000
@@ -38,7 +38,8 @@
 		$p_string = string_insert_hrefs( $p_string );
 		$p_string = string_process_bug_link( $p_string );
 		$p_string = string_process_cvs_link( $p_string );
-		
+		$p_string = string_convert_bb_code( $p_string );
+
 		return $p_string;
 	}
 
@@ -101,6 +102,45 @@
 							 $t_replace_with,
 							 $p_string );
 	}
+
+        # --------------------
+        # Process the $p_string and add BB Code HTML.
+        function string_convert_bb_code ( $p_string ){
+                $t_html_allow_bb_code = config_get( 'html_allow_bb_code' );
+
+                if( ON !== $t_html_allow_bb_code ) {
+                        return $p_string;
+                }
+
+                $t_regex = array(
+                        "/\[b\](.*)\[\/b\]/siU",
+                        "/\[i\](.*)\[\/i\]/siU",
+                        "/\[u\](.*)\[\/u\]/siU",
+                        "/\[s\](.*)\[\/s\]/siU",
+                        "/<a href=\"(.*)\.pdf\"(.*>.*<\/a>)/siU",
+                        "/<a href=\"(.*)\.doc\"(.*>.*<\/a>)/siU",
+                        "/<a href=\"(.*)\.xls\"(.*>.*<\/a>)/siU",
+                        "/<a href=\"(.*)\.avi\"(.*>.*<\/a>)/siU",
+                        "/<a href=\"(.*)\.zip\"(.*>.*<\/a>)/siU",
+                        "/<a href=\"(.*)\.ogg\"(.*>.*<\/a>)/siU",
+                        "/<a href=\"(.*)\.ppt\"(.*>.*<\/a>)/siU"
+                        );
+                $t_replace  = array(
+                        "<span class='bold'>$1</span>",
+                        "<span class='italic'>$1</span>",
+                        "<span class='underline'>$1</span>",
+                        "<span class='strike'>$1</span>",
+                        "<a href=\"$1.pdf\" $2<span style=\"font-size: xx-small\">[.pdf]</span>",
+                        "<a href=\"$1.doc\" $2<span style=\"font-size: xx-small\">[.doc]</span>",
+                        "<a href=\"$1.xls\" $2<span style=\"font-size: xx-small\">[.xls]</span>",
+                        "<a href=\"$1.avi\" $2<span style=\"font-size: xx-small\">[.avi]</span>",
+                        "<a href=\"$1.zip\" $2<span style=\"font-size: xx-small\">[.zip]</span>",
+                        "<a href=\"$1.ogg\" $2<span style=\"font-size: xx-small\">[.ogg]</span>",
+                        "<a href=\"$1.ppt\" $2<span style=\"font-size: xx-small\">[.ppt]</span>"
+                        );
+                return preg_replace($t_regex,$t_replace,$p_string);
+        }
+
 
 	# --------------------
 	# Process $p_string, looking for bug ID references and creating bug view
Index: config_defaults_inc.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/config_defaults_inc.php,v
retrieving revision 1.130
diff -u -r1.130 config_defaults_inc.php
--- config_defaults_inc.php	1 Sep 2003 14:06:57 -0000	1.130
+++ config_defaults_inc.php	7 Jan 2004 06:54:35 -0000
@@ -538,6 +543,9 @@
 	# Set this flag to automatically convert www URLs and
 	# email adresses into clickable links
 	$g_html_make_links		= ON;
+
+        # Set this flag to enable Simple BB Code Style Transformations
+        $g_html_allow_bb_code              = ON;
 
 	# do NOT include href or img tags here
 	# do NOT include tags that have parameters (eg. <font face="arial">)
bbcode.patch (3,622 bytes)
grangeway

grangeway

2008-07-13 11:23

reporter   ~0018429

Attachment from chip's url added to bug.

thehandyman

thehandyman

2010-10-03 23:47

reporter   ~0026937

As far as I can tell deboutv's plugins are not compatible with current release of Mantis (1.2.3). Is this a feature that is planned for future versions of Mantis built in?

thu.doan

thu.doan

2013-07-08 22:43

reporter   ~0037431

Hi

Is there any plugin BBcode for mantis 1.2.*

Thanks.

atrol

atrol

2013-07-09 03:09

developer   ~0037434

https://github.com/mantisbt-plugins/bbcode

thu.doan

thu.doan

2013-07-09 03:20

reporter   ~0037435

Hi,

I installed bbcode plugin already. I wanna ask you about "code" tag. When I use [code=php]...[/code], the code doesn't change the color. How can I make the code colorful? (follow some languages: java, php, C,...).

Thanks.

atrol

atrol

2013-07-09 04:25

developer   ~0037436

thu.doan, this is not the right place for such kind of questions.
bbcode is a 3rd party plugin, you have to contact the author of the plugin.

vboctor

vboctor

2018-03-18 23:38

manager   ~0059237

I suggest closing this as won't fix in favor of markdown support that was added for 2.x.

Issue History

Date Modified Username Field Change
2004-01-07 10:04 chipux New Issue
2004-03-17 17:05 vboctor Note Added: 0005229
2004-07-26 14:17 joakimwg Note Added: 0006373
2004-07-27 09:29 grangeway Relationship added has duplicate 0004115
2004-07-29 11:38 thraxisp Status new => resolved
2004-07-29 11:38 thraxisp Resolution open => fixed
2004-07-29 11:38 thraxisp Assigned To => thraxisp
2004-07-29 11:38 thraxisp Note Added: 0006442
2004-08-29 02:16 vboctor Status resolved => closed
2004-09-05 16:04 grangeway Status closed => feedback
2004-09-05 16:04 grangeway Resolution fixed => reopened
2004-09-05 16:04 grangeway Note Added: 0007443
2004-09-05 17:04 vboctor Relationship added has duplicate 0004482
2004-09-05 17:08 thraxisp Note Added: 0007446
2004-09-05 17:08 thraxisp Status feedback => acknowledged
2004-12-05 09:02 thraxisp Assigned To thraxisp =>
2006-03-02 06:56 ryandesign Relationship added related to 0003658
2007-06-17 11:35 deboutv Note Added: 0014770
2008-07-13 11:22 grangeway File Added: bbcode.patch
2008-07-13 11:23 grangeway Tag Attached: patch
2008-07-13 11:23 grangeway Note Added: 0018429
2008-07-13 12:23 grangeway Relationship replaced has duplicate 0003658
2009-05-26 05:52 Kirill Tag Attached: bbcode
2010-10-03 23:47 thehandyman Note Added: 0026937
2010-10-03 23:47 thehandyman Sponsorship Added thehandyman: US$ 10
2010-10-03 23:47 thehandyman Sponsorship Total 0 => 10
2013-07-08 22:43 thu.doan Note Added: 0037431
2013-07-09 03:09 atrol Note Added: 0037434
2013-07-09 03:20 thu.doan Note Added: 0037435
2013-07-09 04:25 atrol Note Added: 0037436
2018-03-18 23:38 vboctor Note Added: 0059237
2018-03-19 02:56 atrol Assigned To => vboctor
2018-03-19 02:56 atrol Status acknowledged => resolved
2018-03-19 02:56 atrol Resolution reopened => won't fix
2018-03-30 05:53 atrol Status resolved => closed