How to extend user object and table

132 views
Skip to first unread message

peterswa62

unread,
Feb 20, 2012, 9:51:25 PM2/20/12
to Joomla! General Development
I want to have a membership in a joomla site where people sign up as
members. Is it best to extend the user:- the jos_user table with
fields such as address, fax phone etc or create a new table and link
it somehow with the user table with a common key, or a completely new
table and member object completely seperate from jos_user. If I extend
jos_user it will contain redundant fields for users who are not
members but creating a seperate table will make it more complicated.
What is the best approach and are their any good extensions that can
be used to do this?

elin

unread,
Feb 20, 2012, 10:31:14 PM2/20/12
to joomla-de...@googlegroups.com
You can specify different user profile plugins for different groups, so you may want to try using those. You don't get any unneeded fields with the profile table. 

Elin

JSamir

unread,
Feb 21, 2012, 1:11:54 PM2/21/12
to joomla-de...@googlegroups.com
How exactly can we specify different plugins for different groups?

elin

unread,
Feb 21, 2012, 5:26:22 PM2/21/12
to joomla-de...@googlegroups.com
Two possibilities.

The profile plugin as it currently exists is designed to manage multiple profiles each represented by a separate xml file.  So
you can just use conditional code in your plugin,pulling in different forms for different groups, which nicely lets some people get fields from several groups if that is appropriate.

The other is to assign an access level to separate plugins. Many people are surprised to learn that plugins have access levels but they do, right in the UI,

The current profile plugin is also not the only way that you can structure a plugin adding forms to the profile views, it's just one example.

Elin


Mike Smith

unread,
Feb 21, 2012, 5:40:21 PM2/21/12
to joomla-de...@googlegroups.com
..and the documentation on these "hidden" features is.......?

> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! General Development" group.
> To view this discussion on the web, visit
> https://groups.google.com/d/msg/joomla-dev-general/-/Visil5zLVK0J.
> To post to this group, send an email to joomla-de...@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-gene...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/joomla-dev-general?hl=en-GB.

elin

unread,
Feb 21, 2012, 8:56:53 PM2/21/12
to joomla-de...@googlegroups.com, b10...@gmail.com
You know you are talking to the person who spent 3 months making sure that all of the arguments in every method in the platform were documented, i really do not appreciate the tone of your comment. This is a community project, there are help screens that show you how to set an access level if you can't be bothered to just open the UI and look for the field. And Google is your friend for finding out how to write a profile plugin.



You need to be willing to help yourself.

Elin

JSamir

unread,
Feb 22, 2012, 9:45:30 AM2/22/12
to joomla-de...@googlegroups.com
Thanks, i did not know the ACL sfuff. But i wonder how is that supposed to work with the registration form? Every user is in the same group at that point, or?

elin

unread,
Feb 22, 2012, 10:40:22 AM2/22/12
to joomla-de...@googlegroups.com
Well how were you planning to identify these different groups before registration? Wouldn't you just query against whatever data that is?

Maybe you need to talk about what it is exactly you are trying to do.

Elin

JSamir

unread,
Feb 23, 2012, 1:53:52 AM2/23/12
to joomla-de...@googlegroups.com
I had a similar issue which was already discussed in the list some time ago, i was just asking because i thought there are maybe some new approaches, which doesnt seem to be the case.
https://groups.google.com/forum/#!topic/joomla-dev-cms/HEwCi3CNoT0

At the end i used a hidden menu in which i made 3 menu items (each one for one subscription type), then i linked those menu types from within the article and in my user plugin i checked the itemid to display the proper form.

elin

unread,
Feb 23, 2012, 11:13:45 PM2/23/12
to joomla-de...@googlegroups.com
So are you saying you just want to let people have three different sets of options they choose from? Or are you saying that you want to choose the options for them based on some variable, like geolocation or a  something in the session?

Elin

JSamir

unread,
Feb 24, 2012, 5:08:30 PM2/24/12
to joomla-de...@googlegroups.com
Yes its a set of options.

Currently its just an article with pictures, and the pics are links to the Items of a hidden menu, so the links have ItemIds, which I use in the Plugin to recognise which link (option) the user has chosen.
Reply all
Reply to author
Forward
0 new messages