This one's a head scratcher. Can't seem to weed through the code
to figure out what's happening. What I want to do is post images
using relative links (eg. <a href="img/pic.gif">).
The built in Add Image icon pulls up a dialog where an address of the
picture is entered and clicking submit puts the picture in the
post. However, if I put the relative link: "img/pic.gif" in
the dialog and press submit, the picture shows up fine, but the
database entry shows that an explicit URL was entered. If I
change the database entry to be relative, the picture shows up fine.
So, I guess my question is, where in the world does the explicit URL
occur? I've dug into the RTE_image_window.asp file and found what
I suspect is the code I'm looking for:
If Request.Form("URL") <> "http://" AND Request.Form("URL") <> "" Then
'Initilise variable
strBuildImageHTML = ""
'Get form elements
strImageURL = Request.Form("URL")
strImageAltText = Request.Form("Alt")
strAlign = Request.Form("align")
intBorder = Request.Form("border")
If isNumeric(Request.Form("hoz")) Then lngHorizontal = CLng(Request.Form("hoz"))
If isNumeric(Request.Form("vert")) Then lngVerical = CLng(Request.Form("vert"))
'Build the HTML for the image insert
strBuildImageHTML = "<img src=""" & strImageURL & """ border=""" & intBorder & """"
If lngHorizontal <> 0 Then strBuildImageHTML =
strBuildImageHTML & " hspace=""" & lngHorizontal & """"
If lngVerical <> 0 Then strBuildImageHTML =
strBuildImageHTML & " vspace=""" & lngVerical & """"
If strImageAltText <> "" Then
strBuildImageHTML = strBuildImageHTML & " alt=""" &
strImageAltText & """"
If strAlign <> "" Then strBuildImageHTML
= strBuildImageHTML & " align=""" & strAlign & """"
strBuildImageHTML = strBuildImageHTML & " />"
End If
'If the HTML has been built then run the following JavaScript
If strBuildImageHTML <> "" Then
Response.Write("<script language=""JavaScript"">")
'If this is windows IE 5.0 use different JavaScript
If RTEenabled = "winIE5" Then
%>
window.opener.frames.messageTD.focus();
var htmlLink = window.opener.frames.messageTD.document.selection.createRang e()
htmlLink.pasteHTML('<% = strBuildImageHTML %>');
window.opener.frames.messageTD.document.execCommand('paste', false, '');
window.close();<%
'Else use the following javascript
Else
%>
window.opener.document.getElementById("messageTD").contentWi ndow.focus();
var htmlLink =
window.opener.document.getElementById("messageTD").conten tWindow.document.selection.createRange()
htmlLink.pasteHTML('<% = strBuildImageHTML %>');
window.opener.document.getElementById("messageTD").contentWi ndow.document.execCommand('paste', false, '');
window.close();<%
End If
Response.Write("</script>")
But nowhere in this code is the explicit URL defined...or am I missing something?
|