Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Mobile Device & Browser Detection (Adapted by BOP5) Details »»
Mobile Device & Browser Detection (Adapted by BOP5)
Version: 1.00, by BirdOPrey5 (Senior Member) BirdOPrey5 is offline
Developer Last Online: Aug 2023 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 4.x.x Rating:
Released: 12-05-2012 Last Update: Never Installs: 60
Uses Plugins
Re-useable Code Additional Files  
No support by the author.

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

File Type: zip Mobile Browser Detect v1.zip (13.9 KB, 402 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
RichieBoy67

Comments
  #2  
Old 12-06-2012, 01:04 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Sidebar Anywhere - https://vborg.vbsupport.ru/showthread.php?t=283307
Reply With Quote
  #3  
Old 12-06-2012, 11:03 PM
RedTurtle's Avatar
RedTurtle RedTurtle is offline
 
Join Date: May 2006
Location: California
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you so much for this mod! Needed this today and just came on VBorg and found this was just recently released.

Worked perfectly!

Edit: What do you recommend as to the best way to use these options in a template?
Reply With Quote
Благодарность от:
BirdOPrey5
  #4  
Old 12-07-2012, 02:04 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
Благодарность от:
RedTurtle
  #5  
Old 12-07-2012, 05:33 AM
v123shine v123shine is offline
 
Join Date: Sep 2008
Posts: 242
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice mod. Thanks
Reply With Quote
  #6  
Old 01-12-2013, 01:01 PM
acast acast is offline
 
Join Date: Aug 2008
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anybody knows if this plugin works for the mobile quotes? They don't appear in notifications.
Reply With Quote
  #7  
Old 01-12-2013, 01:53 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 01-15-2013, 10:09 AM
sinomama sinomama is offline
 
Join Date: Sep 2008
Location: Suisse
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It doesn't work for 3.8.5. What a pity.
Reply With Quote
  #9  
Old 02-21-2013, 06:13 PM
bartek24m bartek24m is offline
 
Join Date: Nov 2005
Posts: 174
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How to implement it in "footer" template ?

Where do i need paste it:
Code:
if ($vbulletin->detect->isMobile())
  $vbulletin->options['isMobile'] = 1;
Reply With Quote
  #10  
Old 03-03-2013, 12:07 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:09 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.13608 seconds
  • Memory Usage 2,329KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (3)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete