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

XF 1.3 CSS Help

Discussion in 'Styling and Customization Questions' started by billybatz9, Jun 6, 2014.

  1. billybatz9

    billybatz9 Active Member

    So I have this code for one of the xenforo addons:
    Code:
    <?php
    
    class Waindigo_ForumListTabs_ControllerPublic_Toggle extends XenForo_ControllerPublic_Abstract
    {
    
        public function actionIndex()
        {
            if (XenForo_Application::get('options')->waindigo_forumListTabs_enable) {
                $visitor = XenForo_Visitor::getInstance();
                $toggle = empty($visitor['use_forum_tabs']) ? 1 : 0;
    
                $userModel = $this->getModelFromCache('XenForo_Model_User');
                $userModel->update($visitor->toArray(), 'use_forum_tabs', $toggle);
            }
    
            return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS,
                $this->getDynamicRedirect(false, true));
        } /* END actionIndex */
    }
    How do I disable the plugin for visitors? I think this code says to enable the plugin for visitors, but I need it disabled for visitors. Any idea? Thanks
     
  2. Slavik

    Slavik XenForo Moderator Staff Member

    Do you need it disabled (doesnt work for visitors) or simply hidden?
     
  3. billybatz9

    billybatz9 Active Member

    Right now, it's enabled for visitors. I would love for it to be disabled for visitors.
     
  4. billybatz9

    billybatz9 Active Member

    So the only way to disable it for visitors would be to just delete the plugin pretty much?
     
  5. billybatz9

    billybatz9 Active Member

    The plugin is awesome for mobile (very responsive) and my users love it for mobile, but it just does not look too appealing for desktop view.
     
  6. Slavik

    Slavik XenForo Moderator Staff Member

    What are you trying to achieve? Your going along 2 different paths of thought here.

    One your on about disable it to visitors (i assume you mean non-registered users right?) and then the other is you dont want it on desktop view?

    Your thread says CSS, but then your posting PHP code opposed to templates.
     
  7. billybatz9

    billybatz9 Active Member

    I am going for disabling it to visitors (non-registered users). SOrry for the confusion. I thought it was css (see? I am bad at coding lol)
     
  8. Slavik

    Slavik XenForo Moderator Staff Member

    I think in that case you can add

    Code:
    $this->_assertRegistrationRequired();
    above

    Code:
    $visitor = XenForo_Visitor::getInstance();
    to do that.
     
  9. billybatz9

    billybatz9 Active Member

    Didn't work. But thanks anyways. I think I might just disable it. Not worth the headache for me or you to figure out.
     

Share This Page