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
Posted (edited)

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

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

×