View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003491 | mantisbt | feature | public | 2004-01-07 10:04 | 2018-03-30 05:53 |
Reporter | chipux | Assigned To | vboctor | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | won't fix | ||
Summary | 0003491: Add More BBCode for Mantis Output | ||||
Description |
| ||||
Additional Information | |||||
Tags | bbcode, patch | ||||
Attached Files | 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">) | ||||
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. |
|
How did the irc discussion turn out? Is this a feature that will be added? |
|
duplicate resolved |
|
hmm, should this have been closed? - i.e. what's it a dupe of? |
|
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. |
|
I have written a plugin to allow BBCode (with an editor): |
|
Attachment from chip's url added to bug. |
|
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? |
|
Hi Is there any plugin BBcode for mantis 1.2.* Thanks. |
|
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. |
|
thu.doan, this is not the right place for such kind of questions. |
|
I suggest closing this as won't fix in favor of markdown support that was added for 2.x. |
|