Top Poster
#1 ramon fincken 400
#2 Site admin 3
#3 Ber|Art 2
#4 braddmark 1
#5 accentmedia 1
#6 Xarzu 1
#7 pEcosespedex 1
#8 khadish 1
#9 moxxx 1
#10 nistelrock 1
[solution][snipplet] Adding a bbcode parser for Mantis 1.1.1 based on Phpbb2



Rating : 3.7 / 5

 
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding
Beta
Want to be notified by email when this topic gets a reply?  
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: 400
Location: A'dam/Diemen, The Netherlands

PostPosted: Thu Jun 19, 2008 12:58 pm    Post subject: [solution][snipplet] Adding a bbcode parser for Mantis 1.1.1 based on Phpbb2 Reply with quote

Allright, you needed to add bbcodes to mantis ?


Here's a howto Smile

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
View user's profile Send private message Visit poster's website
Google adsense
Advertisement





PostPosted: 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





PostPosted: Thu Jun 19, 2008 12:58 pm    Post subject: [solution][snipplet] Adding a bbcode parser for Mantis 1.1.1 based on Phpbb2

Advertisement
Gravity Forms Plugin for WordPress
Back to top
ramon fincken
Site's programmer

Get a free globally recognized avatar
It's free!


Joined: 03 Aug 2007
Posts: 400
Location: A'dam/Diemen, The Netherlands

PostPosted: Fri Jun 27, 2008 7:37 am    Post subject: Re: [solution][snipplet] Adding a bbcode parser for Mantis 1.1.1 based on Phpbb2 Reply with quote

Linked @ http://www.mantisbt.org/forums/viewtopi...amp;t=5753
Back to top
View user's profile Send private message Visit poster's website
ramon fincken
Site's programmer

Get a free globally recognized avatar
It's free!


Joined: 03 Aug 2007
Posts: 400
Location: A'dam/Diemen, The Netherlands

PostPosted: Sun Jun 29, 2008 10:38 am    Post subject: Re: [solution][snipplet] Adding a bbcode parser for Mantis 1.1.1 based on Phpbb2 Reply with quote

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
View user's profile Send private message Visit poster's website
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding All times are GMT
Page 1 of 1

 
Jump to:  
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
General forums
The world of freelance
Programming
Other projects
Poll
I love gifts

Yes goodies and presents! [3]
No but I love polls ! [1]

Related google ads