1. 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

Discussion in 'XenForo Questions and Support' started by Claudio, Nov 5, 2011.

  1. Claudio

    Claudio Well-Known Member

    I want to set a customized style for the userid 4... which is the query I should execute?
  2. alexD

    alexD Well-Known Member

    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

    -The executed code can be found in the corresponding controller:
    Is this what you meant with query?
  3. Floris

    Floris Guest

    Changing that does mean that the user can go into the preferences and change it back again though. (just fyi)
    alexD likes this.
  4. Claudio

    Claudio Well-Known Member

    thanks :)

    It was to do him a joke (he has preferences with hot woman haha)
  5. Floris

    Floris Guest

    Hey now, I have a preference for hot women too!
  6. Claudio

    Claudio Well-Known Member

    Sure? I wasnt 100% sure haha
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Here is a simple addon for that. You need to specify the user_id and style_id in the code:


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

    Attached Files:

    Fuhrmann likes this.
  8. Claudio

    Claudio Well-Known Member

    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 :)

Share This Page