• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Disable New Users From Selecting Style

Brent W

Well-known member
#1
I simply want to keep new users from selecting a style but allow previous people who already have that style selected to continue to use it. Currently, if I disable the style from selection it appears to kick everyone to the default style. Anyway around this without an add-on I am missing?
 

Jake Bunce

XenForo moderator
Staff member
#2
This may be a good starting point:

https://xenforo.com/community/resources/different-style-per-domain-code-example.394/

You might use a condition like this:

Code:
		// old users (based on user_id)
		if ($visitor['user_id'] < 2000)
		{
			// do nothing
		}
		// new users
		else
		{
			// if using the restricted style
			if ($visitor['style_id'] == 3)
			{
				// set it back to default
				$visitor['style_id'] = 1;
			}
		}
The restricted style will still show up as selectable for everyone, but this code will ensure the selection doesn't work for new users.
 

Brent W

Well-known member
#3
This may be a good starting point:

https://xenforo.com/community/resources/different-style-per-domain-code-example.394/

You might use a condition like this:

Code:
        // old users (based on user_id)
        if ($visitor['user_id'] < 2000)
        {
            // do nothing
        }
        // new users
        else
        {
            // if using the restricted style
            if ($visitor['style_id'] == 3)
            {
                // set it back to default
                $visitor['style_id'] = 1;
            }
        }
The restricted style will still show up as selectable for everyone, but this code will ensure the selection doesn't work for new users.
Thanks I will give this a look.