jeg har set mig lidt varm på det her script:
www.phoenixv.dk/wysiwyg/jeg har en asp kode hvor min gamle function er med fed script:
ses her:
<%
mode = request("mode")
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("sider.mdb")
Conn.Open DSN
set rs = server.createobject("ADODB.Recordset")
sql = "select * from indhold where side=1;"
rs.open sql, conn
while not rs.eof
indhold = rs("indhold")
titel = rs("titel")
rs.movenext
wend
if mode = "" then
rs.close
set rs = nothing
conn.close
set conn = nothing
%>
<html>
<head>
<title>aboutadmin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
function ex() {
document.ifr.focus();
com = ex.arguments[0];
if (ex.arguments.length == 1)
document.ifr.document.execCommand(com, false);
else {
sec = ex.arguments[1];
if (sec != null) {
if (com == "InsertImage") {
algn = confirm("Tryk OK for at venstrestille billedet, Anullér for at højrestille!");
document.ifr.focus();
document.ifr.document.selection.createRange().pasteHTML('<img src="' + sec + '" border="0" align="' + ((algn) ? "left" : "right") + '">');
}
else
document.ifr.document.execCommand(com, false, sec);
}
}
document.ifr.focus();
}
spalteAntal = 1;
function spalter() {
if (!confirm("Vil du ændre antallet af spalter til " + (3 - spalteAntal) + "?"))
return;
spalteAntal = 3 - spalteAntal;
if (spalteAntal == 2) {
indhold = document.ifr.document.body.innerHTML;
halv1 = indhold.substring(0, Math.round(indhold.length / 2));
halv2 = "";
if (halv1.indexOf("<") != -1 && halv1.lastIndexOf("<") > halv1.lastIndexOf(">")) {
halv2 = halv1.substring(halv1.lastIndexOf("<"), halv1.length);
halv1 = halv1.substring(0, halv1.lastIndexOf("<"));
}
halv2 += indhold.substring(Math.round(indhold.length / 2), indhold.length);
document.ifr.document.body.innerHTML = '<table width="100%" height="90%" border="0"><tr><td width="50%" valign="top" id="spalte1">' + halv1 + '</td><td width="50%" valign="top" id="spalte2">' + halv2 + '</td></tr></table>';
}
else
document.ifr.document.body.innerHTML = document.ifr.document.all.spalte1.innerHTML + document.ifr.document.all.spalte2.innerHTML;
document.ifr.focus();
}
farv = null;
function farve() {
if (farv && !farv.closed)
farv.focus();
else
farv = window.open("mini_wysiwyg_farve.html", "farveVindue", "width=530,height=270,left=300,top=50,toolbars=no,scrollbars=no,status=no,resizable=no");
}
function prev() {
win = window.open("", "prevVindue", "width=400,height=300,left=300,top=50,toolbars=no,scrollbars=yes,status=yes,resizable=yes");
win.document.write("<html><head><title>Smugkig</title></head><body>" + document.ifr.document.body.innerHTML + "</body></html>");
}
</script>
<script language='javascript'>
function fed()
{
sT = document.selection.createRange();
sTxt = sT.text;
if(!sTxt.length > 0) { return( false); }
sT.text = "<B>" + sTxt + "</B>";
}
</script>
</head>
<body>
<table width="45%" height="392" align="center" ></table>
<tr valign=top>
<td height="386">
<div align="center"><form>
<p><input type='button' value='Fed' onClick="fed()"><br>
</p><form action="aboutadmin.asp?mode=update">
<input type="hidden" name="mode" value="add">
<p><textarea name="indhold1" cols="70" rows="20" ><% =indhold %></textarea><br>
<input name="Godkend" type="submit" value="Godkend">
</form>
</p></a></div></td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</body>
</html>
<%
else
indhold2 = Trim(Replace(request.querystring("indhold1"),"'","`" ))
indhold2 = replace(indhold2, vbCrLF, "<br>")
SQL2 = "update indhold set indhold ='" & indhold2 & "' where side = 1;"
rs = Conn.Execute(SQL2)
response.redirect("about.asp")
end if
%>
mit spørgsmål er bare om du ka sætte min asp kode ind i den her
www.phoenixv.dk/wysiwyg/så det vil komme til af du?
eller ska jeg oprettet et nyt spam i asp?