• 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

billybatz9

Active member
#1
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
 

billybatz9

Active member
#5
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.
 

Slavik

XenForo moderator
Staff member
#6
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.
 

billybatz9

Active member
#7
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.
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)
 

Slavik

XenForo moderator
Staff member
#8
I think in that case you can add

Code:
$this->_assertRegistrationRequired();
above

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

billybatz9

Active member
#9
I think in that case you can add

Code:
$this->_assertRegistrationRequired();
above

Code:
$visitor = XenForo_Visitor::getInstance();
to do that.
Didn't work. But thanks anyways. I think I might just disable it. Not worth the headache for me or you to figure out.