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.

Does not show up on 2.1 with latest Bootstrap

2»

Comments

  • @vrijvlinder i dont use a mobile theme.... i have a responsive theme.

    So then i cant filter it out right

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    if your theme has themehooks file you can add something like this

      /** Remove plugins that are not mobile friendly! */
       public function Gdn_Dispatcher_AfterAnalyzeRequest_Handler($Sender) {
          // Remove plugins so they don't mess up layout or functionality.
          if (in_array($Sender->Application(), array('vanilla', 'conversations')) || ($Sender->Application() == 'dashboard' && in_array($Sender->Controller(), array('Activity', 'Profile', 'Search')))) {
             Gdn::PluginManager()->RemoveMobileUnfriendlyPlugins();
          }
          SaveToConfig('Garden.Format.EmbedSize', '240x135', FALSE);
       }
    
  • @vrijvlinder If he has a responsive theme, you need to wrap that in

    if (IsMobile()) {...}
    
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yes thanks , basically you need more than that best look at a mobile theme here and see how it's built

    /**
     * Customizations for the mobile theme.
     */
    class MobileThemeHooks implements Gdn_IPlugin {
       /** No setup required. */
       public function Setup() { }
    
       /** Remove plugins that are not mobile friendly! */
       public function Gdn_Dispatcher_AfterAnalyzeRequest_Handler($Sender) {
          // Remove plugins so they don't mess up layout or functionality.
          if (in_array($Sender->Application(), array('vanilla', 'conversations')) || ($Sender->Application() == 'dashboard' && in_array($Sender->Controller(), array('Activity', 'Profile', 'Search')))) {
             Gdn::PluginManager()->RemoveMobileUnfriendlyPlugins();
          }
          SaveToConfig('Garden.Format.EmbedSize', '240x135', FALSE);
       }
    
       /** Add mobile meta info. Add script to hide iPhone browser bar on pageload. */
       public function Base_Render_Before($Sender) {
          if (IsMobile() && is_object($Sender->Head)) {
             $Sender->Head->AddTag('meta', array('name' => 'viewport', 'content' => "width=device-width,minimum-scale=1.0,maximum-scale=1.0"));
             $Sender->Head->AddString('
    <script type="text/javascript">
       // If not looking for a specific comment, hide the address bar in iphone
       var hash = window.location.href.split("#")[1];
       if (typeof(hash) == "undefined") {
          setTimeout(function () {
            window.scrollTo(0, 1);
          }, 1000);
       }
    </script>');
          }
       }
    
  • How can I disable it for mobile using the Boostrap theme @vrijvlinder

  • R_JR_J Ex-Fanboy Munich Admin

    Open the file class.creativecleditor.plugin.php and add 'MobileFriendly' => FALSE,to the $PluginInfo array

Sign In or Register to comment.