![]() |
Mobile Detection
There's a lot of info on changing a users theme if they are using a mobile browser. I'm looking to just change a few images and adsense code on various templates.
I have a taken some code out of init.php that vbulletin uses to detect various mobile browsers. I'm trying to create a single global variable that I can use vb if condition on it from any template on any theme. I've seen the VB_Template::preRegister code that lets you push php variables to single templates but I need it go to any template. So the question is, which hook and how do create a global variable that can be accessed from any template. I'ved attempted to use global $mobilemt as seen below in the global_bootstrap_init_start hook and {vb:raw mobilemt} in a template with no luck. PHP Code:
|
i know how much i love when google indexes questions with no solutions...
I was able to solve this using a hidden profile field. It seems to work... At the end of the plug in (global_start) i set it. Code:
*** snip *** Code:
<vb:if condition="$bbuserinfo[field15] == 'no'"> If anyone has any better suggestions, i'm open. |
All times are GMT. The time now is 05:21 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|