Print Page | Close Window

Add Image - relative link

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=9697
Printed Date: 07 April 2026 at 11:38pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Add Image - relative link
Posted By: skrile
Subject: Add Image - relative link
Date Posted: 10 February 2004 at 8:33am
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?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net