iPhoneclub
Customer
I think I'm running into a bug with vB Optimise Pro 2.0.1 and a custom plugin for mobile style redirection in combination with vB Optimise's setting 'Guest Full Page Caching'. In some occurrences guest users (on desktop-browsers) get the mobile style instead of the normal style. I think this is because some mobile guest user visited the page at the exact instant when the cache was ready for a refresh. I already have Cache Styles set to 'Off', but that hasn't helped anything. My opcode cache is set to 'memcached'.
The custom plugin I'm using runs at hook 'style_fetch' with an execution order of 5.
The custom plugin I'm using runs at hook 'style_fetch' with an execution order of 5.
Code:
// BROWSER DETECT
$safari = array(
"iPod",
"iPhone"
);
$browsers = array(
"Windows CE",
"WebTV",
"AvantGo",
"Blazer",
"PalmOS",
"lynx",
"Go.Web",
"Opera Mini",
"Elaine",
"ProxiNet",
"ChaiFarer",
"Digital Paths",
"UP.Browser",
"Mazingo",
"T68",
"Syncalot",
"NetFront",
"Danger",
"Symbian",
"Nokia",
"Xiino",
"AU-MIC",
"EPOC",
"BlackBerry",
"Wireless",
"Handheld"
);
if(preg_match('/('.implode('|', $safari).')/i', $_SERVER['HTTP_USER_AGENT'], $match)) {
$mobile=2;
} else if(preg_match('/('.implode('|', $browsers).')/i', $_SERVER['HTTP_USER_AGENT'], $match)) {
$mobile=1;
} else if (isset($_SERVER['HTTP_UA_OS'])) {
if (strstr($_SERVER['HTTP_UA_OS'],"POCKET PC") !== false) {
$mobile=1;
}
} else {
$mobile=0;
}
if ($_GET['no_mobile'] == 3) {
$styleid=2;
$vbulletin->options['styleid'] = 2;//Terug naar normale view
//} else if ($vbulletin->userinfo['userid']==1) {
//$styleid=9;
//$vbulletin->options['styleid'] = 9;//Test-skin
} else if ($mobile==2) {
$styleid=5;
$vbulletin->options['styleid'] = 5; // iPhone/iPod - vB default
} else if ($mobile==1) {
$styleid=3;
$vbulletin->options['styleid'] = 3;// PDA/Smartphone - mobile template