⚠ 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 is an archived forum. ⚠

  •     

profile picture

Image field



Robert
  • profile picture
  • Member

Posted 09 June 2013 - 19:21 PM

i want to add images to users name. I have used $crud->set_field_upload('test','assets/uploads/files'); all is good but i need to add a small modification. When you view the table to see only a small image X:X size not the full image size, the rest is perfect.

 

I have read about image crud (dont need it since i only use 1 image per user) and call backs but im looking for a easy way if there is one.

 

thanks for your time


davidoster
  • profile picture
  • Member

Posted 09 June 2013 - 22:25 PM

Even though I am not an expert on this field since I haven't played with the file uploading feature I know that,

Grocery CRUD uses the image_moo library for file handling. Look on the internet how you could the images display only on the size you want.

 

As a hint, I would use the callback_after_upload and within I would use the resize function,

resize($x,$y,$pad=FALSE) - Proportioanlly resize original image using the bounds $x and $y, if padding is set return image is as defined centralised using BG colour

 

 

Check the image_moo.php file under the application/libraries folder.


Robert
  • profile picture
  • Member

Posted 10 June 2013 - 06:25 AM

I see.. but this will resize the image only on the view ? when i click it and it opens i want it to show the full size of the image i only need to see a smaller version on the view table part since seeing it at full size is to much.


Robert
  • profile picture
  • Member

Posted 10 June 2013 - 07:07 AM

i have tryed with the resize function but it resizes the image on the view and when you click on it to .. is there another way ?

 

 

 

i want to have somthing like this from a post of yours. .. i uploaded a image for test.


davidoster
  • profile picture
  • Member

Posted 10 June 2013 - 12:07 PM

i want to have somthing like this from a post of yours. .. i uploaded a image for test.

 

Go to assets/grocery_crud/js/jquery_plugins and open the file jquery.fancybox.js

Go to line 115 and amend to your liking.

 

General suggestion: read this.


Robert
  • profile picture
  • Member

Posted 10 June 2013 - 13:22 PM

Go to assets/grocery_crud/js/jquery_plugins and open the file jquery.fancybox.js

Go to line 115 and amend to your liking.

 

General suggestion: read this.

 

let me explain again what i want to do since i dont see how that will help me ... i want to add a image with 

$crud->set_field_upload('xxxxxxx','assets/uploads/files'); and see it small like in that example ... when i click on it to see in fancybox normal size.

 

This is how i see it now, the last field is the image field i jest want that to be a smaller size and when i click on it to show it to the normal size ....

 


davidoster
  • profile picture
  • Member

Posted 10 June 2013 - 13:56 PM

I am really confused!

You want the photo that displays on the grid(list) view smaller?

Which grid (list) view? Grocery's CRUD or Image's CRUD?

 

UPDATE: Are you using the combined code I made on this example?


Robert
  • profile picture
  • Member

Posted 10 June 2013 - 17:25 PM

yes i want the picture in the list(view) smaller, jest that and when you click it to get to its normal size (a thumbnail and a normal picture) only to make it smaller the rest is all good.


Robert
  • profile picture
  • Member

Posted 11 June 2013 - 19:41 PM

Anyone ?