Quote:
Originally Posted by BadgerDog
Hi dartho....
I'm trying to get this overide option to work as well....
I installed (imported) the "mobdetect-allow_change_b.xml", but it doesn't seem to let me switch skins from my iPhone. It just stays with the "mobile" skin regardless of what I select.
|
mobdetect-allow_change_b.xml doesn't appear to work. It's trying to set the bbstyleid cookie, which doesn't exist. It should be changing the styleid cookie.
Here are my modifications to the original mod to give users the ability to select another style after being presented with the mobile style. The check is also only done the first time the user hits the website each session.
Replace the first two lines of the plugin code from:
PHP Code:
if ($vbulletin->options['mob_detect_enabled'] == 1)
{
to:
PHP Code:
// make the cookie name a constant
define('MOD_DETECT_FLAG','mod_detect_flag');
// clean cookie
$vbulletin->input->clean_array_gpc('c', array(COOKIE_PREFIX . MOD_DETECT_FLAG => TYPE_BOOL,));
// we only need to do this once, if the cookie doesn't exist
if ($vbulletin->options['mob_detect_enabled'] == 1 &&
empty($vbulletin->GPC[COOKIE_PREFIX . MOD_DETECT_FLAG]))
{
// add the cookie, it only lasts as long as the session
vbsetcookie(MOD_DETECT_FLAG, true, false);
and the end of the plugin code, from:
PHP Code:
// echo "<!-- No Mobile Device-->";
}
}
to:
PHP Code:
// echo "<!-- No Mobile Device-->";
}
// add the cookie
vbsetcookie('styleid', $styleid);
}