xF1 Different style per domain (code example)

  • Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Radio

    ven0m

    Administrator
    Staff member
    Administrator
    Moderator
    Platinum
    xenForo 2.x.x
    xenForo 1.x.x
    Contributor
    vBulletin All Access Pass
    The Chest
    Verified
    Ultra Platinum VIP
    Platinum VIP
    Gold VIP
    Silver VIP
    Premium
    Member
    Jul 17, 2005
    20,500
    7,741
    321
    localhost
    Heisenberg submitted a new resource:

    - Lets you override the style choice of the user, in this example by domain name.

    I made this simple addon to override the style choice by domain name. You need to edit the library/StyleOverride/Listen.php file to specify the domains and their style_ids:

    PHP:
    <?php
    
    class StyleOverride_Listen
    {
       public static function listen(XenForo_Controller $controller, $action)
       {
           $visitor = XenForo_Visitor::getInstance();
           $host = $controller->getRequest()->getServer('HTTP_HOST');
    
           if ($host == 'www.domain1.com')
           {...

     
    Last edited:
    Thread starter Similar threads Forum Replies Date
    ven0m xF1 Creating style without template edition Development Tutorials 0
    Similar threads