[phpBB2] help with code tag modifications

Discussion in 'Programming' started by Divvy, Oct 28, 2009.

  1. CodedCaffeine

    CodedCaffeine Peon

    Messages:
    130
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #21
    Mhm. A simple change:

    (Line 596) FIND:
    $after_replace = preg_replace("#([\w]+?[:]//[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "<a href=\"\\1\">\\1</a>", $after_replace);
    PHP:
    (Line 596) REPLACE WITH:
    $after_replace = preg_replace("#([\w]+?[:]//[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "<a href=\"\\1\" target="_blank">\\1</a>", $after_replace);
    PHP:
     
    CodedCaffeine, Oct 29, 2009 IP
  2. Divvy

    Divvy Well-Known Member

    Messages:
    785
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #22
    Didn't work :p

    Parse error: syntax error, unexpected T_STRING in /home/only/public_html/includes/bbcode.php on line 596
    Code (markup):
     
    Divvy, Oct 29, 2009 IP
  3. CodedCaffeine

    CodedCaffeine Peon

    Messages:
    130
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #23
    HAHAHAHAAHA, I'm just a little tired. Forgot to escape the quotes.

    (Line 596) REPLACE WITH:
    $after_replace = preg_replace("#([\w]+?[:]//[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "<a href=\"\\1\" target=\"_blank\">\\1</a>", $after_replace);
    PHP:
     
    CodedCaffeine, Oct 29, 2009 IP
  4. Divvy

    Divvy Well-Known Member

    Messages:
    785
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #24
    Done!

    Changed with:
    $after_replace = preg_replace("#([\w]+?[:]//[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "<a href=\"\\1\" target=\"_blank\">\\1</a>", $after_replace);
    Code (markup):
    The code is correct right? Its working :)
     
    Divvy, Oct 29, 2009 IP
  5. Divvy

    Divvy Well-Known Member

    Messages:
    785
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #25
    I notice that. Thank you again mate :)
     
    Divvy, Oct 29, 2009 IP
  6. pikkapikkasteve

    pikkapikkasteve Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #26
    hi
    i'm working for create a private message module like facebook's, wich can read into my portal (harryweb.net) the old private message (wich is phpBB) shorted by conversation with user, and can reply to the message and add the message in the same conversation.

    i've created 2 function.
    - one insert into text (because user can reply at the message) the BBcode
    - and another read the BBcode and convert it into HTML.

    the first is: function BBCode_insert
    the second is: function BBCode

    i think u can help me, because, i've a BIG problem with the code TAG.
    because into the tag, the posted text is altready converted in HTML.
    how can i correct the problem???
     

    Attached Files:

    pikkapikkasteve, Nov 3, 2009 IP