Clickable URL's in Messages

This topic contains 4 reply and 3 voices, and was last updated by Mahi 10 years, 11 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
May 20, 2013 at 7:53 pm 3887
Mahi Hi everyone I'm using this plugin for one of my projects and my client asked me to add the ability to have the URL's that are put into messages be automatically linked inside the message box. I have added the following code: $pattern = "/\[link\=(.*)\](.*)\[\/link\]/i"; $replace = "$2"; echo preg_replace($pattern, $replace, $subject); and it does work inside a comment to the message, but it does not work in the message box when you first create a message. Anyone have any ideas. A file perhaps that I also need to add the above code, or an entirely different code snippet? Any thoughts are greatly appreciated.
May 20, 2013 at 8:32 pm 3895
Tareq Hasan Tareq Hasan

You don’t need any regex, just use this single line:
[php]add_filter( ‘cpm_get_content’, ‘make_clickable’ );[/php]

May 20, 2013 at 9:32 pm 3897
helpfulnerd helpfulnerd

Where do I add that code? Do I add that in the CPM.php file?

Thanks

May 20, 2013 at 9:38 pm 3898
helpfulnerd helpfulnerd

Nevermind. I added this code to CPM.php and everything is working. Thanks

May 20, 2013 at 9:40 pm 3900
Mahi Mahi

Glad to know it solved. Cheers.

Viewing 4 Posts - 1 through 4 (of 4 total)