The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Mobile Device & Browser Detection (Adapted by BOP5) Details »» | |||||||||||||||||||||||||||||
Mobile Device & Browser Detection (Adapted by BOP5)
Developer Last Online: Aug 2023
This mod has no settings or options.
Installed alone and you will see nothing new. The purpose of this mod is to bring a reliable way of detecting mobile browsers and devices to vBulletin for use in other mods. Currently the only mod I know it is recommended for is my Sidebar Anywhere mod. The bulk of the work of this mod is done by a publicly available PHP Mobile Detection class from: http://code.google.com/p/php-mobile-detect/ The file name was changed to prevent conflicts but the file contents including license information remains unchanged. Once installed the mod will allow you to use $vbulletin->detect to detect various mobile options anywhere $vbulletin variable is available in the code. Its plugin load priority is set to 1 so it executes before all other plugins. Code:
$vbulletin->options['bop5_mob_detect'] = true; //True if mod enabled/installed $vbulletin->detect->isMobile() - true if any mobile device $vbulletin->detect->isTablet() - true if tablet $vbulletin->detect->isiOS() - true if any iOS device $vbulletin->detect->isAndroidOS() - true if any Android Please "Mark as Installed" if you use this. Donations always appreciated. :up: Nominate MOTM if you LOVE it! Download Now
Show Your Support
|
Благодарность от: | ||
RichieBoy67 |
Comments |
#32
|
||||
|
||||
Create a plugin on the style_fetch hook...
Code would be: PHP Code:
That is a bare bones plugin. It will change to the mobile style if a mobile device is detected. The problem is that no one could ever change back to the regular style on a mobile device. You probably want to add some code to deal with that. For example if you are doing this to appease Google then maybe you only want to make this plugin active if it's a guest viewing the site, and not a registered member. In that case add a check to the conditional- PHP Code:
If you want to get fancier you can use a cookie or something. |
#33
|
|||
|
|||
Hello BOP5,
I have installed this plugin and want to make use it such that for tablets I want to show the users desktop style. The desktop style id is 16 and I used the below plugin Product: vbulletin Hook Location : style_fetch Code:
global $vbulletin; $tabstyle = 16; //Set this to the id of your mobile style if($vbulletin->detect->isTablet()) { $styleid = $tabstyle; $_REQUEST['styleid'] = $tabstyle; $vbulletin->GPC['styleid'] = $tabstyle; } But I want to show the desktop style in tablets, How do I fix this. Thanks in advance. |
#34
|
|||
|
|||
Hello all,
Any help is appreciated. Am looking to nail the issue. Thanks. |
#35
|
||||
|
||||
Not support Search Engine Friendly Archive on vbulletin 4.2.3
you test Code:
http://www.siteforyou.com/forum/archive/index.php |
#36
|
|||
|
|||
User cannot change style if it is detected as mobile device?
|
#37
|
||||
|
||||
This mod doesn't force anything, it is only for people writing their own custom code.
|
#38
|
|||
|
|||
Quote:
This code this not working in templates |
#39
|
||||
|
||||
What template are you trying? This is very old anyway, not sure how useful it is anymore.
|
#40
|
|||
|
|||
Hi,
On 4.2.4. , I am trying to use this templates : <vb:if condition="$vbulletin->detect->isMobile()"> {vb:raw test1} <vb:else /> {vb:raw test2} </vb:if> but it doesn't work. Any idea why? Thanks. |
#41
|
|||
|
|||
Quote:
I have managed to create a vB 3 version of this, with additional functionality for responsive styles. If you permit, I will release it as a new mod. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|