• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Message Parser

Message Parser 1.0

No permission to download
Provides ability to change final message content when message is saved.

AndyB

Well-known member
#1
AndyB submitted a new resource:

Message Parser - Provides ability to change final message content when message is saved.

Description:

Provides ability to change final message content when message is saved.

Editing th DataWriter.php file:

This add-on requires editing the following file:

library/Andy/MessageParser/DataWriter.php

By default you will see the following line:

PHP:
$messageParsed = preg_replace('/test123456789/i', '', $messageParsed);
This will remove the word "test123456789" from the message as soon as it's saved. You will want to change this line of code as needed for your...
Read more about this resource...
 

AndyB

Well-known member
#2
Here's an example where the [ IMG ] tags would be converted to [ URL ] tags.

PHP:
        //########################################
        // start preg_replace
        //########################################       
       
        // replace [IMG] with [URL]
        $messageParsed = preg_replace('/\[IMG\]/i', '[URL]', $messageParsed);
       
        // replace [/IMG] with [/URL]
        $messageParsed = preg_replace('/\[\/IMG\]/i', '[/URL]', $messageParsed);
       
        //########################################
        // end preg_replace
        //########################################