Help - Search - Members - Calendar
Full Version: Can Fck Be Called Twice On A Page?
CubeCart Forums > General > General Discussion
Brivtech
I'm trying to run 2 instances of FCK editor on an admin form page.

... but I'm getting a "Fatal error: Cannot redeclare class fckeditor".

Does anyone know a simple workaround?
greebowarrior
QUOTE(Brivtech @ Nov 30 2007, 02:25 PM) *
I'm trying to run 2 instances of FCK editor on an admin form page.

... but I'm getting a "Fatal error: Cannot redeclare class fckeditor".

Does anyone know a simple workaround?


you dont need to include the fck class more than once
you can do it this way:
CODE
require($glob['adminFolder']."/includes".CC_DS."rte".CC_DS."fckeditor.php");

$oFCKeditor = new FCKeditor('textarea1');
$oFCKeditor->Create();
...
$oFCKeditor = new FCKeditor('textarea2');
$oFCKeditor->Create();

the editors created will be called textarea1 and textarea2 respectively
Brivtech
It was staring me in the face all the time! It works!

The man is a genius I tells ya! biggrin.gif

Cheers Martin, greatly appreciated bit of help there. wink.gif
Sir William
I have a friend with 4 FCK instances on one page. A bit of overkill to me, but it does work. biggrin.gif


w00t.gif
Brivtech
Following up from this, I got the editor to work just fine. However, when I display the data generated by the FCK editor back into the webpage, it's showing the HTML code as well, text code (like it's putting in <br />'s instead if making an actual linespace).

What could I be doing wrong?

Is the mySQLSafe doing this? i.e.

CODE
$check = $db->select("SELECT extraBox FROM ".$glob['dbprefix']."CubeCart_docs WHERE doc_id = ".$db->mySQLSafe($_GET['docId']));
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.