Welcome Guest, Not a member yet? Register   Sign In
User specific settings
#1

[eluser]codeninja[/eluser]
Looking to bounce some ideas on having custom settings for each user. So the idea is to have an overall default settings and then load user specific settings once the user logs in.

What would be a good scalable way of doing this?
#2

[eluser]richthegeek[/eluser]
I store the settings as JSON string in the user's database record. Set up a default stdClass object and then overwrite the settings onto that.

Code:
$default = new stdClass;
$default->one = "some default";
$default->two = 480;

foreach( $user->settings as $k=>$v ) $default->$k = $v;

$user->settings = $default;




Theme © iAndrew 2016 - Forum software by © MyBB