I just figured out how to get FCK Editor to put absolute paths into the HTML it generates and thought I'd share.
You need to edit 2 files:
/editor/dialog/fck_image.html
/editor/dialog/fck_image/fck_image.js
1) In /editor/dialog/fck_image.html add a hidden field under the txtUrl input field.
UNDER THIS:
<input id="txtUrl" style="WIDTH: 100%" type="text" onblur="UpdatePreview();">
PASTE THIS:
<input type="hidden" id="txtPath" />
2) In /editor/dialog/fck_image/fck_image.js comment and replace the following line:
AROUND LINE 123, REPLACE THIS:
GetE('txtUrl').value = sUrl
WITH THIS:
// GetE('txtUrl').value = sUrl ;
GetE('txtUrl').value = sUrl.substring( sUrl.lastIndexOf( '/' ) + 1 ) ;
GetE('txtPath').value = sUrl.substr( 0, sUrl.lastIndexOf( '/' ) + 1 ) ;
3) In /editor/dialog/fck_image/fck_image.js comment and replace the following line:
AROUND LINE 262, REPLACE THIS:
e.src = GetE('txtUrl').value ;
SetAttribute( e, "_fcksavedurl", GetE('txtUrl').value ) ;
WITH THIS:
// e.src = GetE('txtUrl').value ;
e.src = GetE('txtPath').value + GetE('txtUrl').value ;
// SetAttribute( e, "_fcksavedurl", GetE('txtUrl').value ) ;
SetAttribute( e, "_fcksavedurl", e.src ) ;
4) In /editor/dialog/fck_image/fck_image.js comment and replace the following line:
AROUND LINE 415, REPLACE THIS:
GetE('txtUrl').value = url
WITH THIS:
// GetE('txtUrl').value = url ;
GetE('txtUrl').value = url.substring( url.lastIndexOf( '/' ) + 1 ) ;
GetE('txtPath').value = url.substr( 0, url.lastIndexOf( '/' ) + 1 ) ;
You need to edit 2 files:
/editor/dialog/fck_image.html
/editor/dialog/fck_image/fck_image.js
1) In /editor/dialog/fck_image.html add a hidden field under the txtUrl input field.
UNDER THIS:
<input id="txtUrl" style="WIDTH: 100%" type="text" onblur="UpdatePreview();">
PASTE THIS:
<input type="hidden" id="txtPath" />
2) In /editor/dialog/fck_image/fck_image.js comment and replace the following line:
AROUND LINE 123, REPLACE THIS:
GetE('txtUrl').value = sUrl
WITH THIS:
// GetE('txtUrl').value = sUrl ;
GetE('txtUrl').value = sUrl.substring( sUrl.lastIndexOf( '/' ) + 1 ) ;
GetE('txtPath').value = sUrl.substr( 0, sUrl.lastIndexOf( '/' ) + 1 ) ;
3) In /editor/dialog/fck_image/fck_image.js comment and replace the following line:
AROUND LINE 262, REPLACE THIS:
e.src = GetE('txtUrl').value ;
SetAttribute( e, "_fcksavedurl", GetE('txtUrl').value ) ;
WITH THIS:
// e.src = GetE('txtUrl').value ;
e.src = GetE('txtPath').value + GetE('txtUrl').value ;
// SetAttribute( e, "_fcksavedurl", GetE('txtUrl').value ) ;
SetAttribute( e, "_fcksavedurl", e.src ) ;
4) In /editor/dialog/fck_image/fck_image.js comment and replace the following line:
AROUND LINE 415, REPLACE THIS:
GetE('txtUrl').value = url
WITH THIS:
// GetE('txtUrl').value = url ;
GetE('txtUrl').value = url.substring( url.lastIndexOf( '/' ) + 1 ) ;
GetE('txtPath').value = url.substr( 0, url.lastIndexOf( '/' ) + 1 ) ;
RE: Tip: Absolute Image Paths
Hi I try this and it nearly works I now get the 'http:www.mysite.com' added before the imagesbut still the other path so it does not quite work, any ideas?