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

XF 1.0 Set a style for userid 4

alexD

Well-known member
#2
I guess you should edit that user's preferences via the adminCP.

Go to: /admin.php?users/4/edit
Click on the Preferences tab
Select the customized style
Save

-The executed code can be found in the corresponding controller:
XenForo_ControllerAdmin_User->actionSave()
Is this what you meant with query?
 
F

Floris

Guest
#3
Changing that does mean that the user can go into the preferences and change it back again though. (just fyi)
 

Jake Bunce

XenForo moderator
Staff member
#7
Here is a simple addon for that. You need to specify the user_id and style_id in the code:

library/ForceStyleForUser/Listen.php

Code:
<?php

class ForceStyleForUser_Listen
{
	public static function listen(XenForo_Visitor &$visitor)
	{
		if ($visitor['user_id'] == 1)
		{
			$visitor['style_id'] = 3;
		}
	}
}
 

Attachments

Claudio

Well-known member
#8
thanks jame, I wanted to force him to view the style first (not to force him for ever) so the suggest of alexD was the best :)