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
VB4 - Mobile Phone / iPhone / PDA Detection and Style Assignment Details »»
VB4 - Mobile Phone / iPhone / PDA Detection and Style Assignment
Version: 1.0.1, by dartho dartho is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Category: Add-On Releases - Version: 4.0.6 Rating:
Released: 09-04-2010 Last Update: 09-06-2010 Installs: 323
Uses Plugins
Re-useable Code  
No support by the author.

This is a direct port from my 3.x versions which detects most mobile phones, iPhones, PDAs and other mobile browsing devices and automatically presents the user with a specific vBulletin style.

The one significant addition over previous versions is that a user can now over-ride the style assignment - more information in the notes section.

This will probably work with previous versions of vBulletin (but untested)

What can it do?Detects most mobile phones and presents the user with a specific style. If you have multiple styles installed which are optimized for small screen mobile devices, iPhones, WIndows Mobile devices you can assign a specific style to each of these groups.

Whilst designed with mobile device users in mind, you could also assign styles to self defined browsers. For example you can assign an alternative style to Internet Explorer users whilst Firefox users get the default style. You could also assign an alternative style to Google or Yahoo spiders.

Instructions:
0. Install styles which you wish to assign to Mobile/PDA/iPhone users
0.5 Uninstall previous versions
1. Download the product file
2. Install via Product Manager
3. Configure options via vBulletin Options, Mobile Device Detection (should appear at end)
4. Start browsing from your mobile device!
5. Click "Mark as Installed"

If upgrading from a previous 3.5, 3.6 or 3.7 version, you will need to uninstall that and the install this one.

To uninstall simply uninstall the product - there are no database changes or additional files.

See HERE for a lightweight vBulletin 4 style to go along with this addon

Version Control
1.0.0 - Initial Release
1.0.1 - Add option to enable/disable overriding style assignment.

Notes
Previous versions of this mod have forced a mobile device to a specific style, this is no longer the case! If a user now follows a link which changes the style (using a URL parameter of "styleid=xx") they will then be given that style for the rest of their session. If they close their browser and reload your site, they will then be detected again. Cookies must be enabled on the users browser for overriding detection to work

To Do
  • Add an option for users to be able to permanently NOT be detected as a mobile device or explicitly use a specified style.
  • Add more devices to detection
  • [S]Add option to disable override globally[/S]

Download Now

File Type: xml product-mobdetect40.xml (11.9 KB, 247 views)
File Type: xml product-mobdetect40.1.0.1.xml (12.9 KB, 1635 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
asepdoank12, mapleleaffans

Comments
  #12  
Old 09-05-2010, 10:52 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Question: How many additional database queries are required by this add-on?
Reply With Quote
  #13  
Old 09-05-2010, 11:29 PM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

zero
Reply With Quote
  #14  
Old 09-05-2010, 11:37 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dartho View Post
zero
Great. That's what I thought I was seeing but I wasn't sure how it was possible to determine the device being used without additional queries.
Reply With Quote
  #15  
Old 09-06-2010, 01:00 AM
CvP's Avatar
CvP CvP is offline
 
Join Date: Aug 2006
Posts: 263
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by djbaxter View Post
Great. That's what I thought I was seeing but I wasn't sure how it was possible to determine the device being used without additional queries.
http://en.wikipedia.org/wiki/User_agent
Reply With Quote
  #16  
Old 09-06-2010, 01:17 AM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, of course. Just a simple if... then.
Reply With Quote
  #17  
Old 09-06-2010, 05:50 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice update. thanks.
Reply With Quote
  #18  
Old 09-06-2010, 08:43 AM
moonclamp's Avatar
moonclamp moonclamp is offline
 
Join Date: May 2004
Location: London
Posts: 516
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dartho View Post
try giving him a link to follow to the style, ie. http://mydomain.com/forum.php?styleid=nn where nn is the style you want to display to him on his phone
Quote:
Originally Posted by moonclamp View Post
Cheers, I'll report back
Still got the same problem, and it's also being reported on the LG Secret too.

Considering it worked on the older version, I'm thinking the only way to make the style fully switchable (without problems) is with a custom profile option and a conditional to turn off the useragent detection ... I did try the following:

if ($vbulletin->options['mob_detect_enabled'] == 1 AND $bbuserinfo['fieldxx'] == "On")

but that just killed the plugin completely.
Reply With Quote
  #19  
Old 09-06-2010, 09:21 AM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You would be after:
Code:
if (($vbulletin->options['mob_detect_enabled'] == 1) AND ($bbuserinfo['fieldxx'] == "On"))
{

...

}
The confusing thing with this issue you are having is that it detects and assigns the style initially, but then presents with default subsequently - I'm not sure how it could do that based on what you are reporting.
Reply With Quote
  #20  
Old 09-06-2010, 09:41 AM
moonclamp's Avatar
moonclamp moonclamp is offline
 
Join Date: May 2004
Location: London
Posts: 516
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm a bit stumped too, I haven't got any access to different brands of phone to see if it's user error or not.

I'll try your conditional and see if that works, in the meantime I've gone back to the 3.8 plugin.
Reply With Quote
  #21  
Old 09-06-2010, 10:07 AM
moonclamp's Avatar
moonclamp moonclamp is offline
 
Join Date: May 2004
Location: London
Posts: 516
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, that conditional is just getting ignored :S
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 10:31 AM.


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.04475 seconds
  • Memory Usage 2,341KB
  • Queries Executed 26 (?)
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
  • (1)bbcode_code
  • (4)bbcode_quote
  • (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
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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