Forums

Load User Info from custom profile

catalmco 21 Apr, 2014
Hi,

I am trying to set up a form where the user information is preloaded from the user logging in. I was able to do this succesfully for the most part using some of the parameters that come from the original basic users table. In the info with the action I see that you mention the user_profiles section. I have not been able to get those to pre populate. Looking at the php portion of the action I see all the fields from the basic joomla profiles tab. I have custom fields that I added to the profile section (I use profile10) What do I need to do so that the form loads data from that profile10 program which uses the same _usersprofiles table?

Thanks!
GreyHead 22 Apr, 2014
Hi catalmco,

I don't know what profile10 is so have no idea how you access that data. Typically you will need to use either a DB Loader action or a MySQL query in a Custom Code action to get data from a DB table.

Bob
catalmco 22 Apr, 2014
Hi Bob,
I got it to work😉 What I did is that I noticed that on the php file in the action I saw the original ones that come out of the box with Joomla. The profile plugin that I made uses the same database table ect so I went in and added the field names to the php action file and then I added the action in two places. Onload and OnSubmit. I did it on load so that the user would see that their information was pre populated on the form they are submiting.
I ended up adding it on the On Submit because if I did not do it there then the generate dynamic email using the pre filled data was not getting populated in the email.
It worked great. 😉
Hopefully this will help othes as well.

PS: Profile10 is part of what came out with Joomla 1.7 ish and it allows you to "create" an additional "user plugin" to add fields to the basic "registration" form. It recomends using a different name from Profile to Profile10 so that Joomla updates do not damage the plugin.
Not sure if I can post a link here but here is the link to the docs section of joomla that describes this: (Creating a profile plugin)
http://docs.joomla.org/Creating_a_profile_plugin
This topic is locked and no more replies can be posted.