vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Integration with vBulletin - Mobile Device & Browser Detection (Adapted by BOP5) (https://vborg.vbsupport.ru/showthread.php?t=292704)

BirdOPrey5 12-05-2012 11:00 PM

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

$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! ;)

BirdOPrey5 12-06-2012 01:04 AM

List of Compatible Mods:
(Will edit if more get added by any coder)

Sidebar Anywhere - https://vborg.vbsupport.ru/showthread.php?t=283307

RedTurtle 12-06-2012 11:03 PM

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?

BirdOPrey5 12-07-2012 02:04 AM

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:

if ($vbulletin->detect->isMobile())
  
$vbulletin->options['isMobile'] = 1

Then in a template you can use...

Code:

<vb:if condition="$vboptions['isMobile']">xxxx</vb:if>

v123shine 12-07-2012 05:33 AM

Nice mod. Thanks

acast 01-12-2013 01:01 PM

Anybody knows if this plugin works for the mobile quotes? They don't appear in notifications.

BirdOPrey5 01-12-2013 01:53 PM

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.

sinomama 01-15-2013 10:09 AM

It doesn't work for 3.8.5. What a pity. :(

bartek24m 02-21-2013 06:13 PM

How to implement it in "footer" template ?

Where do i need paste it:
Code:

if ($vbulletin->detect->isMobile())
  $vbulletin->options['isMobile'] = 1;


BirdOPrey5 03-03-2013 12:07 PM

Templates use template conditionals...

You can try:

Code:

<vb:if condition="$vbulletin->detect->isMobile()">
Use this HTML code if mobile
</vb:if>

or

Code:

<vb:if condition="$vbulletin->detect->isMobile()">
Use this HTML code if mobile
<vb:else />
Use this code if NOT mobile
</vb:if>



All times are GMT. The time now is 07:28 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
  • Page Generation 0.01064 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete