For those that want to allow the user to override the mobile style, this is what I've done on my board:
1.) Add a new profile field that allows them to set the behavior of visiting the site from a mobile device. It either uses the standard style, or the mobile style. I made it a 'Single Selection Menu', then set the two options to be 'Use Standard Version' & 'Use Mobile Version', with the default set to 'Yes, but No First Blank Option'. It's not a required field, it is editable by the user, it is a private field, it's not searchable on the Members List, and it's not shown on the member list. For the display page, I set it to 'Options: Thread Viewing' so that it shows in that section of the options page.
2.) Next, I added a few lines of code to the 'Mobile Detection' product. The code is:
Code:
if($vbulletin->userinfo['field8'] == 'Use Standard Version')
{
$custom1=1;
}
Where 'field8' is what field number my custom user field is, and 'Use Standard Version' is the option to look for. If you translate the phrases to another language, you'll need to change that. You also need to change the field number to match your custom field number.
I added the above code snippet in two places, once after this block:
Code:
$exceptbrowsers = explode(",",$vbulletin->options['brows_exceptions']);
if(preg_match('/('.implode('|', $exceptbrowsers).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
{
$except_browser=1;
}
and once after this block:
Code:
if ($vbulletin->options['custom1_skin_enabled'] == 1)
{
$custom1agents = explode(",",$vbulletin->options['custom1_skin_agent']);
if(preg_match('/('.implode('|', $custom1agents).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
{
$custom1=1;
}
}
Oh, I forgot to mention, this will use the style chosed for 'Custom/User Defined Devices Style?' in the settings for this product. I'm sure this could be extended to allow using the users default style, but on my board, there's only three styles, the 'regular' style & the mobile style for regular mobiles & one for iPhones. None are user selectable.
I'm attaching a screenshot of my new profile field, as well as a copy of the modified Mobile Device Detection & Assignment xml file. Let me know if you have any questions.
--JOsh