1. 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 ?

Discussion in 'XenForo Questions and Support' started by mbt131, Feb 17, 2014.

  1. mbt131

    mbt131 Member

  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    There is no mobile conditional. The individual add-on or an intermediary add-on on the server will have to disable them.
     
  3. mbt131

    mbt131 Member

    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 $hookParamsXenForo_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 -->'
    ;

            }

        }

    }
     
  4. cclaerhout

    cclaerhout Well-Known Member

  5. mbt131

    mbt131 Member

  6. cclaerhout

    cclaerhout Well-Known Member

    ... 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.
     

Share This Page