|
|
View previous topic
::
View next topic
|
Author |
Message |
ramon fincken Site's programmer
 Get a free globally recognized avatar It's free!
Joined: 03 Aug 2007 Posts: 416 Location: A'dam/Diemen, The Netherlands
|
Posted: Thu Jun 19, 2008 12:58 pm Post subject: [solution][snipplet] Adding a bbcode parser for Mantis 1.1.1 based on Phpbb2 |
|
|
Allright, you needed to add bbcodes to mantis ?
Here's a howto
Time to install: 2 mins
Code: | OPEN
root/core/string_api.php |
Code: | FIND
# Around line 26
require_once( $t_core_dir . 'bug_api.php' );
require_once( $t_core_dir . 'user_pref_api.php' ); |
Code: | AFTER, ADD
/***************************************************************************
* Parse BBcode hack for Mantis 1.1.1
* @author Ramon Fincken, www.websitefreelancers.nl www.ramonfincken.com
* http://www.ramonfincken.com/permalink/topic48.html
*
* Added: define and require_once
***************************************************************************/
DEFINE('IN_PHPBB',TRUE);
require_once( $t_core_dir . 'bbcode.php' ); |
Code: | FIND
# Around line 81
# --------------------
# Similar to nl2br, but fixes up a problem where new lines are doubled between
# <pre> tags.
# additionally, wrap the text an $p_wrap character intervals if the config is set
function string_nl2br( $p_string, $p_wrap = 100 ) {
$output = ''; |
Code: | AFTER, ADD
/**
* Parse BBcode hack for Mantis 1.1.1
* @author Ramon Fincken, www.websitefreelancers.nl www.ramonfincken.com
*
* Added: bbencode function calls
*/
$match_count = preg_match_all("#\[code\](.*?)\[/code\]#si", $p_string, $matches);
if($match_count) { return($p_string); } |
Code: | FIND
# Around line 133
# --------------------
# Prepare a string for display to HTML and add href anchors for URLs, emails,
# bug references, and cvs references
function string_display_links( $p_string ) {
$p_string = string_display( $p_string );
$p_string = string_insert_hrefs( $p_string );
$p_string = string_process_bug_link( $p_string );
$p_string = string_process_bugnote_link( $p_string );
$p_string = string_process_cvs_link( $p_string ); |
Code: | AFTER, ADD
/**
* Parse BBcode hack for Mantis 1.1.1
* @author Ramon Fincken, www.websitefreelancers.nl www.ramonfincken.com
*
* Added: bbencode function calls
*/
$p_string = bbencode_second_pass(bbencode_first_pass($p_string, ''), '');
|
Code: | FIND
# Around line 157
# --------------------
# Prepare a single line string for display to HTML and add href anchors for
# URLs, emails, bug references, and cvs references
function string_display_line_links( $p_string ) {
$p_string = string_display_line( $p_string );
$p_string = string_insert_hrefs( $p_string );
$p_string = string_process_bug_link( $p_string );
$p_string = string_process_bugnote_link( $p_string );
$p_string = string_process_cvs_link( $p_string ); |
Code: | AFTER, ADD
/**
* Parse BBcode hack for Mantis 1.1.1
* @author Ramon Fincken, www.websitefreelancers.nl www.ramonfincken.com
*
* Added: bbencode function calls
*/
$p_string = bbencode_second_pass(bbencode_first_pass($p_string, ''), '');
|
Code: | COPY
# See zip below for files
bbcode.php TO root/core/bbcode.php
lang_main.php TO root/core/lang_main.php |
http://www.ramonfincken.com/uploads/topic48.zip
Code: | DIY
You can download any valid language pack for phpbb2 and overwrite the lang_main.php in your root/core directory ! |
Last edited by ramon fincken on Wed Feb 04, 2009 2:18 pm; edited 2 times in total |
|
Back to top |
|
 |
Google adsense Advertisement
|
Posted: Thu Jun 19, 2008 12:58 pm Post subject: [solution][snipplet] Adding a bbcode parser for Mantis 1.1.1 based on Phpbb2 |
|
|
Advertisement
|
|
Back to top |
|
 |
GravityForms Advertisement
|
Posted: Thu Jun 19, 2008 12:58 pm Post subject: [solution][snipplet] Adding a bbcode parser for Mantis 1.1.1 based on Phpbb2 |
|
|
Advertisement
 |
|
Back to top |
|
 |
ramon fincken Site's programmer
 Get a free globally recognized avatar It's free!
Joined: 03 Aug 2007 Posts: 416 Location: A'dam/Diemen, The Netherlands
|
|
Back to top |
|
 |
ramon fincken Site's programmer
 Get a free globally recognized avatar It's free!
Joined: 03 Aug 2007 Posts: 416 Location: A'dam/Diemen, The Netherlands
|
Posted: Sun Jun 29, 2008 10:38 am Post subject: Re: [solution][snipplet] Adding a bbcode parser for Mantis 1.1.1 based on Phpbb2 |
|
|
Update @ 29 06 2008
Instuctionset to update below, please scroll up to re-download the zipfile.
I have included a contrib folder.
Code: | OPEN
root/core/string_api.php |
Code: | FIND
# Around line 81
# --------------------
# Similar to nl2br, but fixes up a problem where new lines are doubled between
# <pre> tags.
# additionally, wrap the text an $p_wrap character intervals if the config is set
function string_nl2br( $p_string, $p_wrap = 100 ) {
$output = ''; |
Code: | AFTER, ADD
/**
* Parse BBcode hack for Mantis 1.1.1
* @author Ramon Fincken, www.websitefreelancers.nl www.ramonfincken.com
*
* Added: bbencode function calls
*/
$match_count = preg_match_all("#\[code\](.*?)\[/code\]#si", $p_string, $matches);
if($match_count) { return($p_string); } |
|
|
Back to top |
|
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|