Buy Now
Sign in

is this the correct way to set up a Joomla a user with additional fields

hangbill , January 14 at 17:39
healyhatman 6.0
January 17 at 03:39 #382921
Right so remember what I said about how you should name the fields? You haven't done that.
fields[fieldname]
To delete the rows in your database, make a delete data action or just use MYSQL in PHPMyAdmin
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
H
hangbill 178
January 17 at 03:58 #382922
OK, I'll go through your feedback and look for what I missed. Will pick it up tomorrow.
Thanks for staying with this Healyhatman...
admin 27.0
January 17 at 14:48 #382948
Hi Bill,
I have a new action to store custom fields created using the Joomla fields manager, in that case you will only need to create the extra fields in Joomla and in your form you will need the "Joomla save user" action and the new "custom fields" action.
No need for a loop or an extra database table.
Best regards
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
H
hangbill 178
January 17 at 15:02 #382949
Ah, excellent Max.
Is the new action available in an update CF version?
admin 27.0
January 17 at 17:25 #382953
No, please send me a message using the contact us page and I will send you the file, it should be added in the next official update!
Best regards
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
H
hangbill 178
January 17 at 17:49 #382955
Will do, thanks.
But have gone so far, and seem so close, to the loop solution that I want to get this right too. Will likely be useful in other situations that require loops / saves etc
C
cesarmtz 2
January 24 at 01:08 #383227
Hi there. Did you get this to work?
H
hangbill 178
January 24 at 18:21 #383259
No, not yet. However Max did help by providing a patch that links the user table to _fields_values. It works but has a problem in that the _fields_values table has been built vertically. And it's going to be a challenge to format the output as a table, ie column headings with values under each heading. So am trying a new approach, create 2 forms, the first captures the Joomka user data, and the second form captures the additional data. The 2nd form is based on a horizontal table, ie a field for each additional piece of data. Then join the 2 forms, which should be easier to build a table listing. Bit complicated but long story short I will pick this post up again but have to redirect at this time.
healyhatman 6.0
January 24 at 21:27 #383264
To read them all for a table view you would have to do it the way I said. For your purposes better to create that additional table and link it through either user id or some other foreign key. When reading you add 5he second table as an additional model in your data read.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
H
hangbill 178
January 25 at 07:52 #383273
Yes, the design plan now is to try do the 2 forms in 1 step, ie submit and save the user form, then call the userid and open the 2nd form.
H
hangbill 178
February 11 at 11:40 #383804
Back on the job ... . Still need to solve.
Not sure if I should open a new post - this one is long and rambling.
To summarize, these are the requirements
  1. the site is a for a closed group, some 600 - 800 members
  2. need to register members as Joomla users, with additional fields (eg company, job title, occuption, experience etc)
  3. create a searchable directory of members (table format), so members can find one another. The directory will potentially include all of the submitted data, ie the Joomla User fields as well as the addtional fields
  4. create a form so that member can edit own registration details. For eg member might change company, job title etc. Only non-editable field is username, all other fields can be edited.
  5. The editing form must have the same functionality as the original submission form. For eg there are conditional form elements. If member changes a selection which in turn opens a different form element then the original value must be deleted from the database and the new one saved.
  6. Would like to build this functionality so that it's seamless from the member perspective, ie one form that submits to both the Users table as well to the new table that holds the additional fields.
healyhatman 6.0
February 11 at 11:42 #383805
What's the question?
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
I
itadminguy 31
February 11 at 23:06 #383822
just use easyprofile component to first create your fields which automatically gets created in their jsn_user table
then put any of those fields in your chronoform
the one main difference is that cf uses = for saving arrays like radio and checkboxes while easyprofile has to save as | when you create the same in easyprofile
then save to db jsn_users On Submit
or you can save individual fields one by one in a custom code On Submit
H
hangbill 178
February 12 at 11:58 #383834
Thanks.
What is the component name - I don't see an extension called easyprofile
healyhatman 6.0
February 12 at 12:00 #383835
There's no need to do that, just create the database table yourself it's not that hard
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
H
hangbill 178
February 12 at 12:08 #383836
Yes I have made the table. It has a primary key and and key to link to the Users table. But how do I create the query that links the two so that it operates like one table
healyhatman 6.0
February 12 at 12:11 #383837
I'm sure we went through this. In your read data add a second model, related it to the first model, put the relation conditions to
model1.userfield:model2.field2
Where the models and fields are whatever they're supposed to be
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
H
hangbill 178
February 12 at 12:16 #383838
Yes you prob did explain it. I'm getting so mixed up with this thing. Main thing trying to achieve is one shot solution from member perspective => one form, one submission, saved form data then available for editing by member. And of course all the additional field data sitting in its own table, not in the Users table.
Will check it out more this evening, thanks.
H
hangbill 178
February 16 at 21:31 #383924
OK, I've got the form submitting to two tables, the users table and a custom table I created. So have placed Save Data table inside the Save User and it works. Name, Username, Password and Email goes to the users table and the values of 15 other fields go to the misc_user_addfields table.
So here's the prob as far as I see it. The administrator gets a notification that a new user has registered. The admin has to approve the registration. So he goes to the Manage Users section in Joomla and can see the new registration. But the admin also needs the data that was submitted to the misc_user_addfields table in order to know whether to approve the registration. How does he know which record in misc_user_addfields relates to the relevant registration record in the users table.
The users table has an auto increment primary key, id. The misc_user_addfields table also has an id primary key, as well as a userid field that I can use as the foreign key for the users table. But as the form is submitted how does the key in the users table get added to the foreign key in misc_user_addfields so that the two tables are linked.
Image_154.png
Attachments
Image_154.png
Image_154.png
(25.31 KiB)
52 Downloads/Views
Image_154.png
Image_154.png
(25.31 KiB)
62 Downloads/Views
healyhatman 6.0
February 16 at 21:54 #383925
{var:joomla_user#.id}
And if you want to show all that you might have to make a CCv6 connection and you can have all the fields displayed and a button to enable the user.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums