jacem
Posts: 87
|
Posted: 08/13/2007, 12:43 AM |
|
I have found a work around for a problem where FCKEditor doesn't store the complete image URL when inserting images into a FCKEditor enabled field. Usually this isn't an issue unless you are using the field as a HTML email message body.
I set up a FCKEditor field to allow uses to define the message they wanted to bulk email to a table of clients including the FCKEditor ability to upload and insert an image into the BLOB field. I later allowed the users to search and output the clients and as each record in the grid was displayed it generated an email message to the client.
The only problem was the FCKEditor didn't hold the entire path to the image stored in its publicly accessible directory: it was missing the domain name at the start.
So before the mail() function was called (in my case I am using PHP), it did a str_repalce of the $messagetext field (which was created using FCKEditor) to add on the extra domain bits needed for when the message arrived in someone’s Outlook InBox:
$messagetext=str_replace('src="/userfiles/','scr="http://www.mydomain.com.au/userfiles/',$messagetext);
This neatly added the right bit on the front of any image links within the message body so that the images display correctly when they arrive.
Hope it helps someone else out there!
(alas someone will no doubt point out a fckedit option for storing the complete image url so treat this as a sledge hammer way to overcome this).
|
|
|
|