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

Created new plugin but do not need it on mobile style

mmoore5553

Well-known member
#1
Okay I created some tabs that are on the side on the forum and works great but it shows on mobile skin which i do not want.

Anyone know any condition statements i can put not to show it ?

I been searching and unable to find anything.

Right now i have module called in 2 hooks - header and body .

So i know why it is showing up in both skins but unable to figure out how to just specifiy a specific style.
 

mmoore5553

Well-known member
#2
Okay this is the php file. I have tried to use an IF then and it still does not work. I believe because it is not accepting {$style.title}. I think i can redo the module where you have to put a hook in the template but rather not . Any ideas ?

PHP:
class socialaddon_Listener_social
{
    public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
    {
   
   
        if($hookName == 'body')
        {
       
       
       
            ob_start();
            require_once('slider.php');
            $contents .= ob_get_contents();
            ob_end_clean();
           
           
        }
 
R

ragtek

Guest
#3
this condition should work

$visitor = XenForo_Visitor::getInstance();
if ($visitor['style_id'] != MOB_STYLE_ID) {

}

then the code inside of the if condition won't be run in the mobile style:)
 

CTXMedia

Formerly CyclingTribe
#5
thanks ragtek but where would i put that and wouldn't the style ID be different for everyone install ?
No - the style ID is an internal XF reference to the style so everyone using that style will have the same number - just hover over the mobile style link in your ACP and you'll see the style ID in the URL.

Then update ragtek's conditional to include the number of your mobile style and put your tabs code inside the curly brackets. (y)

Cheers,
Shaun :D