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);
}
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>');
}
}
Comments
@vrijvlinder i dont use a mobile theme.... i have a responsive theme.
So then i cant filter it out right
if your theme has themehooks file you can add something like this
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
@vrijvlinder If he has a responsive theme, you need to wrap that in
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Yes thanks , basically you need more than that best look at a mobile theme here and see how it's built
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
How can I disable it for mobile using the Boostrap theme @vrijvlinder
Open the file class.creativecleditor.plugin.php and add
'MobileFriendly' => FALSE,
to the $PluginInfo array