⚠ 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

Help viewing image galleries



mztriz
  • profile picture
  • Member

Posted 20 August 2012 - 14:22 PM

I have Grocery CRUD set up like this:

[img]http://gyazo.com/8e09b113a93739e38ab31593fb81de24.png[/img]

When the user clicks on "Images"

The URL changes to
http://localhost/images/gallery/14
(Where 14 is the gallery_id)

They then see this:

[img]http://gyazo.com/0ae22aa35940271236618f7f09114637.png[/img]
Image CRUD is getting the image from my images table where the gallery_id matches for the images (this part works). In this case there are 2 images with the same gallery_id in my images table. My problem is that in my image CRUD controller the line
->set_image_path('path	o\images	our\ac');
needs to be changed. The path to where the images are located varies for each gallery. ac needs to be a variable for the gallery. How can I pass the building code from my buildings table into the image path?



DB Structure:

Buildings[img]http://gyazo.com/12b77ac2101a5637c98db61b9644156b.png[/img]Galleries[img]http://gyazo.com/055fe8bb0d42eb6783474f11777257c7.png[/img] Images[img]http://gyazo.com/017f29e3e628a355033e1aa52c198072.png[/img]

Image directory structure:
[img]http://gyazo.com/9ddd0e114fcd42475f65728ccf47df74.png[/img] /ac > [img]http://gyazo.com/9922f29a010fe6c078641911747c5d7f.png[/img] Each directory pair (name and nameipad) is considered one gallery

mztriz
  • profile picture
  • Member

Posted 20 August 2012 - 19:39 PM

I got this to work by editing the image_crud library and adding my own functions.

tlc033
  • profile picture
  • Member

Posted 28 February 2013 - 10:02 AM

Hi mztriz. Can you share you solutin ? THX