⚠ In case you've missed it we are migrating 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. ⚠


Kobus

Member Since 07 Oct 2012
Offline Last Active Sep 02 2015 09:36 PM
-----

#13003 Bootstrap CSS modification

Posted Kobus on 23 August 2015 - 08:03 PM

Hi all,

 

I have purchased the Bootstrap theme, and decided to make some CSS modifications to it.

 

Since it is a purchased component, I do not know what the rules are with contributing my changes, or even if I can contribute them?

 

See screenshot for this modification. I still need to work a bit on the edit/add screens, therefore only posted the list screen.

 

film_management.png

 

Kind regards,

 

Kobus




#9667 Saving image

Posted Kobus on 02 October 2013 - 01:14 PM

In the spirit of sharing, I'd like to add to briggers' brilliant solution, but modifying the resize_callback function to allow creation of square thumbnails for gallery displays. What it does is first determines whether height or width is greater, and then crop according to that to ensure that you have a perfectly square thumbnail centered at the middle of the image. If your image is 5000 (wide) x 2500 (high), your image will first be sized to the specified width/height of 800x600 (maintaining aspect ratio, so this one will be 800x400). Now this file is used to create the thumbnail to 300x150 (ratio of width to height is 2). After this, the cropping is done from the center out, so you end up with 150x150, centered at the center of the image, with the sides cut off.

 

    function resize_callback($uploader_response, $field_info, $files_to_upload)
    {
        $file_uploaded = $field_info->upload_path . '/' . $uploader_response[0]->name;
        $new_display = str_replace('original_image', 'view_image', $file_uploaded);
        $new_thumb = str_replace('original_image', 'thumbnail', $file_uploaded);

        // Create viewing image
        $config['image_library'] = 'gd2';
        $config['source_image'] = $file_uploaded;
        $config['create_thumb'] = FALSE;
        $config['maintain_ratio'] = TRUE;
        $config['width'] = 800;
        $config['height'] = 600;
        $config['new_image'] = $new_display;
        $this->load->library('image_lib', $config);
        if (!$this->image_lib->resize())
        {
            $this->form_validation->set_message($this->image_lib->display_errors());
            return false;
        }

        // Create thumbnail image
        $this->image_lib->clear();
        list($w, $h, $t, $a) = getimagesize($new_display);
        if ($w >= $h)
        {
            $ratio = $w / $h;
            $config['x_axis'] = ($w / 2) -  ($h / 2);
            $config['y_axis'] = $h / 4;
            $config['width'] = 150 * $ratio;
            $config['height'] = 150;
        }
        elseif ($h > $w)
        {
            $ratio = $h / $w;
            $config['x_axis'] = $w / 4;
            $config['y_axis'] = ($h / 2) - ($h / 2);
            $config['width'] = 150;
            $config['height'] = 150 * $ratio;
        }
        $config['image_library'] = 'gd2';
        $config['source_image'] = $new_display;
        $config['create_thumb'] = FALSE;
        $config['maintain_ratio'] = FALSE;
        $config['new_image'] = $new_thumb;
        $this->image_lib->initialize($config);
        if (!$this->image_lib->resize())
        {
            $this->form_validation->set_message($this->image_lib->display_errors());
        }

        // Crop thumbnail image
        $this->image_lib->clear();
        list($w, $h, $t, $a) = getimagesize($new_thumb);
        if ($w >= $h)
        {
            $config['x_axis'] = $w / 4;
            $config['y_axis'] = 0;
        }
        elseif ($h > $w)
        {
            $config['x_axis'] = 0;
            $config['y_axis'] = $h / 4;
        }
        $config['width'] = 150;
        $config['height'] = 150;
        $config['image_library'] = 'gd2';
        $config['source_image'] = $new_thumb;
        $config['create_thumb'] = FALSE;
        $config['maintain_ratio'] = FALSE;
        $config['new_image'] = $new_thumb;
        $this->image_lib->initialize($config);
        if (!$this->image_lib->crop())
        {
            $this->form_validation->set_message($this->image_lib->display_errors());
        }
        return true;
    }

