Hi,
I would like to implement FCK into Minisite from Codeview, but I don't know how to achieve this. Unfortunately, I couldn't get the javascript code working to change a text area into FCK, but I don't know why. This is my code:
---------------------
I would like to implement FCK into Minisite from Codeview, but I don't know how to achieve this. Unfortunately, I couldn't get the javascript code working to change a text area into FCK, but I don't know why. This is my code:
---------------------
<?php require_once("common.php"); include("../FCKeditor/fckeditor.php") ; check_admin(); /**********/ /* Start! */ /**********/ $titles = "?"; function check_title($title) { global $titles; if(substr_count($titles, $title)) { return check_title("_".$title."_"); } else { $titles .= "$title?"; } return $title; } if(isset($_POST['update'])) { $dbconn->query("TRUNCATE TABLE ".$config['prefix']."pages;"); $pages = $_POST['page']; $pages = array_reverse($pages); foreach($pages as $key => $value) { if($value[0] && $value[1]) { $pages[$key][0] = check_title(ereg_replace("[^[:alnum:]_]+", "", str_replace(" ", "_", strtolower($value[0])))); } } $pages = array_reverse($pages); if(is_array($pages)) { foreach($pages as $page) { if($page[0] && $page[1]) { $dbconn->query("INSERT INTO ".$config['prefix']."pages (title, content, format) VALUES ('".$page[0]."', '".$page[1]."', '".$page[2]."');"); } } } } $return = NULL; while(render($command, $return)) { if($command === false) { echo $return; exit; } if($command == "BODY") { echo $return . admin_get_header() . "<form action=\"admin_pages.php\" method=\"post\" enctype=\"application/x-www-form-urlencoded\">" . "<table width=\"90%\">" . "<tr><td align=\"center\" colspan=\"2\"><input type=\"submit\" value=\"Update\"></td></tr>" . "<tr><td colspan=\"2\"><hr></td></tr>"; echo "<tr valign=\"top\"><td align=\"right\">Titel:</td><td><input type=\"text\" name=\"page[0][0]\" size=\"34\" maxlength=\"32\"></td></tr>" . "<tr valign=\"top\"><td align=\"right\">Inhoud:</td><td><textarea name=\"page[0][1]\" cols=\"48\" rows=\"12\"></textarea></td></tr>" . "<input type=\"hidden\" name=\"page[0][2]\" value=\"HTML\">" . "</td></tr>" . "<tr><td colspan=\"2\"><hr></td></tr>"; $pages = get_page(); if(is_array($pages)) { $a = 1; foreach($pages as $page) { echo "<tr valign=\"top\"><td align=\"right\">Titel:</td><td><input type=\"text\" name=\"page[$a][0]\" value=\"".$page[0]."\" size=\"34\" maxlength=\"32\"></td></tr>" . "<tr valign=\"top\"><td align=\"right\">Inhoud:</td><td><textarea id=\"Textarea\" name=\"page[$a][1]\" cols=\"48\" rows=\"12\">".$page[1]."</textarea></td></tr>"; echo "<tr><td colspan=\"2\"><hr></td></tr>"; $a++; } } echo "<tr valign=\"top\"><td align=\"right\"><b>LET OP:</b></td><td>- Pagina's zonder titel of onderwerp worden verwijderd.<br>- Titels mogen geen spaties bevatten.<br></td></tr>" . "</table><br>" . "<input type=\"hidden\" name=\"update\" value=\"true\">" . "<CENTER><input type=\"submit\" value=\"Update\">" . "</center>" . "</form>"; } $return = NULL; } ?>