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)
-   -   Add-On Releases - VB4 - Mobile Phone / iPhone / PDA Detection and Style Assignment (https://vborg.vbsupport.ru/showthread.php?t=249967)

dartho 09-04-2010 10:00 PM

VB4 - Mobile Phone / iPhone / PDA Detection and Style Assignment
 
1 Attachment(s)
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]

dartho 09-05-2010 12:02 PM

F.a.q.

sulasno 09-05-2010 01:13 PM

tagged and thanks

sbsforum.us 09-05-2010 02:19 PM

This is great, I have been waiting for this. Thank you!

reefland 09-05-2010 07:38 PM

Tagged. Currently using the previous version with no problems.

moonclamp 09-05-2010 08:01 PM

This version is great 'cos users can switch back to the normal style - so thank you for that :)

However, I have one user who says his Samsung phone is now going to the default style after the welcome page ... but it worked on the previous version - he's deleted his cache/cookies too (so he says).

dartho 09-05-2010 09:39 PM

so when he first visits, he gets a specified style, but when he clicks a link het gets the default style?

moonclamp 09-05-2010 09:44 PM

Yeah pretty much.

It's a Samsung phone, so the useragent is there, he reckons he cleared his cookies and rebooted his phone too ... I wish I knew more about his phone.

Most other users are reporting no problems, except one (A nokia user) who is now stuck on the default style (I'm a Nokia user and I have no problems).

dartho 09-05-2010 09:54 PM

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

moonclamp 09-05-2010 10:04 PM

Quote:

Originally Posted by dartho (Post 2094307)
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

Cheers, I'll report back :)

djbaxter 09-05-2010 10:52 PM

Question: How many additional database queries are required by this add-on?

dartho 09-05-2010 11:29 PM

zero

djbaxter 09-05-2010 11:37 PM

Quote:

Originally Posted by dartho (Post 2094341)
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. :)

CvP 09-06-2010 01:00 AM

Quote:

Originally Posted by djbaxter (Post 2094344)
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

djbaxter 09-06-2010 01:17 AM

Oh, of course. Just a simple if... then. :o

Hornstar 09-06-2010 05:50 AM

Nice update. thanks.

moonclamp 09-06-2010 08:43 AM

Quote:

Originally Posted by dartho (Post 2094307)
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 (Post 2094312)
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.

dartho 09-06-2010 09:21 AM

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.

moonclamp 09-06-2010 09:41 AM

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. :)

moonclamp 09-06-2010 10:07 AM

Hmm, that conditional is just getting ignored :S

manofphat 09-06-2010 04:34 PM

If we can get that conditional to work, count me in!

wierdo124 09-06-2010 06:19 PM

Doesn't work with android browser...

moonclamp 09-06-2010 06:57 PM

Quote:

Originally Posted by wierdo124 (Post 2094694)
Doesn't work with android browser...

I know someone using Android with no problems.

wierdo124 09-06-2010 07:34 PM

How? I installed and enabled and my Droid is pointed to the full version.

wierdo124 09-06-2010 07:44 PM

I even entered Mozilla/5.0 (Linux; U; Android 2.2; en-us; Droid Build/FRG22D) AppleWebKit/533.1 (KHTML, like Gecko) in the box.

dartho 09-06-2010 08:54 PM

just enter "Android" in the custom section, and make the style is user selectable

wierdo124 09-06-2010 09:10 PM

Works. Must be case sensitive...i coulda swore i tried that before and it failed.

Maybe give android a full thing like WinMob and iOS? There's more Android devices than iphones now bro.

djbaxter 09-06-2010 09:12 PM

Any others that should be entered into the Custom section?

For example, will this work on Blackberry phones as is?

dartho 09-06-2010 09:32 PM

Quote:

Originally Posted by wierdo124 (Post 2094765)
Works. Must be case sensitive...i coulda swore i tried that before and it failed.

Maybe give android a full thing like WinMob and iOS? There's more Android devices than iphones now bro.

Yeah - that's probably a worthwhile idea

Quote:

Originally Posted by djbaxter (Post 2094766)
Any others that should be entered into the Custom section?

For example, will this work on Blackberry phones as is?

Blackberry's should be detected.

wierdo124 09-07-2010 12:13 AM

I had to add Palm. The string was WebOS.

bfdzio 09-07-2010 02:08 PM

Quote:

Originally Posted by dartho (Post 2094488)
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.

This is exactly what is happening to me, with Android (Froyo). I received the mobile style at first only once, then since then it hasn't worked.

dartho 09-07-2010 09:57 PM

new version released which adds a "disable style override" option and *might* resolve the issue reported by a couple of detection on being triggered on first page visited

Robru 09-10-2010 04:37 PM

A user with an Appele iPad wants the default style, must I put 'iPad' in the Useragent Exceptions section?

dartho 09-10-2010 09:09 PM

Yes, that should work

swiftor 09-10-2010 09:59 PM

Hmm, doesn't seem to work with my iphone (only device I have to try it with).

I have it set to use the mobile style for mobile devices... but it still brings me to the default style. Any thoughts?

Thanks!

dartho 09-10-2010 10:36 PM

Do you have the mobile style set as user selectable. Double check your settings in AdminCP and take a screen shot to post here if still not working. Thanks

swiftor 09-11-2010 03:42 AM

1 Attachment(s)
I believe these are the relevant screens, and yep, the style is available to anyone, guest or otherwise.

dartho 09-11-2010 06:31 AM

That all looks correct. I've just connected to your site using my desktop browser with a spooffed USER Agent (pretending to be an iPhone) and got the lightweight style OK. The full style link does not work though, as you have specified not to enable over-ride.

Could you try 2 things. 1 - clear all your cookies, and then if that doesn;t work, log out of vbulletin and clear the cookies again then connect to your site again.

Also try turning off iPhone detection (having Mobiule Detection enabled implicitly catches iPhones also)

masons 09-11-2010 10:35 AM

Works great! woohoooooooo!

swiftor 09-11-2010 02:47 PM

strange, i used the user switch agent to manually add the user agent of my iphone 4, and it works in my browser then. but no matter what i do, I can't get it to work on my actual iphone4. cleared cache/cookies/history. restarted iphone for good measure. not logged in. still doesn't work, haha.

i'm going to ask some of my users to try it out, if its just me I don't mind.

Many thanks for your awesome products and excellent responsiveness. you rock.

here is the user agent just for reference:

Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7


All times are GMT. The time now is 01:43 AM.

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.01426 seconds
  • Memory Usage 1,820KB
  • 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
  • (2)bbcode_code_printable
  • (9)bbcode_quote_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
  • (40)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