Message Parser

Message Parser 1.0

No permission to download

AndyB

Well-known member
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...
 
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
        //########################################
 
Top Bottom