Page 1 of 1
modify the form upload photo to add latitude and longitude
Posted: 13 Aug 2010, 23:22
by wolkmx
Hi i want to know if somebody can tell me what file i need to modify, i want that the users can upload photos but that he can add LAT and LONG, so you know the frontend of user panel of phoca gallery only allow the users to upload the image, add, title and description, so i change the code and know display the 2 fields extra in the form, but i can't find where i need to modify to process the values and add to the table.
Is the only thing that i need, know where i need to search and add code.
Thanks.
Re: modify the form upload photo to add latitude and longitu
Posted: 14 Aug 2010, 02:43
by imperialWicket
I think you can add your additional post variable to the user controller save function, just be sure that you store your values in the $post array as 'latitude' and 'longitude' - matching the database columns. I'm using an older install at the moment (2.7.1), but I imagine your updates should be near line 780 of com_phocagallery/controllers/user.php - even if you're using a more current release.
In case the line numbers are distinct, it's the 'save' function and it's called from the preceding '_singleFileUpload' function. The actual database inserts/updates occur in the user model, which is a good place to look if this doesn't work, but the user model binds the columns, and just adds all of the available data, so it shouldn't require any updates.
I haven't tested this, apologies if I've led you astray. Good luck.
Solved
Posted: 17 Aug 2010, 17:54
by wolkmx
Thanks a lot imperialWicket you help me again, well, this was confused, because i was sure like you that all was in the User Control Panel, so the file could be user.php, i other question Jan wrotte that could be user.php or category.php in the model section, so after try a lot of changes jeje, the correct file was the category.php but in the controller section like you wrotte.
Finally i can save the lat and long in the user panel (but this user panel is displaying in the category view, not in a specify link), in the tab upload.
the lines that i add was like you tell me:
Code: Select all
$post['longitude'] = JRequest::getVar( 'lonbox', '', 'post', 'string', 0 );//agregado
$post['latitude'] = JRequest::getVar( 'latbox', '', 'post', 'string', 0 );//agregado
Thanks again.