Question Mobile style redirect conflict

Status
Not open for further replies.

rudy1220

Customer
We have just developed a mobile theme for our site and coded a very simple plugin to detect mobile users and redirect them accordingly. However, when Vboptimise is enabled, desktop guests will often see the mobile theme instead of the desktop theme. And sometimes mobile guests will see the desktop theme instead of the mobile theme.

This is obviously because of the full page caching for guests, but we don't want to disable that feature as it saves us quite a bit of load on our databases.

Our plugin is very simple. It is at the style_fetch hook

Code:
require 'mobile-detect/mobile-detect.php';
$mobile_detection = new Mobile_Detect;
if($mobile_detection->isMobile() && !$mobile_detection->isTablet()) {

  $styleid = 10;
}

Is there some other place that we should be detecting the user's device at? style_fetch has always worked fine for us but it definitely doesn't work with full page caching enabled for guests.
 
To make vB Optimise recognise the style IDs as different, you need to make sure either $_COOKIE[COOKIE_PREFIX . 'userstyleid'] is set to your style ID, or either $vbulletin->mobile_browser or $vbulletin->mobile_browser_advanced is set to true.
 
Status
Not open for further replies.

Legacy vB Optimise

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
1,977
Customer rating
0.00 star(s) 0 ratings
Back
Top