XF 1.0 Set a style for userid 4

Claudio

Well-known member
I want to set a customized style for the userid 4... which is the query I should execute?
 
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?
 
Here is a simple addon for that. You need to specify the user_id and style_id in the code:

library/ForceStyleForUser/Listen.php

Rich (BB code):
<?php

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

Attachments

Top Bottom