Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Add Image - relative link
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Add Image - relative link

 Post Reply Post Reply
Author
skrile View Drop Down
Newbie
Newbie
Avatar

Joined: 17 May 2002
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote skrile Quote  Post ReplyReply Direct Link To This Post Topic: Add Image - relative link
    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?
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.