<? /// (c) 2005 by PEET alias ANDULUS alias Andi ?>
<html>
<head>
<title>Peet_Edit_1.0</title>
<style type="text/css">
<!--
.Stil1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #990000;
}
.Stil2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
}
-->
</style>
</head>
<script>
function format(command, parameter)
{
divEditable.focus();
document.execCommand(command, false, parameter);
}
function save(){
main.elements[0].value=document.all.divEditable.innerHTML;
document.main.action ="admin.php";
document.main.submit();
}
function insertImage()
{
window.document.getElementById("divEditable").focus();
thetext = window.document.selection.createRange();
if (thetext.text != undefined) {
swnd = window.showModalDialog("image.html", "", "dialogHeight: 193px;dialogWidth: 428px;status:no;");
if (swnd[0] != "") {
text2paste = "<img src=\""+swnd[0]+"\" alt=\""+swnd[1]+"\"";
if (swnd[2] != "") {
text2paste += " border=\""+swnd[2]+"\"";
}
if (swnd[3] != "none") {
text2paste += " align=\""+swnd[3]+"\"";
}
if (swnd[4] != "") {
text2paste += " hspace=\""+swnd[4]+"\"";
}
if (swnd[5] != "") {
text2paste += " vspace=\""+swnd[5]+"\"";
}
text2paste += ">";
thetext.pasteHTML(text2paste);
}
} else {
window.document.execCommand("InsertImage", true);
}
}
</script>
<?
session_start();
?>
<body>
<a href="../uploaden.php" target="blank" class="Stil2">Bild uploaden</a><br>
<br>
<img src="save.gif" onClick="format('SaveAs', '');">
<img src="link.gif" onClick="format('CreateLink', '');">
<img src="copy.gif" onClick="format('Copy', '');">
<img src="cut.gif" onClick="format('Cut', '');">
<img src="paste.gif" onClick="format('Paste', '');">
<img src="bild.gif" onClick="insertImage();";>
<img src="fett.gif" onClick="format('Bold', '');">
<img src="kursiv.gif" onClick="format('Italic',
'');">
<img src="under.gif" onClick="format('Underline',
'');">
<img src="links.gif" onClick="format('JustifyLeft',
'');">
<img src="mitte.gif" onClick="format('JustifyCenter',
'');">
<img src="rechts.gif" onClick="format('JustifyRight',
'');">
<img src="black.gif" onClick="format('ForeColor', 'black');">
<img src="red.gif" onClick="format('ForeColor', 'red');">
<img src="blue.gif" onClick="format('ForeColor', 'blue');">
<img src="1.gif" onClick="format('FontSize', 1);">
<img src="2.gif" onClick="format('FontSize', 3);">
<img src="3.gif" onClick="format('FontSize', 5);">
<img src="4.gif" onClick="format('FontSize', 7);">
<img src="a.gif" onClick="format('FontName', 'Arial');">
<img src="t.gif" onClick="format('FontName', 'Times New
Roman');">
<img src="c.gif" onClick="format('FontName', 'Courier New');">
<?
echo " <form name=\"main\" method=\"post\">\n";
echo " <input type=\"hidden\" name=\"content\">\n";
echo " </form>\n";
?>
<?
$verbindung = mysql_connect(localhost, greenmen, greenmen);
$datab = 'greenmen';
mysql_select_db($datab, $verbindung);
$tabelle = 'wysiwyg';
$cid = $_GET['id'];
$ergebnis = mysql_query("SELECT * FROM $tabelle WHERE cid = '$cid'");
?>
<div style="height:300; width=597; background-color:white;
font-face:Arial; padding:3; border:inset 2px;
overflow=auto;"
id="divEditable" contenteditable>
<? // START INHALT
while($row = mysql_fetch_object($ergebnis)) {
echo $row->content; }
//END INHALT ?>
</div>
<?
echo "<button onclick=\"save();\">Speichern</button>";
?>
<p class="Stil1">by PEET 2005
</body>
</html>