New field in control user panel

Phoca Gallery - image gallery extension
seweryn
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 07 Sep 2012, 11:51

New field in control user panel

Post by seweryn »

Hi,

I create new field in components/com_phocagallery/views/user/tmpl/default_uploadform.php
This is input with type text.
I wolud save this field in database, but I don't know how :idea:

Could you give me some advice which and where I should add new code?

Thanks in advance.

EDIT:

Ok, I got it!
After when I add new field in components/com_phocagallery/views/user/tmpl/default_uploadform.php
I add this code to components/com_phocagallery/controllers/user.php in function save:

Code: Select all

$post['longitude']  = JRequest::getVar( 'pglongitude', '', 'post', 'string', 0 );
$post['latitude']   = JRequest::getVar( 'pglatitude', '', 'post', 'string', 0 );
where 'longitude' is name of column in database and 'pglongitude' is name of input.

Enjoy!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49149
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: New field in control user panel

Post by Jan »

Hi, thank you for the guide.

Jan
If you find Phoca extensions useful, please support the project
Post Reply