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

XF 1.2 How can I disable a add on for mobile ?

Jeremy

Well-known member
#2
There is no mobile conditional. The individual add-on or an intermediary add-on on the server will have to disable them.
 
#3
This is my plugin code that I want to disable for mobile.Yes only one file available for this plugin.Can you help me with this ?

PHP:
<?php





class socialaddon_Listener_social

{

    public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)

 
        if($hookName == 'body')

        {

            ob_start();

            require_once('arscode-social-slider/arscode-social-slider.php');

            $contents .= ob_get_contents();

            ob_end_clean();

        }

       

       

        if($hookName == 'header')

        {

            $contents .='<!-- arscode social slider -->

        <link rel="stylesheet" media="screen" href="arscode-social-slider/fblb.css"/>

        <!--[if lte IE 7]>

        <link rel="stylesheet" media="screen" href="arscode-social-slider/ie7.css?ver=3.2.1" />

        <![endif]-->

        <script type="text/javascript" src="arscode-social-slider/js/userscripts.js"></script>

        <!--[if lte IE 7]>

            <script type="text/javascript" src="arscode-social-slider/js/userscripts-ie7.js"></script>

        <![endif]-->

        <!-- END arscode social slider -->';

        }

    }

}
 

cclaerhout

Well-known member
#6
I don't have much experience about variables.How can I disable add onn for mobile with using this add on?
... you've got your code above, you wrap it into a condionnal. I've given many examples in the ressource description. If you don't understand them, this addon is then not what you're looking for.