Page 1 of 1

fckeditor installation problem

Posted: Tue Jul 28, 2009 7:31 am
by m2babaey
Hi
I tried to install fckeditor. uploading and testing samples are easy but creating my own form... I couldn't
This is the sample01.html that I tried (in _samples directory):

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>FCKeditor - Sample</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="robots" content="noindex, nofollow" />
    <link href="../sample.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../fckeditor.js"></script>
</head>
<body>
    <h1>
        FCKeditor - JavaScript - Sample 1
    </h1>
    <div>
        This sample displays a normal HTML form with an FCKeditor with full features enabled.
    </div>
    <hr />
    <form action="../php/sampleposteddata.php" method="post" target="_blank">
        <script type="text/javascript">
<!--
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// oFCKeditor.BasePath = '/fckeditor/' ;    // '/fckeditor/' is the default value.
var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('_samples')) ;
 
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.Height   = 300 ;
oFCKeditor.Value    = '<p>This is some <strong>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.<\/p>' ;
oFCKeditor.Create() ;
//-->
        </script>
        <br />
        <input type="submit" value="Submit" />
    </form>
</body>
</html>
But after I even change the folder name from _sample to sample the the sample01.html is not working
(I changed

Code: Select all

var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('_samples')) ;
to

Code: Select all

var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('samples')) ;
too)
I didn't find developers' guide on the site helpful for where should the directories exist when we need an editor in our www folder and how I should call the function ( plus how to set width of textarea)
Any help would be appreciated
Thanks in advance

Re: fckeditor installation problem

Posted: Tue Jul 28, 2009 10:20 am
by pickle
Read the comment above the line you're working with - you shouldn't be using that convoluted code in the real world - you should be statically setting the BasePath.