hi there, I hope it's ok to ask a question about imageCRUD here.. hopefully this is quick and easy! I am trying to use imageCRUD as part of a backend for a prototype property site, and as such, I'm using the 'set relation' setting as the property id. I'd also like to be able to dynamically set the upload path depending on the property id in the url. However, I can't get it to work when I construct the variable form the url (images do not upload). When I force the upload path by simply manually setting a string, it works fine. (although there is a red error message appearing on both, but it disappears so fast I can't see what it says) Here's some test code.
function edit($id) { $this->load->model('Model_addproperty'); $details = $this->Model_addproperty->get_org_user_from_property($id); $path_to_images = "media/" . $details->organisation_id . "/" . $details->user_id . "/" . $id . "/img"; var_dump($path_to_images); $path_to_images2 = 'media/20011/3002315/294967295/img'; var_dump($path_to_images2); //these two var_dumps are always identical. $image_crud = new image_CRUD(); $image_crud->set_url_field('url'); $image_crud->set_table('images') ->set_relation_field('property_id') ->set_ordering_field('priority') ->set_image_path($path_to_images2); // change between 1 and 2 to test. $output = $image_crud->render(); $this->load->view('view_imageedit.php',$output); }
Any pointers gratefully received .. I think is this is something easy. Am I perhaps interfering with what the library is doing with the uri segments? Chrz.