1 afwas May 01, 2008 00:05
3 afwas May 01, 2008 02:26
Blueyed, when answering the same question in IRC came with a nifty idea: make a DefaultSetting the default for the DefaultUserSetting. That way the admin can do some suggestions and only the sturdy user will bother to change it. Everybody happy.
Thanks for your answer. One of those stupid things. I was busy with something and all of a sudden I was perplexed by the DefaultUserSetting, not having a clue what was meant by it.
Have fun
4 edb May 01, 2008 03:01
Afwas wrote:
Blueyed, when answering the same question in IRC came with a nifty idea: make a DefaultSetting the default for the DefaultUserSetting. That way the admin can do some suggestions and only the sturdy user will bother to change it. Everybody happy.
...
Actually that's exactly what I do with creativecommons. I do it via telling the DUS to use the DS, meaning I must code it to behave that way as opposed to it automagically happening. IF it were to be automatically looking to DS for initial values then it needs to deal with the fact that there might not be DS for any given setting. For example if you make a plugin that allows for "phone number" or whatever then obviously there is no "stock" answer that will satisfy all users. Basically I'd hate to have to write DefaultSettings so that DefaultUserSettings will pick up (empty) as the value ... if that makes any sense.
DefaultSettings are settings you will set on the plugin's settings page. DefaultUserSettings will be set on the user's profile page. I think typically what you do is say that your default DUS value equals your DS value so that the admin can set the initial value and the user can then over-ride those values, but AFAIK there is no law for that. Meaning you could probably do a plugin that has NO DS settings - everything would be unique to the DUS values.
Holy cow it just dawned on me that custom profile fields is *right there*! I've used that hook ever since forever and I never actually noticed that a plugin for "phone number address blahblahblah" is a one-hook no-brainer.
You access the DUS version just like you would the DS version only with a User thrown in the appropriate line. I don't have a plugin open in front of me but I doubt you need a sample ;)