![]() |
Mobile Device & Browser Detection (Adapted by BOP5)
1 Attachment(s)
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 Please "Mark as Installed" if you use this. :) Donations always appreciated. :up: Nominate MOTM if you LOVE it! ;) |
List of Compatible Mods:
(Will edit if more get added by any coder) Sidebar Anywhere - https://vborg.vbsupport.ru/showthread.php?t=283307 |
Thank you so much for this mod! Needed this today and just came on VBorg and found this was just recently released.
Worked perfectly! :D Edit: What do you recommend as to the best way to use these options in a template? |
The easiest way to implement this in a template would be to edit the plugin for this mod...
At the bottom add lines such as: PHP Code:
Code:
<vb:if condition="$vboptions['isMobile']">xxxx</vb:if> |
Nice mod. Thanks
|
Anybody knows if this plugin works for the mobile quotes? They don't appear in notifications.
|
I'm not sure what "mobile quotes" are so I doubt it. The only mod it works with I know of is my Sidebar Anywhere.
|
It doesn't work for 3.8.5. What a pity. :(
|
How to implement it in "footer" template ?
Where do i need paste it: Code:
if ($vbulletin->detect->isMobile()) |
Templates use template conditionals...
You can try: Code:
<vb:if condition="$vbulletin->detect->isMobile()"> Code:
<vb:if condition="$vbulletin->detect->isMobile()"> |
Will this work on v3.8.7?
Becuase this one doesn't https://vborg.vbsupport.ru/showthread.php?t=173239 |
Only for 4.x, sorry.
|
Nice mod :)
I suggest changing the hook to "init_startup" to be able to replace default mobile browser detection in init.php with: Code:
if($vbulletin->options['bop5_mob_detect']) |
Quote:
Code:
$vbulletin->detect->isTablet() - true if tablet |
Hey BOP, does this make our videos and stuff work on iPhones and pads?
|
Quote:
However to have YouTube and other videos work on iPhones and stuff check out these HTML 5 changes- https://vborg.vbsupport.ru/showthread.php?t=283594 |
upgrade pls
|
Thanks, installed, nominated
|
Just installed this on my site and it is treating all my devices as desktop browsers and not mobile. Any ideas on why that may be?
I've tested it with a nexus 4, nexus 7, and an Ipad 1 I'm using this to hide a footer ad from mobile users: PHP Code:
|
Quote:
|
This work with 4.2.2? Cause I installed it and I still get the regular site with my iphone.
|
Quote:
|
Quote:
Thanks. |
Quote:
Quote:
|
Quote:
|
Very nice mod indeed! Thanks.
|
One potential use I can see for this is controlling the number of columns shown on the CMS page when viewed on a mobile device as set in the Content Columns dropdown in the Section Information section of the (frontend) Section editor. Certainly for my site, it look much better as one column on a mobile device, but better as two columns on a desktop computer.
Is there an easy way to use this plugin to conditionify whatever bit of code sets the number of columns? |
vbulletin 3.8 ?
|
With this plugin can assign users how mobile themes?
|
To earlier question, how do you use this to change styles?
|
Quote:
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. |
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; But I want to show the desktop style in tablets, How do I fix this. Thanks in advance. |
Hello all,
Any help is appreciated. Am looking to nail the issue. Thanks. |
Not support Search Engine Friendly Archive on vbulletin 4.2.3
you test Code:
http://www.siteforyou.com/forum/archive/index.php |
User cannot change style if it is detected as mobile device?
|
Quote:
|
Quote:
This code this not working in templates |
What template are you trying? This is very old anyway, not sure how useful it is anymore.
|
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. |
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. |
All times are GMT. The time now is 03:23 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:
|