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.
modify the form upload photo to add latitude and longitude
-
wolkmx
- Phoca Member

- Posts: 32
- Joined: 13 Jul 2010, 22:22
- Location: For now Venezuela but soul in Mexico
-
imperialWicket
- Phoca Enthusiast

- Posts: 78
- Joined: 28 Feb 2010, 15:39
Re: modify the form upload photo to add latitude and longitu
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.
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.
-
wolkmx
- Phoca Member

- Posts: 32
- Joined: 13 Jul 2010, 22:22
- Location: For now Venezuela but soul in Mexico
Solved
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:
Thanks again.
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