Jump to content
JcMagpie

Support thread for JcM CKEditor V1.0

Recommended Posts

It's the BaseUrl that is used to change the storing of files. Below you will see I changed it to 

'baseUrl'      => 'images/myimages/'

and below that I made a new default directory called  Myimages, so now all images save to new dir .

It only shows the directorys and not the paths but the images are saved in new paths. the free version will not let you deleat in the plugin you have to do that using ftp.

image.png.48ccc5d1c2b120c6526f798477026434.png

/*=================================== Backends ========================================*/
// https://ckeditor.com/docs/ckfinder/ckfinder3-php/configuration.html#configuration_options_backends

$config['backends'][] = array(
    'name'         => 'default',
    'adapter'      => 'local',
    //'baseUrl'      => '/ckfinder/userfiles/',
    'baseUrl'      => 'images/myimages/',
//  'root'         => '', // Can be used to explicitly set the CKFinder user files directory.
    'chmodFiles'   => 0777,
    'chmodFolders' => 0755,
    'filesystemEncoding' => 'UTF-8',
);

/*================================ Resource Types =====================================*/
// https://ckeditor.com/docs/ckfinder/ckfinder3-php/configuration.html#configuration_options_resourceTypes

$config['defaultResourceTypes'] = '';

$config['resourceTypes'][] = array(
    'name'              => 'Files', // Single quotes not allowed.
    'directory'         => 'files',
    'maxSize'           => 0,
    'allowedExtensions' => '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip',
    'deniedExtensions'  => '',
    'backend'           => 'default'
);

$config['resourceTypes'][] = array(
    'name'              => 'Images',
    'directory'         => 'images',
    'maxSize'           => 0,
    'allowedExtensions' => 'bmp,gif,jpeg,jpg,png',
    'deniedExtensions'  => '',
    'backend'           => 'default'
);

$config['resourceTypes'][] = array(
    'name'              => 'MyImages',
    'directory'         => 'Myimages',
    'maxSize'           => 0,
    'allowedExtensions' => 'bmp,gif,jpeg,jpg,png',
    'deniedExtensions'  => '',
    'backend'           => 'default'
);

 


 

Share this post


Link to post
Share on other sites

@JcMagpie

Hi Zahid,

Thanks for the addon. I had installed it, it works, tried to add some more files admin so that it also can have ckEditor, tried to change the code @ckedit.php

   var $good_pages = ['categories.php',
                     'manufacturers.php',
                     'newsletters.php',
                     //BOF add new files
                     'addons_installed.php',  //Not working CE
                     'admin_notes.php', //Not working CE
                     'testimonials.php', //Not working CE
                     'reviews.php', //Not working CE
                     //EOF add new files
                     'mail.php'];

is it the wrong place I edit the code?

Many thanks! Lyn

Share this post


Link to post
Share on other sites

You will also need to update the function to tell ck what it need to change.

$ckedit = <<<eod
                <script>
                CKEDITOR.replace( 'products_description[1]', {
	filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
	filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
                } );
	CKEDITOR.replace( 'products_description[2]', {
	filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
	filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
} );

So for testimonials.php  you would make 2 edits, first this.

var $good_pages = ['categories.php', 'manufacturers.php', 'newsletters.php', 'mail.php', 'testimonials.php'];

Then add this

CKEDITOR.replace( 'testimonials_text', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
                } );
    CKEDITOR.replace( 'testimonials_text', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
} );

This is what you get,

image.png.7638b0ff8d2c588204ec0b03e3d6f199.png

Should be the same for all pages but check as I have only done a few. Also as Phionix is changing all the time no idea if this will stll work on future updates. Also you need to check if languages are supported on all pages you add.

Edited by JcMagpie

 

Share this post


Link to post
Share on other sites

And for those that spotted my silly mistake , a gold star 😊.

If no language is defined then you only need to have this once.

CKEDITOR.replace( 'testimonials_text', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
                } );

 


 

Share this post


Link to post
Share on other sites

Hi there Zahid,

Thanks for the great contribution.

I tried it and it is not working with multi-language store. The editor only shows up on the product/category default language editing area. Reminded me the same issue I had with google Recaptcha addon, where I faced the same issue which remained unresolved.

I'm using USU5.

Thanks 

Share this post


Link to post
Share on other sites

Gidday JcM

Is there any chance you could look at why this broke at Phoenix v1.0.7.13/14 ? Im using 14 because 13 has problems in the product input area.

I know chasing updates in Phoenix is a pain, and the request is sorta out of cycle.

Thanking you in advance if you could be of help.

Mark

 

Edited by MyBookShop

Share this post


Link to post
Share on other sites

Thankyou I had no idea. 😧 Its amazing work left to a community.

And this morning the plugin came right and works for Phoenix v1.0.7.14. I guess I had to refresh the browser.

Mark.

Share this post


Link to post
Share on other sites

@valquiria23

I am sorry I make a mistake at line 33 of ckedit.php (hook).

Quote

  CKEDITOR.plugins.addExternal( 'bootstrapTabs', '/../ext/ckeditor_new/plugins/bootstrapTabs/', 'plugin.js' );

the folder name should be just ckeditor instead of ckeditor_new. 😝

Share this post


Link to post
Share on other sites

I get the the following errors on chrome console:

ext/ckeditor/plugins/bootstrapTabs/plugin.js?t=L0QD:1 Failed to load resource: the server responded with a status of 404 (Not Found)

and


