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

Specific User Group Style Selection

Discussion in 'Styling and Customization Questions' started by theArchitect, Aug 20, 2012.

  1. theArchitect

    theArchitect Member

    I can see that a style can be manually set for a user group or forum in the Admin CP. However, I want to limit the ability to choose different styles to specific groups. That way style choice is a privilege for active members rather than a right for all users.

    Any thoughts?
     
  2. Russ

    Russ Well-Known Member

    I don't think there's anything built in to help with this but:

    you could do this edit, in footer:

    Code:
                    <xen:if is="{$canChangeStyle}">
                        <dt>{xen:phrase style}</dt>
                        <dd><a href="{xen:link 'misc/style', '', 'redirect={$requestPaths.requestUri}'}" class="OverlayTrigger Tooltip" title="{xen:phrase style_chooser}">{$visitorStyle.title}</a></dd>
                    </xen:if>
    
    Replace with:

    Code:
                    <xen:if is="{$canChangeStyle} AND {xen:helper ismemberof, $visitor, x}">
                        <dt>{xen:phrase style}</dt>
                        <dd><a href="{xen:link 'misc/style', '', 'redirect={$requestPaths.requestUri}'}" class="OverlayTrigger Tooltip" title="{xen:phrase style_chooser}">{$visitorStyle.title}</a></dd>
                    </xen:if>
    
    x being the usergroup you want to allow to choose, or use x,y,z to allow multiple groups.

    The downside with this method.... is it doesn't really BLOCK any guest from using the style, as they could type in a specific URL to change the style if they new the style ID number but it will hide the link in the footer.

    EDIT: Forgot:

    In account_preferences
    find:

    Code:
        <xen:if is="{$canChangeStyle}">   
    
    Replace with:

    Code:
    <xen:if is="{$canChangeStyle} AND {xen:helper ismemberof, $visitor, x}">
    
     
  3. theArchitect

    theArchitect Member

    Thank you,

    Will give it a go.
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

Share This Page