Hi,
as a newbie to FCKeditor I have problems to integrate it with my CMS.
Maybe someone can help me
The code is as follows ("wysiwyg" is the path to the already installed but unuseful editor I want to change to FCKeditor):
<?
error_reporting(E_ERROR);
echo"
<html>
<head>
<script language=\"JavaScript\">
function zeigen(was)
{
del();";
if ($ordnerauf = opendir('../content/'))
{
$hoch = 0;
while (false !== ($textdatei2 = readdir($ordnerauf)))
{
if ($textdatei2 != "." && $textdatei2 != ".." && stristr($textdatei2 , '_rs') === FALSE)
{
$textdatei = ereg_replace('.txt','',$textdatei2);
$hoch = $hoch+1;
$loescher = "info_".$hoch;
echo"
if(was == '".$hoch."')
{
document.all.".$loescher.".innerHTML = ' <b>Inhalt von \"".$textdatei."\"<br></b><iframe style=\"width:100%;height:auto;border:0px;align=left\" src=\"in.php?einfueg=".$textdatei.".txt\" frameborder=0></iframe></td><td valign=left align=left><a href=\'wysiwyg/editor.php?datei=".ereg_replace('.txt','',$textdatei2)."\' target=\'_blank\'><br><br>Bearbeiten</a></td></tr></table>';
}";
}
}
closedir($ordnerauf);
}
echo"
}
function del()
{";
if ($ordnerauf = opendir('../content/'))
{
$hoch = 0;
while (false !== ($textdatei = readdir($ordnerauf)))
{
if ($textdatei != "." && $textdatei != ".." && stristr($textdatei , '_rs') === FALSE)
{
$hoch = $hoch+1;
$loescher = "info_".$hoch;
echo"
document.all.".$loescher.".innerHTML = '<b> ".ereg_replace('.txt','',$textdatei)."</b>';";
}
}
closedir($ordnerauf);
}
echo"
}
</script>
</head>
<body>
<table bgcolor='#0071b7' width=100% style='border-collapse:collapse;border:0px solid #FFFFFF' >
<tr>
<td align=center>
<font face=arial size=2 color='#FFFFFF'\>
<br> Bitte wählen Sie den Text, der geändert werden soll und klicken Sie dann auf Bearbeiten:
</b>
<br>
<br>
<script language=\"JavaScript\">
";
echo"document.write('<div align=center style=\"width:100%\"><table style=\"border:0px solid black;background-repeat:repeat-x\" width=100% cellpadding=2 cellspacing=2 bgcolor=#0071B7>');";
if ($ordnerauf = opendir('../content/'))
{
$index = 0;
while (false !== ($textdatei = readdir($ordnerauf)))
{
if ($textdatei != "." && $textdatei != ".." && stristr($textdatei , '_rs') === FALSE)
{
$index = $index + 1;
echo"
document.write('<tr bgcolor=#FFFFFF><td colspan=2 background=\'color:#FFFFFF\' onclick=\"zeigen(".$index.")\" >";
echo"<div id=info_".$index." style=\'color:#0071B7\'><b> ".ereg_replace('.txt','',$textdatei)."</b></div>";
echo"</td></tr>');";
}
}
closedir($ordnerauf);
}
echo"
document.write('</table></div>');
</script><br><br>
</td>
</tr>
</table>
<br>
<IMG SRC='http://perpicx.com/rs/admin/line.gif'>
<br>
<br>
<font face=arial size=2 color=white><b>Ein Bild hochladen:</b></font>
<form action=index.php method=post enctype='multipart/form-data'>
<input type=file size=20 name=datei>
<button name=hochladen type=submit><font face=arial size=2>hochladen</font></button>
</form>";
if(isset($_POST["hochladen"]))
{
$bildname = $_FILES['datei']['name'];
if ($_FILES['datei']['error'] != UPLOAD_ERR_OK)
{
echo"<font face=arial size=3 color=#FFFFFF><b>ES IST EIN FEHLER BEIM UPLOAD AUFGETRETEN!</b></font>";
}
else if($bildname != '')
{
move_uploaded_file($_FILES['datei']['tmp_name'],
$_SERVER['DOCUMENT_ROOT']."/rs/assets/images-rs/".$bildname);
chmod($_SERVER['DOCUMENT_ROOT']."rs/assets/images-rs/$bildname", 777);
echo"<font face=tahoma size=2 color=#FFFFFF><b>Das Bild \"".$bildname."\" wurde erfolgreich
hochgeladen!</b></font>";
}
}
echo"
</body>
</html>
";
?>
Thu, 08/21/2008 - 16:32
#1