CodeIgniter Forums
Images in Codeigniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Images in Codeigniter (/thread-73729.html)



Images in Codeigniter - lordki - 05-28-2019

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.

 


RE: Images in Codeigniter - InsiteFX - 05-28-2019

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;


RE: Images in Codeigniter - Mekaboo - 05-30-2019

(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.


RE: Images in Codeigniter - InsiteFX - 05-30-2019

Here is a small list of file handlers.

KCFinder is free open-source replacement of CKFinder web file manager

RESPONSIVE filemanager v 9.14.0

jQuery Ajax File Uploader Widget


RE: Images in Codeigniter - neuron - 05-31-2019

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>



RE: Images in Codeigniter - Mekaboo - 05-31-2019

(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?


RE: Images in Codeigniter - neuron - 06-01-2019

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).