Hi there i am currently playing with htmlarea which is an opensource online wysiwyg editor.
I am trying to configure it to open a particular page so the client can modify it then save it and it will automatically update it on the server.
I have been playing with it for a while but no luck.
Would love some help if anyone has any idea how do configure it.
this is the code from the page where the editor sits
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<TITLE>WEBstationONE: WYSIWYG OnLine Editor</TITLE>
<script language="Javascript1.2"><!-- // load htmlarea
editor_url = ""; // URL to htmlarea files
editor_field = "";
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
var MyBgColor ='#FFFFFF';
var MyBgImg ='';
// --></script>
<script>
function updateAttributes(){
document.myform.bgcolor.value=MyBgColor;
document.myform.background.value=MyBgImg;
}
</script>
<STYLE TYPE="text/css">
.headtext { font-size:10pt;font-weight:bold; }
TD, DIV {font:9pt Verdana,Arial, Helvetica, sans-serif;}
</STYLE>
</head>
<BODY BGCOLOR="#FFFFFF" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" onload="goContext(); java script🙁hide();">
<!-- Create the licensing object for the common dialog activex control -->
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331">
<PARAM NAME="LPKPath" VALUE="comdlg.lpk">
</OBJECT>
<!--Create the Common Dialog Box activex control-->
<OBJECT ID="cDialog" WIDTH="10px" HEIGHT="10px" CLASSID="CLSID:F9043C85-F6F2-101A-A3C9-08002B2F49FB" CODEBASE="http://activex.microsoft.com/controls/vb5/comdlg32.cab"></OBJECT>
<FORM ACTION="save.php" METHOD="post">
<!-- These hidden fields are intended to pass the attributes values to the submission script. They will be updated when clicking the submit button-->
<INPUT TYPE="hidden" NAME="bgcolor" VALUE="">
<INPUT TYPE="hidden" NAME="background" VALUE="">
<DIV ALIGN="center">
<textarea cols="" rows="" name="Body" style="width:700px; height:150;">
<body>
<? include("../announcements.html"); ?>
</body>
</textarea>
<table align="center" width="700px" cellpadding="0" cellspacing="0" bgcolor="buttonface" style="border: 1px solid #999999;">
<tr><td ALIGN="center" COLSPAN="2">
<a href="java script:editor_insertHTML('Body','<font style='background-color: yellow'>','</font>',1);">Highlight selected text</a>
<a href="java script:editor_insertHTML('Body','🙂');">Insert Smiley</a>
<a href="java script:alert(editor_getHTML('Body'));">getHTML</a>
<a href="java script:editor_setHTML('Body','<B>Hello World!!</B>');">setHTML</a><BR> <br>
<INPUT TYPE="submit" NAME="fname" VALUE="Save">
<br><br>
</td></tr>
</table>
<script language='javascript1.2'>
editor_generate('Body');
WriteMenuItems('Body');
</script>
</div>
</body>
</html>
and then there is the save.php file which i am trying to configure to save the file announcements.html
function writefile($filename, $data, $mode)
{
$fp = fopen($filename, $mode);
fwrite($fp, $data);
fclose($fp);
}
i downloaded that save.php code from the htmlarea forum but no luck on that.
Would love some help here guys
Enrico