CodeIgniter Forums

Full Version: Images in Codeigniter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, im learning about this awesome framework, mi question is how can i make this? (image below).

I just want a option to upload an image or put a image from link, that when i click on view that show me this image. 

I need to put the option from the image below.


im using Grocery crud.


thx.

 
That is CKEditor 4 there is also a CKEditor 5 now.

CKEditor 4

The editor uses themes so you can choose a custom build of the editor and choose your own theme
for the buttons etc;
(05-28-2019, 08:15 AM)InsiteFX Wrote: [ -> ]That is CKEditor 4 there is also a CKEditor 5 now.

CKEditor 4

The editor uses themes so you can choose a custom build of the editor and choose your own theme
for the buttons etc;

Thank you for this Heart I just checked out this site and notice the CKFinder image uploader element which is free and dont need CKEditor. I reached out on how to implement it with CI..I want to add an option where members to my site can create their own gallery.
I use responsive file manager it can be integrated with TinyMCe, Checkeditor. I used it with TinyMCE.
*** responsive file manager library may not support latest versions of text editor libraries. I use it with TinyMcE v4.4.6

1. Don't put your filemanager library inside application folder. I put it under assets folder.
2. Make sure you do authorization, otherwise anybody can manage your files if they know path to your filemanager.
here is the code I put at the top of config.php in Responsive file manager library to authorize user:
PHP Code:
include('../../../index.php');
ob_end_clean();

$CI =& get_instance();
$CI->load->driver('session');
//is_auth_to_use_filemanager this value is set when user logges in
if(@$_SESSION['is_auth_to_use_filemanager'] != TRUE){
    
redirect(BASE_URL);

3. in index.php you need to update system_path and applicaton_folder:
PHP Code:
//$system_path = 'system'; to 
$system_path dirname(__FILE__) . DIRECTORY_SEPARATOR 'system';

//$application_folder = 'application'; to
$application_folder dirname(__FILE__) . DIRECTORY_SEPARATOR 'application'

4. here is then initialization configuration example for tinymce 
Code:
tinymce.init({
 height : "1000",
 selector: "#page-content-textarea",
 theme: "modern",
 relative_urls : false,
 remove_script_host : false,
 plugins: [
 "advlist autolink link image lists charmap print preview hr anchor pagebreak",
 "searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking",
 "table contextmenu directionality emoticons paste textcolor responsivefilemanager code"
 ],
 toolbar1: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect",
 toolbar2: "| responsivefilemanager | link unlink anchor | image media | forecolor backcolor  | print preview code ",
 image_advtab: true ,

 external_filemanager_path:"/assets/responsive_filemanager/filemanager/",
 filemanager_title:"Responsive Filemanager" ,
 filemanager_subfolder: "page",
 external_plugins: { "filemanager" : "/assets/responsive_filemanager/filemanager/plugin.min.js"}
});

5. here is the how use it in my dashboard:
Code:
<div class="page-content-wrapper">
   <div class="page-content">
       <div class="row">  
           <div class="col-12">
               <iframe src="<?= ASSETS ?>responsive_filemanager/filemanager/dialog.php?type=0&thumbnail=thumbnail-img&pre=" ></iframe>
           </div>
       </div>
   </div>
</div>
(05-31-2019, 04:00 AM)neuron Wrote: [ -> ]I use responsive file manager it can be integrated with TinyMCe, Checkeditor. I used it with TinyMCE.
*** responsive file manager library may not support latest versions of text editor libraries. I use it with TinyMcE v4.4.6

1. Don't put your filemanager library inside application folder. I put it under assets folder.
2. Make sure you do authorization, otherwise anybody can manage your files if they know path to your filemanager.
here is the code I put at the top of config.php in Responsive file manager library to authorize user:
PHP Code:
include('../../../index.php');
ob_end_clean();

$CI =& get_instance();
$CI->load->driver('session');
//is_auth_to_use_filemanager this value is set when user logges in
if(@$_SESSION['is_auth_to_use_filemanager'] != TRUE){
    
redirect(BASE_URL);

3. in index.php you need to update system_path and applicaton_folder:
PHP Code:
//$system_path = 'system'; to 
$system_path dirname(__FILE__) . DIRECTORY_SEPARATOR 'system';

//$application_folder = 'application'; to
$application_folder dirname(__FILE__) . DIRECTORY_SEPARATOR 'application'

4. here is then initialization configuration example for tinymce 
Code:
tinymce.init({
 height : "1000",
 selector: "#page-content-textarea",
 theme: "modern",
 relative_urls : false,
 remove_script_host : false,
 plugins: [
 "advlist autolink link image lists charmap print preview hr anchor pagebreak",
 "searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking",
 "table contextmenu directionality emoticons paste textcolor responsivefilemanager code"
 ],
 toolbar1: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect",
 toolbar2: "| responsivefilemanager | link unlink anchor | image media | forecolor backcolor  | print preview code ",
 image_advtab: true ,

 external_filemanager_path:"/assets/responsive_filemanager/filemanager/",
 filemanager_title:"Responsive Filemanager" ,
 filemanager_subfolder: "page",
 external_plugins: { "filemanager" : "/assets/responsive_filemanager/filemanager/plugin.min.js"}
});

5. here is the how use it in my dashboard:
Code:
<div class="page-content-wrapper">
   <div class="page-content">
       <div class="row">  
           <div class="col-12">
               <iframe src="<?= ASSETS ?>responsive_filemanager/filemanager/dialog.php?type=0&thumbnail=thumbnail-img&pre=" ></iframe>
           </div>
       </div>
   </div>
</div>

Question: does this work with creating thumbnail gallery for users of site?
Responsive filemanager automatically creates thumbnails. you specify path of thumbnails in its configs.
it work's similar to wordpress's Media plugin.
I created my own gallery plugin and used filemanager plugin to select images (when you select it, it return's image path).