Welcome Guest, Not a member yet? Register   Sign In
Just can't seem to get FCKEditor to work -- what am I doing wrong???
#1

[eluser]naren_nag[/eluser]
Hi,

I've got CI 1.7 running and want to integrate FCKEditor with it. For some reason it just refuses to work for me ...

I've followed the instructions here: http://ellislab.com/forums/viewthread/107642/ and on the Wiki .. but continuously get an error saying the file can't be found.

Any help!

Naren
#2

[eluser]khagendra[/eluser]
Here is some steps that will help you to use the fckeditor in codeigniter.

1.put the fckeditor folder in system/plugins. i.e.
Code:
system\plugins\fckeditor

2. Add this line in config.php. The config.php is located in system\application\config
Code:
$config['fckeditor_basepath'] = "/system/plugins/fckeditor/"; // should start with slash

3. create a file form_helper.php and add the followint lines of code in this file. put the form_helper file in the system\application\helpers
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

include_once( BASEPATH . '/helpers/form_helper'.EXT);

function form_fckeditor($data = '', $value = '', $extra = '')
{
    $CI =& get_instance();

    $fckeditor_basepath = $CI->config->item('fckeditor_basepath');
    
    require_once( $_SERVER["DOCUMENT_ROOT"] . $fckeditor_basepath. 'fckeditor.php' );
    
    $instanceName = ( is_array($data) && isset($data['name'])  ) ? $data['name'] : $data;
    $fckeditor = new FCKeditor($instanceName);
    
    if( $fckeditor->IsCompatible() )
    {
        $fckeditor->Value = html_entity_decode($value);
        $fckeditor->BasePath = $fckeditor_basepath;
        if( $fckeditor_toolbarset = $CI->config->item('fckeditor_toolbarset_default'))
                $fckeditor->ToolbarSet = $fckeditor_toolbarset;
        
        if( is_array($data) )
        {
            if( isset($data['value']) )
                $fckeditor->Value = html_entity_decode($data['value']);
            if( isset($data['basepath']) )
                $fckeditor->BasePath = $data['basepath'];
            if( isset($data['toolbarset']) )
                $fckeditor->ToolbarSet = $data['toolbarset'];
            if( isset($data['width']) )
                $fckeditor->Width = $data['width'];
            if( isset($data['height']) )
                $fckeditor->Height = $data['height'];
        }
        
        
        return $fckeditor->CreateHtml();
    }
    else
    {
        return form_textarea( $data, $value, $extra );
    }
}

?>

4. open fckeditor.php file form system\plugins\fckeditor and add this line at top
Code:
if (!defined('BASEPATH')) exit('No direct script access allowed');


5. put this line in the view file where u want to display editor
Code:
$data = array(
        'name'=>'content',
        'id'=>'content',
        'toolbarset'=>'Default', // Default or Basic
        'width'=>'100%',
        'height'=>'400'
      );

echo form_fckeditor($data, 'value'); // value is the value that will be displayed by default

Hope this will help you.
#3

[eluser]naren_nag[/eluser]
Thanks Khagendra,

Looks like an interesting solution -- I will try it out.

I got it to work by moving the fckeditor directory to the root folder instead of the system/plugins folder.

cheers,

Naren
#4

[eluser]miss_amylee[/eluser]
hi guys

can i have d link to download FCKEditor?thx
#5

[eluser]Ben Edmunds[/eluser]
@miss_amylee there is this cool site called google.com that allows you to search for just about anything...
#6

[eluser]miss_amylee[/eluser]
hy, i follow step by step but i got this error

Non-existent class: Fckeditor

pls help me
#7

[eluser]miss_amylee[/eluser]
[quote author="Ben Edmunds" date="1257497181"]@miss_amylee there is this cool site called google.com that allows you to search for just about anything...[/quote]

im jus confused coz there are Ckeditor n Fckeditor..so i dunno which one to use.dats y im askin d exact link to download. im very2 new in CI.btw, thx for ur 'useful' tip BEN. tq
#8

[eluser]khagendra[/eluser]
Will you please tell me whether u r using in localhost or live site?

- if u r using live site then the steps that i had give should work.

- if u r using in localhost then add the folder name in which ur all the files(like system, index.php residing) in step 2(previously provided) like this

Code:
$config['fckeditor_basepath'] = "/folderName/system/plugins/fckeditor/"; // should start with slash
#9

[eluser]miss_amylee[/eluser]
i already try that n gave same error.

this is my config

$config['fckeditor_basepath'] = "/myCi/system/plugins/fckeditor/";

yeah, im using localhst ..
#10

[eluser]basty_dread[/eluser]
Hello i also follow the steps and i have this error. i dont know how could i fix it..

here is the error:

Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\mypage\system\application\helpers\form_helper.php:47)

Filename: libraries/Session.php

Line Number: 662




Theme © iAndrew 2016 - Forum software by © MyBB