The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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:reRegister 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:
|
#2
|
|||
|
|||
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 *** if ($mobile_browser_advanced||$mobile_browser) { { $mobilemt="yes"; } } $vbulletin->userinfo['field15'] = $mobilemt; Code:
<vb:if condition="$bbuserinfo[field15] == 'no'"> ..... </vb:if> If anyone has any better suggestions, i'm open. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|