Custom Profile Field

Started by Laveer, January 18, 2013, 05:39:15 PM

Previous topic - Next topic

Laveer

I'm creating, or rather already have complete a licensing system for my software I'll soon be marketing. I'd like to know if there were any way I could either:

A) Create a new profile field from scratch and save it into a custom column added to smf_members.

or

B) Have the custom profile fields extension write to a custom columb added to smf_members.

I can't find the script where the data is written to the database.

Arantor

Does it absolutely *have* to be in smf_members?

The custom profile fields stuff that's a core feature in SMF 2.0 doesn't put it there.
Holder of controversial views, all of which my own.


Laveer

Custom User fields puts them in smf_themes, my licensing system needs to call the iD and grab the user column; but I can't do so using _themes because it'll cause a giant server load.

Arantor

Giant load, eh? Only if the query were not particularly efficient in the first place.

SELECT mem.id_member, th.value
FROM smf_members AS mem
LEFT JOIN smf_themes AS th
  ON (th.id_theme = 1 AND th.id_member = mem.id_member AND th.variable = 'cust_fieldname')
WHERE mem.id_member = <whatever the member's id is>

Should be very fast seeing how it's a match against the theme table's primary keys (in the right order, which means the query optimiser will use it; the PK of smf_themes is id_theme, id_member, variable(30))

As far as going through all the places required to put it in the smf_members table, the performance difference is going to be marginal at absolute best.
Holder of controversial views, all of which my own.


iksa

Please move this message under a proper topic if this is not the right place to ask another question about the custom profile fields.

In my forum new members can be registered only by moderators. But I don't see the custom profile fields that I have added in the moderator's registration form even though I have selected them to be visible in registration and even obligatory there. Is there something I am missing or do I need some mod?

Arantor

They're not there. The admin panel does not make them an option, never has, probably never will, because it's not supposed to be used for that purpose.
Holder of controversial views, all of which my own.


iksa

I register only members of a certain organization to my forum and at the same time I would like to use the forum as a member register so that I would not need to do duplicated work and keep that register somewhere else. For that purpose I would like to store data about the members like their addresses, phone numbers etc. in the forum database. If the custom profile fields are not meant to be used for this purpose, then is there some other solution to this? This data is not supposed to be visible to all users, but some of the data is supposed to be visible and some modifiable to the user himself.

Arantor

That is the sort off thing they are used for, except the admin panel registration bit is not, it is for quickly creating a user, nothing more.
Holder of controversial views, all of which my own.


iksa

Ok. I have requested such mod here.

Advertisement: