⚠ In case you've missed it we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This forum is read-only and soon will be archived. ⚠


Гэрэлт-Од Гоцбаяр

Member Since 25 Feb 2013
Offline Last Active Jun 17 2016 05:12 AM
-----

Topics I've Started

Bug while working with GroceryCrud

24 February 2014 - 08:47 AM

deleted


image_crud add get image URL button

29 April 2013 - 01:57 PM

I'm using Grocery_CRUD and Image_CRUD on my backend code. When I'm using Grocery_CRUD with TinyMCE texteditor there isn't any image upload feature. For example if admin want image in middle of text, he can't upload image. So I used Image_CRUD and created new link for it. But now problem is how can Admin get upload Image URL and put it TinyMCE's Image input URL field?

 

 

thanks.


An error has occurred on uploading

28 March 2013 - 08:43 AM

Please fix it for me. Its killing my life almost 2 days and I need fix it as soon as possible. Because its live now. Code was working my local Wampserver.

 

When choose upload image, its just stuck on 100% and spinning loader appear. After one or two minutes "An error has occurred on uploading" will appear. Assets, Uploads, Images, Thumbs folders has 777 permission.

 

public function news() {

        $this->grocery_crud->set_table('news');
        $this->grocery_crud->display_as('title', 'Гарчиг')->display_as('body', 'Контент')->display_as('title_en', 'Англи гарчиг')->display_as('body_en', 'Англи Контент')->display_as('featured', 'Томоор гаргах эсэх')->display_as('image', 'Зураг')->display_as('datetime', 'Огноо')->display_as('showenglish', 'Англи хэлэнд харуулах');
        $this->grocery_crud->required_fields('title', 'body', 'datetime', 'featured', 'image', 'showenglish');
        $this->grocery_crud->set_field_upload('image', 'assets/uploads/images');
        $this->grocery_crud->callback_after_upload(array($this, 'after_upload_pic'));
        $this->grocery_crud->field_type('featured', 'true_false');
        $this->grocery_crud->field_type('showenglish', 'true_false');
        $output = $this->grocery_crud->render();

        $this->_example_output($output);
    }

    public function after_upload_pic($uploader_response, $field_info, $files_to_upload) {

        $this->load->library('md_image');

        $file_uploaded = $field_info->upload_path . '/' . $uploader_response[0]->name;

        $data = getimagesize($file_uploaded);
        $source_width = $data[0];
        $source_height = $data[1];

        $this->md_image->crop_to_ratio($file_uploaded, $source_width, $source_height, '620px', '250px', 'assets/uploads/images/featured/');
        $this->md_image->resize_image($file_uploaded, '140px', '85px', 'assets/uploads/images/thumbs/');
    }

 

 


Set default width on TinyMCE

14 March 2013 - 11:11 AM

How I set default width value to TinyMCE?


callback_after_upload + imgAreaSelect

28 February 2013 - 07:52 PM

How can I implement imgAreaSelect Plugin? User step is:

 

1. User upload image.

2. Some dialog with uploaded image will show up. Or without dialog, uploaded image will somehow appear.

3. User will use imgAreaSelect and choose how to crop.

4. Cropped image will stored into database.

 

Current code is (But it uses other library, I need imgAreaSelect):

 

public function news() {

        $this->grocery_crud->set_table('news');
        $this->grocery_crud->set_field_upload('image', 'assets/uploads/images');
        $this->grocery_crud->callback_after_upload(array($this, 'after_upload_pic'));
        $output = $this->grocery_crud->render();

        $this->_example_output($output);
    }

public function after_upload_pic($uploader_response, $field_info, $files_to_upload) {
        
        $this->load->library('md_image'); 
        
        $source_width = "";        //another question. How can I pass source width here?
        $source_height = "";       // how can i pass source height here?

        $file_uploaded = $field_info->upload_path . '/' . $uploader_response[0]->name;

        $this->md_image->crop_to_ratio($file_uploaded, $source_width, $source_height, '620px', '250px', 'assets/uploads/images/thumbs/');

    }

 

I'm following http://ellislab.com/...wthread/121152/ this tutorial.

imgAreaSelect jQuery is here: http://odyniec.net/p.../imgareaselect/

If you don't get my idea, almost same question here: http://ellislab.com/...wthread/195177/