Regards,

 

Kobus




#9650 Creating an image gallery using GC

Posted Kobus on 01 October 2013 - 03:37 PM

Hi David,

 

I ended up using briggers' solution, without Image Crud. It works pretty decently, in my opinion. The only problem with this is that I can upload only one image at a time. Maybe for a future version, I will upgrade to your solution, but not now - the client is breathing down my neck for their "super duper image gallery" :-) Hehe.

 

Regards,

 

Kobus




#9511 Cannot Edit or Add new

Posted Kobus on 19 September 2013 - 12:29 PM

Thanks, David,

 

It appears to be something in VideoJS and AudioJS javascripts - so on the admin template where I use Grocery CRUD, I do not need those components, so I removed them.

 

Regards,

 

Kobus




#8982 when I click the view button

Posted Kobus on 14 August 2013 - 02:30 PM

I have submitted the proposed change on Github. Do with it as you wish :-) I also submitted some documentation rewording (fixing grammar mistakes) and an updated Afrikaans language file.




#8212 Afrikaans Language File

Posted Kobus on 28 June 2013 - 10:02 AM

I have just done my first Git fork, commit and push request for this. Yay! I have not worked with collaboration tools much yet. So - updated this file for the latest version and pushed to development version on Github.




#7636 When Uploading document error alert 1

Posted Kobus on 24 May 2013 - 08:22 AM

I got the same situation short while ago. I think I have found the post Victor is referring to: http://www.grocerycr...upload-problem/

 

Anyways - mine pops up with the message "7", which I found out meant that the directory is not writable. These error messages should get an overhaul in 1.4, me thinks ;-)

 

Regards,

 

Kobus




#7605 Drag and drop for order of items

Posted Kobus on 23 May 2013 - 08:20 AM

Hi Amit,

 

I have decided to custom develop this for each module I want to make. Mine is now done in about 8 lines of code in the controller, and 2 small queries and one view file.

 

Yours is obviously much more flexible, but mine is working well for my specific implementation. I will eventually upgrade to yours if time permits. You can see screenshots of my implementation and what I needed done here: http://www.grocerycr...ng-the-add-url/

 

Thanks for your library - I am sure lots will find it very useful. I just needed something quicker and I only needed it for two modules, so no use to implement a full library for this :-)

 

Regards,

 

Kobus




#7604 Modifying the ADD url

Posted Kobus on 23 May 2013 - 08:17 AM

Hi David,

 

I tried the new version from GitHub and it still has too many bugs - I reported them on GitHub.

 

I have therefore decided to implement Fancybox myself within my actions.

 

I actually did not like the way it looked when it opened in a new window - I do not like the jQuery UI dialog it opened, and when it opened, I got lots of issues with what seemed to be conflicts. I have thus decided to implement Fancybox in my custom actions only, and this is working very well for me.

 

First screenshot shows the "reorder" action button. When clicking, screenshot 2 shows, and I am happy with that :-)

 

Thanks for your answer.

 

Regards,

 

Kobus

 

 

Attached Thumbnails

  • FireShot Screen Capture #115 - 'Manage pages' - localhost_demo_content_admin_manage_pages.png
  • FireShot Screen Capture #116 - 'Manage pages' - localhost_demo_content_admin_manage_pages.png



#5462 Suggestion for future release

Posted Kobus on 05 February 2013 - 09:28 AM

Hi David,

 

Thank you. That confirms it. I know better than to promise to look into it, but I will try. :-)

 

Regards,

 

Kobus




#4139 Peculiar problem with adding

Posted Kobus on 01 November 2012 - 07:15 AM

Hi guys,

I have a strange problem with one of my controller functions. The only difference between a controller function that works correctly and one that doesn't, is that the one contains a file upload field, otherwise, the logic is the same.

When I use the File Upload one, the content gets added multiple times. Sometimes up to four times, with a single click of the save button.

Anyone seen this before?

Kind regards,

Kobus