Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Disable Mobile Detection

I want the forum to stop detecting whether I'm on mobile or not since some of the plugins wont work on mobile even with mobile friendly set to true. Is there a way to achieve this ?

Comments

  • edited June 2015

    since some of the plugins wont work on mobile even with mobile friendly set to true

    Have you wondered if by any chance there is a reason for plugins that work on desktop may not work on Mobile ? Or maybe you think that all plugins work on mobile but because it detects you are on a mobile that is the reason why they do not work or "want" to work ?

    Or maybe you know something that those people who made the plugins not work for a mobile for some reason ?

    How does a browser detect what device a user is on and how does it decide to serve what content and why ?

    Ever wonder what makes a website Mobile Friendly ? It certainly is not making it not detect what device a user is on.... It is about the content and how it is served...

    Making your website not mobile friendly is not very smart... based on the question, no surprise here... The better question would by why?

  • R_JR_J Admin

    @Gogito said:
    I want the forum to stop detecting whether I'm on mobile or not since some of the plugins wont work on mobile even with mobile friendly set to true.
    Is there a way to achieve this ?

    As vrijvlinder already said, it would be better to find out why a) a plugin isn't set as MobileFriendly and b) why it still doesn't work if set as MobileFriendly.

    But if you have a responsive theme and you know all about your plugins, you can override the mobile detection like that:

    <?php
    function IsMobile($Value = null) {
        return false;
    }
    

    Put that in a file called /conf/bootstrap.before.php:

  • @vrijvlinder said:
    Making your website not mobile friendly is not very smart... based on the question, no surprise here... The better question would by why?

    I'm currently using Bootstrap and as we all know, it doesn't support styling forembed comment yet, thanks to Bleistivt help, I was able to have a plugin that change the theme of the embed comment. I created a new theme from bootstrap called bootstrapcomment and modify its css to make the comment looks good. I didn't modify the main bootstrap since while looks good on the comment, it looks bad on the actual forum. Everything is going smoothly, the embed comment will looks good even when resizing the browser as long as it was load on the desktop since the plugin wont work on mobile and will load the main bootstrap theme which have no styling for it. And the plugin was from Bleistivt himself and we haven't found a way to make this work.

    @R_J I tried your method but now it stopped the forum from loading. All I did was to paste that at the end of bootstrap.before.php.

  • R_JR_J Admin

    If you already have such a file, you only need to append lines 2-4

  • @R_J said:
    If you already have such a file, you only need to append lines 2-4

    Yay, it worked, thanks a lot @R_J

  • But if you have a responsive theme and you know all about your plugins, you can override the mobile detection like that

    why not just set the mobile theme to the same? No need for an override.

    grep is your friend.

  • @x00 said:
    why not just set the mobile theme to the same? No need for an override.

    That is true for most case but in my case, it involve stuffs I described above so it's kinda different.

  • LincLinc Admin

    Dealing with mobile issues:

    • Make sure plugins you're using set MobileFriendly => TRUE in their about file. If they don't, inquire with the plugin author.
    • Set your mobile theme to the same as your default theme (Garden.MobileTheme set to the value of Garden.Theme) if you don't wish to use a separate mobile theme.

    Overriding mobile detection is the quick-and-easy hack that could cause you more trouble down the road. It's the equivalent of editing your default.master.tpl in core rather than making a theme. You're using the path of least resistance and putting the work off til later rather than doing the work up front.

  • @Linc said:
    Dealing with mobile issues:

    • Make sure plugins you're using set MobileFriendly => TRUE in their about file. If they don't, inquire with the plugin author.
    • Set your mobile theme to the same as your default theme (Garden.MobileTheme set to the value of Garden.Theme) if you don't wish to use a separate mobile theme.

    Overriding mobile detection is the quick-and-easy hack that could cause you more trouble down the road. It's the equivalent of editing your default.master.tpl in core rather than making a theme. You're using the path of least resistance and putting the work off til later rather than doing the work up front.

    Thanks for that but I've inquired Bleistivt about the plugin and I don't think anything will be bad since bootstrap theme is responsive.

  • BleistivtBleistivt Moderator

    @Gogito said:
    Thanks for that but I've inquired Bleistivt about the plugin and I don't think anything will be bad since bootstrap theme is responsive.

    And I told you it doesn't serve as a permanent solution, because switching themes with a plugin on a request basis is not really possible.

    If you want to solve this problem at ist root, look into fixing the embedded comment area on the bootstrap theme.

  • @Bleistivt said:

    I did fix it by making a new theme and use your plugin to call that theme upon embed since fixing the style for the embed comment affect the comment area of the main forum itself. And yes, I know it is not optimal but it seems to be working as of now, I'll keep checking everything and try to look for a way to fix it at its root like you say.

  • Just to clarify, I am using the Voting plugin with Bootstrap and I want to disable thenVoting plugin from showing in my mobile theme. To do so, I add the command in bootstrap.before.php? Where exactly do I place this file?

  • @benjy000

    I'd think if you set

    MobileFriendly => TRUE to FALSE in the about.php of the voting plugin, that would stop it showing in mobile views.

  • @whu606

    The voting plugin doesn't have an about.php file. In class.voting.plugin.php I added the line and it broke my page altogether.

  • @benjy000

    Sorry, I don't have Bootstrap to test.

    The correct syntax would be

    'MobileFriendly' => true,

    I downloaded the Voting plugin, and it doesn't show up in my test mobile view, even without the line added.

Sign In or Register to comment.