Welcome Guest, Not a member yet? Register   Sign In
FCKeditor integration
#1

[eluser]Unknown[/eluser]
hello
im trying to integrate FCKeditor in my project but facing some problem i use to the following way to integrate the editor

i modified "application/libraries/Fckeditor.php"
-----------------------------------------------------------
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');

class Fckeditor
{
var $InstanceName ;
var $BasePath ;
var $Width ;
var $Height ;
var $ToolbarSet ;
var $Value ;
var $Config ;

// PHP 5 Constructor (by Marcus Bointon <[email protected]>)
function __construct( $instanceName )
{
$this->InstanceName = $instanceName ;
$this->BasePath = '/fckeditor/' ;
$this->Width = '100%' ;
$this->Height = '200' ;
$this->ToolbarSet = 'Default' ;
$this->Value = '' ;
$this->Config = array() ;
}

// PHP 4 Contructor
function Fckeditor( $instanceName )
{
$this->__construct( $instanceName ) ;
}
}

?&gt;
-----------------------------------------------------------

and controller file
*-----------------------------------------------------------*
$this->load->library('fckeditor', 'FCKEDITOR1');
*-----------------------------------------------------------*
and view file
*-----------------------------------------------------------*
&lt;?php
$this->fckeditor->BasePath = base_url() .'/plugins/fckeditor/';
$this->fckeditor->ToolbarSet = 'Default';
echo $this->fckeditor->Create() ;
?&gt;
*-----------------------------------------------------------*

it gives me the following error

Fatal error: Call to undefined method Fckeditor::CreateHtml() in

another thing in above way to integrate editor i have to follow CI 1.5 or have to keep 1.4 also with that.

my CI version is CI 1.6.3 and FCKeditor 2.6.3

waiting for your response, please.
#2

[eluser]BoogieK[/eluser]
Hy,

That`s what I finished about 5 minutes ago. It works great. I integrated it in about half day because I had to make some changes to my .htaccess.

Anyway, when the erro from CreateHtml() appears to me I realised that the modification of Fckeditor.php file from library was to drastic. I`ve pasted the code from CI 1.5 integration over the fckeditor.php and I deleted all the function from it remaining only the construct function. So take care when you make the changes because the tutorial doesn`t explain all this stuff.
#3

[eluser]umefarooq[/eluser]
hi put this file in you application library folder

Fckeditor

fckeditor folder should be in your system plugin folder when you call you basepath than it should be like this.
Code:
$this->load->library('fckeditor','content');
$this->load->library('template');
$this->load->library('pagination');
$this->fckeditor->BasePath = base_url().'system/plugins/fckeditor/';
$this->fckeditor->ToolbarSet = 'WebMaker';
$this->fckeditor->Height = 300;

it will work and also working with me.
#4

[eluser]charlie spider[/eluser]
the file you link to gives this >>> No direct script access allowed
#5

[eluser]BoogieK[/eluser]
But you can also get the file from the wiki page. If you need it.
#6

[eluser]riza_nurhadi[/eluser]
FCKeditor works for me too. im using CI 1.6.x. and i got this from some article
its in indonesia language.


first i modified 'application/libraries/Fckeditor.php'
Code:
if (!defined('BASEPATH')) exit('No direct script access allowed');

if ( !function_exists('version_compare') || version_compare( phpversion(), '5', '< ' ) )
include_once( 'system/plugins/fckeditor/fckeditor_php4.php' ) ;
else
include_once( 'system/plugins/fckeditor/fckeditor_php5.php' ) ;

then i modified 'system/plugins/fckeditor/fckeditor_php5.php'
Code:
//this was the code before modified
// public function __construct( $instanceName )
     // {
        // $this->InstanceName    = $instanceName ;
        // $this->BasePath        = BASE_FILE_FCKEDITOR. '/fckeditor/' ;
        // $this->Width        = '100%' ;
        // $this->Height        = '200' ;
        // $this->ToolbarSet    = 'Default' ;
        // $this->Value        = '' ;
        // $this->Config        = array() ;
    // }
    
    // this is modified code
    public function __construct($array)
{
$this->InstanceName = $array['instanceName'] ;
$this->BasePath = $array['BasePath'] ;
$this->Width = $array['Width'] ;
$this->Height = $array['Height'] ;
$this->ToolbarSet = $array['ToolbarSet'] ;
$this->Value = $array['Value'];
$this->Config = array() ;
}

load in controller
Code:
$this->load->library('fckeditor',array('instanceName' => 'content','BasePath' => base_url().'system/plugins/fckeditor/','ToolbarSet' => 'Basic','Width'=>'100%','Height'=>'200','Value'=>''));

show it in your view form
Code:
echo $this->fckeditor->Create() ;

getting the value
Code:
$this->input->post('content');
#7

[eluser]BoogieK[/eluser]
That`s true... FCKeditor works for me too, integrated with CI 1.7. I made some modifications for my needs but if you follow the steps from the Wiki page it will work very good. For CI 1.6 you have to use the FCKeditor integrated with CI 1.5 and create your library, the plugin and the controller. I think that on the Wiki page is a post with something similiar.




Theme © iAndrew 2016 - Forum software by © MyBB