1 (edited by 2009-10-27 17:05:12)

Topic: [WYSIWYG] FCKEditor

Name: FCKeditor
Author: hanska
CuteNews Compatibility: 1.4.0 - * (no incompatibility reported yet)
Description: This forum does not support third party software! The default wysiwyg and FCKeditor are third party software and got nothing to do with cutephp. So don't ask about it! The sole reason this post has been added to the faq is because the defaults wysiwyg hasn't got a support forum and is incompatible with some new browsers like google chrome. Also note that this editor/wysiwyg has it's own image module thus you won't be able to use the image module from CuteNews.
Requirements: A copy of CuteNews. For CN UTF-8 also see notes in the next post.
Instructions:

First download newest V2 FCKeditor from here

Then unpack and upload in cutenews dir. Now you should have dir list something like this :
data
fckeditor
inc
rte
skins
.....

Now open inc/addnews.mdu and add just after <?php this

require_once("fckeditor/fckeditor.php");

And make sure the path to this file is correct.

then find

        
Short Story
        <td>";


if ($use_wysiwyg) {
        echo"
        <script language=\"JavaScript\" type=\"text/javascript\" src=\"rte/richtext.js\"></script>
<script language=\"JavaScript\" type=\"text/javascript\">
        initRTE(\"rte/images/\", \"rte/\", \"rte/\", false); </script>

<script language=\"JavaScript\" type=\"text/javascript\">
        writeRichText('short_story', '', 460, 250, true, false);
</script>
        ";
}else{

replace

        
Short Story
        <td>";


if ($use_wysiwyg) {

$oFCKeditor = new FCKeditor('short_story');
$oFCKeditor->Width  = '100%';
$oFCKeditor->Height = $config_wysiwyg_height_short;
$oFCKeditor->BasePath = 'fckeditor/';
$oFCKeditor->Value = '';
$oFCKeditor->Create();

}else{

then find and delete

     echo"
        <td width=\"108\" valign=\"top\" style='background: url(skins/images/baloon.gif) no-repeat top left'>
        <p align=\"center\">[url= onclick=\]

        [insert image][/url]

<!--        [url= onclick=\][quick tags][/url]
 -->
        [url= onclick=\][expand][/url]
        



        ";

    echo insertSmilies("$short_story_id", 4, true, "$use_wysiwyg");


find

        
Full Story
<font style=\"font-size:7pt\">(optional)</font>
        <td>
        ";


if ($use_wysiwyg) {
    echo"<script language=\"JavaScript\" type=\"text/javascript\">
        writeRichText('full_story', '', 460, 300, true, false);
        </script>";
}else{

replace

        
Full Story
<font style=\"font-size:7pt\">(optional)</font>
        <td>
        ";


if ($use_wysiwyg) {
$oFCKeditor = new FCKeditor('full_story', null, 550);
$oFCKeditor->Width  = '100%';
$oFCKeditor->Height = $config_wysiwyg_height_full;
$oFCKeditor->BasePath = 'fckeditor/';
$oFCKeditor->Value = 'Write here...';
$oFCKeditor->Create();
}else{

find and delete

      echo"
        <td width=\"108\" valign=\"top\" style='background: url(skins/images/baloon.gif) no-repeat top left'>
        <p align=\"center\">

        [url= onclick=\][insert image][/url]

<!--        [url= onclick=\][quick tags][/url]
-->

        [url= onclick=\][expand][/url]
        


        ";

        echo insertSmilies("$full_story_id", 4, true, "$use_wysiwyg");

Save and close addnews.mdu
Now open inc/editnews.mdu

right after <?php insert this

include("fckeditor/fckeditor.php");

find :

        
Short Story
        <td width=\"464\" colspan=\"3\">
";

if ($use_wysiwyg) {
        echo"
        <script language=\"JavaScript\" type=\"text/javascript\" src=\"rte/richtext.js\"></script>
<script language=\"JavaScript\" type=\"text/javascript\">
        initRTE(\"rte/images/\", \"rte/\", \"rte/\", false); </script>

<script language=\"JavaScript\" type=\"text/javascript\">
        writeRichText('short_story', '".rteSafe($item_db[3])."', 460, 250, true, false);
</script>
        ";
}else{

replace with

        
Short Story
        <td width=\"100%\" colspan=\"3\">
";

if ($use_wysiwyg) {
$oFCKeditor = new FCKeditor('short_story');
$oFCKeditor->BasePath = 'fckeditor/';
$oFCKeditor->Value = $item_db[3];
$oFCKeditor->Width = '100%';
$oFCKeditor->Height = $config_wysiwyg_height_short;
$oFCKeditor->Create();
}else{

find and delete

     echo"

        <td width=\"165\" valign=\"top\" align=center style='background: url(skins/images/baloon.gif) no-repeat top left'>
        <p align=\"center\">[url= onclick=\]

        [insert image][/url]

<!--        [url= onclick=\][quick tags][/url]
 -->
        [url= onclick=\][expand][/url]
        



";

    echo insertSmilies("$short_story_id", 4, true, "$use_wysiwyg");

find

        
Full Story
<font style=\"font-size:7pt\">(optional)</font>
        <td width=\"464\" colspan=\"3\">
";

if ($use_wysiwyg) {
        echo"
<script language=\"JavaScript\" type=\"text/javascript\">
        writeRichText('full_story', '".rteSafe($item_db[4])."', 460, 250, true, false);
</script>
        ";
}else{

replace

        
Full Story
<font style=\"font-size:7pt\">(optional)</font>
        <td width=\"100%\" colspan=\"3\">
";

if ($use_wysiwyg) {
$oFCKeditor = new FCKeditor('full_story');
$oFCKeditor->BasePath = 'fckeditor/';
$oFCKeditor->Value = $item_db[4];
$oFCKeditor->Width = '100%';
$oFCKeditor->Height = $config_wysiwyg_height_full;
$oFCKeditor->Create();
}else{

find and delete

     echo"

        <td width=\"108\" valign=\"top\" style='background: url(skins/images/baloon.gif) no-repeat top left'>
        <p align=\"center\">

        [url= onclick=\][insert image][/url]

<!--        [url= onclick=\][quick tags][/url]
-->

        [url= onclick=\][expand][/url]
        

";

        echo insertSmilies("$full_story_id", 4, true, "$use_wysiwyg");

save and close editnews.mdu

open inc/options.mdu and find

    showRow("Use WYSIWYG Editor","use (or not) the advanced editor", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[use_wysiwyg]", "$config_use_wysiwyg"));

replace

    showRow("Use WYSIWYG Editor","use (or not) the advanced editor", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[use_wysiwyg]", "$config_use_wysiwyg"));
    showRow("WYSIWYG Editor height (short story)", "enter number (400 ex.) ", "<input type=text style=\"text-align: center;\"  name='save_con[wysiwyg_height_short]' value='$config_wysiwyg_height_short' size=10>");
    showRow("WYSIWYG Editor height (full story)", "enter number (400 ex.) ", "<input type=text style=\"text-align: center;\"  name='save_con[wysiwyg_height_full]' value='$config_wysiwyg_height_full' size=10>");

Then upload all files and go to Options -> System Configurations choose News tab and you see 2 new lines there : WYSIWYG Editor height (short story) and WYSIWYG Editor height (full story) . Put numbers there to your needs (400 for example) and you're done  http://cutephp.com/forum/style_emoticons/default/tongue.gif

2 (edited by 2012-02-11 11:00:54)

Re: [WYSIWYG] FCKEditor

Name: FCKeditor
Author: FUNimations
CuteNews Compatibility: Utf-8 (1) - Utf-8 (8b)
Description: This forum does not support third party software! The default wysiwyg and FCKeditor are third party software and got nothing to do with cutephp. So don't ask about it! The sole reason this post has been added to the faq is because the defaults wysiwyg hasn't got a support forum and is incompatible with some new browsers like google chrome. Also note that this editor/wysiwyg has it's own image module thus you won't be able to use the image module from CuteNews.
Requirements: A copy of UTF-8 CN.
Instructions:
Make sure the regular CN installation notes have been added.
Next ina editnews.mdu find

$oFCKeditor->Value = $item_db[3];

and

$oFCKeditor->Value = $item_db[4];

Notice the small change in number, and change it to

html_entity_decode( $item_db[3], ENT_QUOTES, 'UTF-8' );

and

html_entity_decode( $item_db[4], ENT_QUOTES, 'UTF-8' );