ckeditor.js:252 Uncaught Error: [CKEDITOR.resourceManager.load] Resource name "bootstrapTabs" was not found at "/../ext/ckeditor/plugins/bootstrapTabs/plugin.js?t=L0QD".
    at CKEDITOR.resourceManager.<anonymous> (ckeditor.js:252)
    at n (ckeditor.js:248)
    at Array.t (ckeditor.js:248)
    at w (ckeditor.js:248)
    at HTMLScriptElement.CKEDITOR.env.ie.f.$.onerror (ckeditor.js:249)


:heart: Community Oscommerce fan :heart: You'll find the latest osC community version here.

 

Share this post


Link to post
Share on other sites

Could also be the path is not correct. For my local xammp test server. I changed line 33 in ckedit.php .

CKEDITOR.plugins.addExternal( 'bootstrapTabs', '/phoenix/ext/ckeditor/plugins/bootstrapTabs/', 'plugin.js' );

 


The water in a vessel is sparkling; the water in the sea is dark. The small truth has words which are clear; the great truth has great silence.

- Rabindranath Tagore

Share this post


Link to post
Share on other sites

Hi @kgtee and Eric @Smoky Barnable 

I had all the files well uploaded.
The change  the path for my local xammp test server and this did the magic.

Thank you both very much, I hope you have a wonderful day

Valqui

 


:heart: Community Oscommerce fan :heart: You'll find the latest osC community version here.

 

Share this post


Link to post
Share on other sites

hi@all

 

I've only just started looking at Phoenix. I read the thread carefully and read the last suggestions carefully.

My solution;

- Download ckeditor full version https://ckeditor.com/ckeditor-4/download/
- save in admin / ext / ckeditor

write this code in admin/includes/template_bottom.php

right before <? = $ OSCOM_Hooks-> call ('siteWide', 'injectBodyEnd')?>

<script src = "ext / ckeditor / ckeditor.js"> </script>
  <script>
  CKEDITOR.replace ("products_description [1]");
  CKEDITOR.replace ("manufacturers_description [1]");
CKEDITOR.replace ("categories_description [1]");
CKEDITOR.replace ("message");
CKEDITOR.replace ("content");
CKEDITOR.replace ("page_text [1]");
CKEDITOR.replace ("testimonials_text");
</script>


tested with Phoenix 1.7.14 / 15/16

without having to copy the ckedit file to hooks / siteWide

Have fun

Edited by meiru

Share this post


Link to post
Share on other sites
22 minutes ago, meiru said:

hi@all

 

I've only just started looking at Phoenix. I read the thread carefully and read the last suggestions carefully.

My solution;

- Download ckeditor full version https://ckeditor.com/ckeditor-4/download/
- save in admin / ext / ckeditor

write this code in admin/includes/template_bottom.php

right before <? = $ OSCOM_Hooks-> call ('siteWide', 'injectBodyEnd')?>

<script src = "ext / ckeditor / ckeditor.js"> </script>
  <script>
  CKEDITOR.replace ("products_description [1]");
  CKEDITOR.replace ("manufacturers_description [1]");
CKEDITOR.replace ("categories_description [1]");
CKEDITOR.replace ("message");
CKEDITOR.replace ("content");
CKEDITOR.replace ("page_text [1]");
CKEDITOR.replace ("testimonials_text");
</script>


tested with Phoenix 1.7.14 / 15/16

without having to copy the ckedit file to hooks / siteWide

Have fun

That is a really bad idea to multiple reasons

1.  the whole point of the hook system, is that you do not touch core files, which makes it easier in the future to install updates.

2. Your code will not work for sites with multiple languages

3. You are loading an unnecessary script on pages that do not need coeditor, which will slow down the admin


App created for phoenix
TinyMCE editor for admin

 

Share this post


Link to post
Share on other sites

Good morning @ all

Thanks puddlec, you are right. Well, I didn't get the last download from JcM to work.

But I got the download from December 4th, 2020 for all info pages to run

 

Code in ckedit.php

 

class hook_admin_siteWide_ckedit {
  var $version = '1.3';
  var $good_pages = ['categories.php', 'manufacturers.php', 'newsletters.php', 'mail.php', 'info_pages.php', 'testimonials.php'];
  var $sitestart = null;
  var $siteend = null;
  
  
  function listen_injectSiteEnd() {
    $this->siteend .= '<!-- ckedit -->' . PHP_EOL;
    $this->siteend .= '<script src="ext/ckeditor/ckeditor.js"></script>' . PHP_EOL;
    $ckedit = <<<eod
                <script>
                CKEDITOR.replace( 'products_description[1]', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
                } );
    CKEDITOR.replace( 'products_description[2]', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
} );

CKEDITOR.replace( 'categories_description[1]', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
                } );
    CKEDITOR.replace( 'categories_description[2]', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
} );

CKEDITOR.replace( 'manufacturers_description[1]', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
                } );
    CKEDITOR.replace( 'manufacturers_description[2]', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
} );

CKEDITOR.replace( 'testimonials_text', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
                } );
    CKEDITOR.replace( 'testimonials_text', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
} );

CKEDITOR.replace( 'page_text[1]', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
                } );
    CKEDITOR.replace( 'page_text[2]', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
                } );
    
CKEDITOR.replace( 'content', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
                } );
    CKEDITOR.replace( 'message', {
    filebrowserBrowseUrl: 'ext/ckfinder/ckfinder.html',
    filebrowserUploadUrl: 'ext/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files'
} );

                </script>
eod;

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×