Welcome Guest, Not a member yet? Register   Sign In
FCKeditor problem: Fatal error: Call to undefined method Fckeditor::CreateHtml()
#1

[eluser]Gijs Bloemen[/eluser]
Hi all,

I have a problem with my FCKeditor,

I got the next error: Fatal error: Call to undefined method Fckeditor::CreateHtml() in...

The file (I have only posted the FCKeditor related stuf..):

Code:
class pb extends Controller {

    function pb() {
            parent::Controller();
    }
    function sendmessage() {
    
        $this->load->library('fckeditor',array('instanceName' => 'content'));
        
            
            $this->fckeditor->BasePath = 'system/plugins/fckeditor/';
            $this->fckeditor->ToolbarSet = 'Basic';
                        
//$data['fck1'].. is the errorline
            $data['fck1'] = $this->fckeditor->CreateHtml();
        }

}

I created it with this (http://codeigniter.com/wiki/FCKeditor/) information. I putted the fckeditor files in the same directory.

My library:

Code:
<?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( $array )
     {
        $this->InstanceName    = $array['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 ) ;
    }
/*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
*  - GNU General Public License Version 2 or later (the "GPL")
*    http://www.gnu.org/licenses/gpl.html
*
*  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
*    http://www.gnu.org/licenses/lgpl.html
*
*  - Mozilla Public License Version 1.1 or later (the "MPL")
*    http://www.mozilla.org/MPL/MPL-1.1.html
*
* == END LICENSE ==
*
* This is the integration file for PHP (All versions).
*
* It loads the correct integration file based on the PHP version (avoiding
* strict error messages with PHP 5).
*/
}
/*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' ) ;*/

My init_fckeditor.php:

Code:
&lt;?php
if (!defined('BASEPATH')) exit('No direct script access allowed');

if ( ! class_exists('FCKeditor'))
{
     require_once(APPPATH.'libraries/fckeditor'.EXT);
}
$this->fckeditor->BasePath = 'system/plugins/FCKeditor/';
$obj =& get_instance();
$obj->fckeditor = new FCKeditor('FCKEDITOR1');
$obj->ci_is_loaded[] = 'fckeditor';
?&gt;

Does someone see the problem? I am using FCKeditor version 2.6.4.1

Regards,
Gijs Bloemen
#2

[eluser]devbro[/eluser]
you need to COPY the file from the zip file that you downloaded from fck site.

it has all the functions in it already.

you need to rename and work on this file:
fckeditor_php5.php



change the filename to
fckeditor.php


and change the name of class to:
Fckeditor
#3

[eluser]Gijs Bloemen[/eluser]
[quote author="devbro" date="1249280238"]you need to COPY the file from the zip file that you downloaded from fck site.

it has all the functions in it already.

you need to rename and work on this file:
fckeditor_php5.php



change the filename to
fckeditor.php


and change the name of class to:
Fckeditor[/quote]
Thanks alot for your help,

It solves the problem
Regards,
Gijs Bloemen




Theme © iAndrew 2016 - Forum software by © MyBB