Koden er her:
<!--#include file="common.asp" -->
<%
'Dimension veriables
Dim strImageURL
Dim strImageAltText
Dim strAlign
Dim intBorder
Dim lngHorizontal
Dim lngVerical
Dim strBuildImageHTML
'If this a post back read in the form elements
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"))
If isNumeric(Request.Form("hoz")) Then lngHorizontal = 100000
If isNumeric(Request.Form("vert")) Then lngVerical = 100000
'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.message.focus();
var htmlLink = window.opener.frames.message.document.selection.createRange()
htmlLink.pasteHTML('<% = strBuildImageHTML %>');
window.opener.frames.message.document.execCommand('paste', false, '');
window.close();<%
'Else use the following javascript
Else
%>
window.opener.document.getElementById("message").contentWindow.focus();
var htmlLink = window.opener.document.getElementById("message").contentWindow.document.selection.createRange()
htmlLink.pasteHTML('<% = strBuildImageHTML %>');
window.opener.document.getElementById("message").contentWindow.document.execCommand('paste', false, '');
window.close();<%
End If
Response.Write("</script>")
End If
%>
<html>
<head>
<title>Insert Image</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- Web Wiz Rich Text Editor ver. <% = strRTEversion %> is written and produced by Bruce Corkhill ©2002-2004
If you want your own Rich Text Editor then goto
http://www.richtexteditor.org -->
<style type="text/css">
<!--
html, body {
background: ButtonFace;
color: ButtonText;
font: font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
margin: 2px;
padding: 4px;
}
legend {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style>
<link href="includes/default_style.css" rel="stylesheet" type="text/css" />
</head>
<body OnLoad="self.focus(); document.forms.frmImageInsrt.Submit.disabled=true;" style="background-color: #FFFFFF; background-image: url('../pix/background.gif')">
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="0">
<form method="post" name="frmImageInsrt">
<tr>
<td colspan="2">
<fieldset style="float: left;">
<legend><% = strTxtImage %></legend>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="29%" align="right" class="text"><% = strTxtImageURL %>:</td>
<td width="71%"><input name="URL" type="text" id="URL" size="40" value="
http://" onfocus="document.forms.frmImageInsrt.Submit.disabled=false;">
</td>
</tr>
<tr>
<td align="right" class="text"><% = strTxtAlternativeText %>:</td>
<td><input name="Alt" type="text" id="Alt" size="40"></td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td width="51%">
<fieldset style="float: left;">
<legend><% = strTxtLayout %></legend>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td align="right" class="text"><% = strTxtAlignment %>:</td>
<td><select size="1" name="align" id="align">
<option value="" selected >Default</option>
<option value="left">Left</option>
<option value="right">Right</option>
<option value="texttop">Texttop</option>
<option value="absmiddle">Absmiddle</option>
<option value="baseline">Baseline</option>
<option value="absbottom">Absbottom</option>
<option value="bottom">Bottom</option>
<option value="middle">Middle</option>
<option value="top">Top</option>
</select></td>
</tr>
<tr>
<td align="right" class="text"><% = strTxtBorder %>:</td>
<td><select name="border" id="border">
<option selected>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
</select></td>
</tr>
</table>
</fieldset>
</td>
<td width="49%">
<fieldset style="float: left;">
<legend><% = strTxtSpacing %></legend>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="50%" align="right" class="text"><% = strTxtHorizontal %>:</td>
<td width="50%"><input name="hoz" type="text" id="hoz" size="4" maxlength="7" /></td>
</tr>
<tr>
<td align="right" class="text"><% = strTxtVertical %>:</td>
<td>
<input name="vert" type="text" id="vert" size="4" maxlength="7" /></td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td><br>
</td>
<td>
</td>
</tr>
<tr align="right">
<td colspan="2">
<input type="submit" name="Submit" value=" <% = strTxtOK %> ">
<input type="button" name="cancel" value=" <% = strTxtCancel %> " onClick="window.close()"></td>
</tr>
</table>
<%
Dim ADO_Connection
Dim rsImage
Dim SQL_STRING
set ADO_Connection = server.Createobject("ADODB.Connection")
ADO_Connection.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../../../cgi-data/db.mdb")
set rsImage = server.Createobject("ADODB.Recordset")
SQL_String = "Select * from images"
rsImage.open SQL_String, ADO_Connection
%>
<table border="0" cellpadding="0" cellspacing="0" width="40%">
<tr>
<td width="100%" align="center"><font size="1" face="Verdana"><strong></strong>Billed liste</font></td>
</tr>
</table>
<br>
<% Do While Not rsImage.EOF %>
<table border="0" cellpadding="0" cellspacing="4" width="40%" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td rowspan="3" width="25%">
<font face="Arial" style="font-size: 8pt">
<input type="image" name="Submit" src="../../../images/<%=rsImage("Images")%>.<%=rsImage("Filtype")%>" value=" ../../../images/<%=rsImage("Images")%>.<%=rsImage("Filtype")%> " height=50 width=50 border=0>
<td width="75%"></td>
</tr>
<tr>
<td width="75%"><font face="Arial" style="font-size: 8pt"><b>Navn:</b></font></td>
</tr>
<tr>
<td width="75%">
<font face="Arial" style="font-size: 8pt"><%=rsImage("Images")%>.<%=rsImage("Filtype")%>
</td>
</tr>
</table>
</form>
<%
rsImage.MoveNext
Loop
ADO_Connection.Close
Set ADO_Connection= Nothing
%>
</body>
</html>