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)

siriuxs 02-25-2011 11:41 AM

Hi, I have a problem (excuse me for bad english...)... I have installed this plugin and relative style... If I go on my forum.hdblog.it from my iphone i visualized the desktop template... :( If i login in the forum is visualized correctly the mobile version... why is visualized the desktop version if I not logged in?

Thanks

kether1 02-26-2011 02:42 PM

I would like this to work for iPod and iPhone, but I do not want the iPad to automacally go to the mobile site. If I put iPad in the box at the bottom of this modification, will that solve that issue? I don't own an iPad, but a user emailed and said that s/he really hates that my site assigns the mobile style to the iPad when it used to be the regular PC version with more features.

Thanks for this!
Kether

dartho 02-26-2011 10:59 PM

Quote:

Originally Posted by kether1 (Post 2167129)
If I put iPad in the box at the bottom of this modification, will that solve that issue?

I don't own any "i" devices to test, but I believe it should ...

kether1 02-28-2011 08:04 PM

Quote:

Originally Posted by dartho (Post 2167357)
I don't own any "i" devices to test, but I believe it should ...

Thank you!

WinnipegHeights 03-07-2011 02:21 AM

Any ETA on an update for this to work with 4.1+?

bigrover 03-07-2011 03:58 PM

I have also tried this on my vB 4.1.2 pre-release site and it doesn't auto-detect any longer on my Blackberry 6 OS. It works great on vB 4.0.8. I suspect part of the problem is the built-in browser detection in vB4.1.2 for the new Mobile style. I suspect it is over-riding this hack.

I tried the new Mobile style that is released with vB 4.1.2 but ran into problems. Apparently it does not play well with mods and hacks. In my case, it shows up on the mobile device or the desktop fine, but I cannot navigate to any forums because the links are not working. I can navigate to the options and other settings, but not within the forums themselves. It looks like I will have to abandon mobile style detection for my site if I choose to upgrade to vB 4.1.2 to resolve other security and database searching issues.

McCarron 03-29-2011 06:43 PM

Newly installed and having a slight problem with only Android devices, which was mentioned earlier in the forum, but never resolved. The device I use for testing runs Froyo.

Basically after the first page visit you get the mobile style but then all secondary pages get set to the default style. The only way to prevent that is to enable your new "Enable Over-riding of Styles" option. That's nice that it fixes the other issue but that option prevents users from switching to the Desktop version.

So it fixes a bug but removes a feature from the plugin to allow users to use the regular view.

Any thoughts or ideas?

dartho 03-29-2011 09:17 PM

This is working as it is meant to on my site from my phone.

Now that vBulletin has built in mobile device detection, you should probably use that over this if you wish to allow overriding of the mobile detection, they also have to support you if/when you run into issues.

McCarron 03-30-2011 07:56 PM

Quote:

Originally Posted by dartho (Post 2178867)
This is working as it is meant to on my site from my phone.

Now that vBulletin has built in mobile device detection, you should probably use that over this if you wish to allow overriding of the mobile detection, they also have to support you if/when you run into issues.

I'm sorry I thought this plugin was still supported? It says so right at the top of the page. You may want to change that if you are no longer providing support in lieu vBulletin's new feature. I would happily use vBulletin's implementation if I was on their latest version, but I am not and don't have plans to move at this time.

Well anyone else interested, this plugin has a glitch when certain Android devices visit. Here is how you can fix it to work for them:

You have to Disable the Enable Over-riding of Styles option. Mobile Users now will be forced into the mobile theme, but wont be able to switch to the regular site anymore. SO if you are also using dartho's Lightweight Style and Options theme/plugin system you need to disable the Add a link to the default style? option in Lightweight Style Options as the user will not be able to switch styles anymore.

It's a bad experience for all mobile users to be forced into the mobile theme, but it's the only way I could get this plugin to work for the various types of users navigating to our site.

Also here are some additional useragents I check for that allow Android and HP/Palm webOS phones to be detected properly. It also detects the iPhone Simulator so those of you with the iPhone SDK can test the iPhone layout easily on your Mac.

Quote:

WebOS,webOS,Simulator,Android
I also have excluded "iPad" from the exclusions list because the iPad doesn't need a mobile theme as it's screen is plenty large, but it automatically gets lumped into the iPhone devices by default.

dartho 03-30-2011 11:53 PM

I didnt say I wasn't supporting it, I just made a suggestion. My next (based on you not using version 4.1.2) would be to download version 4.1.2 and take their detection code out and put it in a plugin to test if it is effective on your device.

I've done this for you.
Edit the Detect Mobile Device and Assign Style plugin
Comment out the existing code (by putting a /* at the very start, and a */ at the very end of it)
Paste in the following code at the start
PHP Code:

$vbulletin->input->clean_array_gpc('c', array(
    
COOKIE_PREFIX 'userstyleid'     => TYPE_UINT,
    
COOKIE_PREFIX 'skipmobilestyle' => TYPE_BOOL,
));

// Test mobile browser
$mobile_browser false;
$mobile_browser_advanced false;
if (
$vbulletin->options['mob_detect_enabled'])
{
    if (
stripos($_SERVER['HTTP_USER_AGENT'], 'windows') === false)
    {
        if (
            
preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|android)/i'strtolower($_SERVER['HTTP_USER_AGENT']))
            OR
            
stripos($_SERVER['HTTP_ACCEPT'],'application/vnd.wap.xhtml+xml') !== false
            
OR
            ((isset(
$_SERVER['HTTP_X_WAP_PROFILE']) OR isset($_SERVER['HTTP_PROFILE'])))
            OR
            
stripos($_SERVER['ALL_HTTP'],'OperaMini') !== false
        
)
        {
            
$mobile_browser true;
        }
        
// This array is big and may be bigger later on. So we move it to a second if.
        
elseif (in_array(
                    
strtolower(substr($_SERVER['HTTP_USER_AGENT'], 04)),
                    array(
                    
'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',
                    
'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
                    
'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-',
                    
'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-',
                    
'newt','noki','oper','palm','pana','pant','phil','play','port','prox',
                    
'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',
                    
'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',
                    
'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',
                    
'wapr','webc','winw','winw','xda ','xda-')
                )
            )
        {
            
$mobile_browser true;
        }
    }

    if (
        
$mobile_browser
        
AND
        
preg_match('/(ipad|ipod|iphone|blackberry|android|pre\/|palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine)/i'strtolower($_SERVER['HTTP_USER_AGENT']))
    )
    {
        
$mobile_browser_advanced true;
    }
}
$vbulletin->input->clean_array_gpc('r', array(
    
'styleid' => TYPE_INT,
    
'langid'  => TYPE_INT,
));


// Set up user's chosen style
if ($vbulletin->GPC['styleid'])
{
    
$styleid =& $vbulletin->GPC['styleid'];
    
vbsetcookie('userstyleid'$styleid);
    if (
$styleid == -1)
    {
        
vbsetcookie('skipmobilestyle'1);
        
$vbulletin->GPC[COOKIE_PREFIX 'skipmobilestyle'] = 1;
    }
    elseif (
$styleid == $vbulletin->options['ipod_skin_enabled'] OR $styleid == $vbulletin->options['mobile_skin_enabled'])
    {
        
vbsetcookie('skipmobilestyle'0);
        
$vbulletin->GPC[COOKIE_PREFIX 'skipmobilestyle'] = 0;
    }
}
elseif (
$mobile_browser_advanced && $vbulletin->options['ipod_skin_enabled'] && !$vbulletin->GPC[COOKIE_PREFIX 'skipmobilestyle'])
{
    
$styleid $vbulletin->options['ipod_skin'];
}
elseif (
$mobile_browser && $vbulletin->options['mobile_skin_enabled'] && !$vbulletin->GPC[COOKIE_PREFIX 'skipmobilestyle'])
{
    
$styleid $vbulletin->options['mobile_skin'];
}
elseif (
$vbulletin->GPC[COOKIE_PREFIX 'userstyleid'])
{
    
$styleid $vbulletin->GPC[COOKIE_PREFIX 'userstyleid'];
}
else
{
    
$styleid 0;


Save

Whilst this is vBulletin's code (although it is near identical to code readily available 'out there' for mobile detection), I modified it ever so slightly to use the options from my add-on for Mobile Style and iPod Style - so enable detection of these and configure which style to disaply accordingly. When using this code, other options (such as override (which is on by default with teh above code), custom agents, etc ) are ignored.

Test and let us know how it goes. Don't try this if you're on vb4.1.2 or higher, it's already there. This is just put here as a test and is incomplete.

ViewMy.biz 05-09-2011 08:23 PM

I am migrating soon to a new server and havent redirected my url yet. The force mobie that comes with 4.1.3 does not work for my win 5.5 mobile phone and I can't test other phones until I go live with my new server.

Once I pick the lightweight style Dartho's light style works great unless I have a forum with a forced style.

Can this add on work with 4.1.3, or is forced already working for everyone but me?

here is my beta http://69.64.89.197

S_E_A 05-13-2011 06:12 PM

Hello dartho,

I may have come across a problem:

new posts -> last page -> redirects to forum index rather than last page of thread?

Danny M 07-10-2011 07:59 PM

Does this also work on iPods?

alhindasi 07-26-2011 09:38 PM

this mod use mobile skin in google chrome can you fix it please

wullieclsfb 08-24-2011 01:06 PM

not detecting mobile style in vbulletin 4.1.5 pl1

dartho 08-24-2011 09:37 PM

vbulletin 4.1.2 and above has it's own mobile detection, use that instead.

rapung 11-08-2011 02:24 AM

I dunno what to do with this. It didn't work when I tried to open my forum by a cell phone. Is there anything I missed ?

Amadeusmq 11-24-2011 09:22 PM

Does this addon require that the setting "Allow Users To Change Styles" be set to YES in the admin control panel?

I prefer to maintain a single style for the site (so I don't let the style be changed); however, I would love to be able to offer mobile (small screens) a different style.

dartho 11-24-2011 09:26 PM

No - no need to allow users to change styles, but the style must be user selectable (ie. have a tick in teh checkbox next to it in admincp, Style Manager)

Amadeusmq 11-24-2011 09:30 PM

Quote:

Originally Posted by dartho (Post 2271596)
No - no need to allow users to change styles, but the style must be user selectable (ie. have a tick in teh checkbox next to it in admincp, Style Manager)

Hmmm...then I must be doing something wrong.

Here is the agent string for my Samsung Charge:

Code:

xxxxx.myvzw.com - - [24/Nov/2011:14:18:14 -0800] "GET /forums/cpstyles/darkvision/statusicon/forum_old-48.png HTTP/1.1" 200 3940 "http://www.isxgames.com/forums/" "Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; SCH-I510 Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
I tried putting "Mobile Safari" in the "Custom/User Defined Useragent String" SETTING (by itself). That didn't seem to do anything. Do I need to put the entire string?

dartho 11-25-2011 02:58 AM

You need to be aware that since vb 4.12 (I think) vBulletin have had their own mobile detection script built in - you should check this in your settings to make sure there are no conflicts. It may even suit your purposes in which case you can disable this one (worth doing as part of your testing anyway)

And All android devices should be detected without need for custom useragent strings

|Jordan| 01-23-2012 07:08 AM

Firefox 10 is being detected as a Mobile device.

dartho 01-23-2012 07:57 AM

Have you enabled custom useragent detection with the term "firefox" in thje custom useragents? If so, disable it, or remove "firefox".

ALso double check vBulletins detection settings

Skyrider 02-07-2012 10:04 AM

Installed, didn't detect my Dolphin Browser HD browser on my HTC Desire HD mobile. Still used the default forum style.

dartho 02-08-2012 12:08 AM

vbuletin has it's own detection system in place - this is no longer required. That being said, I use Dolphn - I will check

res6cue 02-08-2012 03:52 AM

Quote:

Originally Posted by dartho (Post 2297356)
vbuletin has it's own detection system in place - this is no longer required. That being said, I use Dolphn - I will check

I just jumped from 4.1.0 to 4.1.10 and noticed there is now native vB detection. However your mod has a lot more options. So I guess the question is, does this mod still work and will options I set override the native vB detection or no?

dartho 02-08-2012 05:14 AM

There is a bug with the vbiulletin detection which is to be fixed in 4.1.11 - I'm not sure how this affects this detection script. What I suggest you try is:
Configure the vB detection to 'none' in AdminCP
Apply this fix for 4.1.10 as detailed here: https://vborg.vbsupport.ru/showthrea...99#post2289299

then try again and see how it goes. I just check UA generated by Dilphin - and it uses the word "Android" so should be detected a a mobile device.

Filgga 05-23-2012 05:17 AM

dartho, this plugin is VERY IMPORTANT than the inbuilt vBulletin's detection script.

Can you consider making it compatible with vB Version: 4.2.x?

Thanks

edytwinky 06-04-2012 12:58 AM

Anybody able to get this to work with vb 4.2?

The Rocketeer 06-25-2012 01:18 AM

i would also like to see this work with vb 4.2

dartho 08-21-2012 02:41 AM

What exactly doesn't work?

Filgga 08-21-2012 07:48 AM

Quote:

Originally Posted by dartho (Post 2358625)
What exactly doesn't work?

The easiest way to get devices detected is to clear system cache:

Code:

http://www.yourdomain.com/admincp/misc.php?do=clear_cache
If you have vB Optimise Installed, do flush the cache:

Code:

http://www.jamiiforums.com/admincp/vboptimise.php?do=flush

Mark_Zuckerberg 09-30-2012 06:53 PM

It also changes my forum skin on PC tooo :(

Robbed 10-03-2012 12:41 AM

Quote:

Originally Posted by dartho (Post 2358625)
What exactly doesn't work?

It's redirecting to normal skin for some phones and on pc.

When I used to go to mobile site from a pc it would assign the mobile skin and now it doesn't same with some phones and new post for some reason.

freeones_raymon 10-03-2012 12:36 PM

Hi,

Thanks for this great modification! It's sad that vBulletin doesn't have a good build-in functionality for this, but hey... it's vBulletin!

I only found 3 mobile phones/browsers not being detected as mobile, and these are the user agent strings:
  • Opera/9.80 (Android 2.3.3; Linux; Opera Mobi/ADR-1207201819; U; sv) Presto/2.10.254 Version/12.00
  • Opera/9.80 (Android 4.0.3; Linux; Opera Mobi/ADR-1207201819; U; en) Presto/2.10.254 Version/12.00
  • Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17 Skyfire/2.0

I think the first 2 can be defined as "Opera Mobi", and someone told me it was better to add "Opera Mini" to the mobile list as well.

Only the last one was the Skyfire browser on a HTC mobile phone, but I cannot find anything in the user agent string that identifies it as a mobile phone. It even looks like the browser has user agent override enabled or something, but I couldn't find anything in the settings.

So if "Opera Mobi" and "Opera Mini" can be added to the mobile detection list for the next version, thanks!

Regards,
Raymond

sinomama 01-16-2013 09:27 PM

My vbulletin is 3.8.5.

To avoid being forced to use the lightweigh style for some users, I uninstalled the previous version and installed this version, and with pleasure I chose yes to Enable Over-riding of Styles..........but neither iPad, nor iPhone can detect the lightweigh style which is assigned to all mobiles in the setting of this plugin.

But if I open by the adress http://mydomain.com/forum.php?styleid=nn, the lightweigh style works in safari of iPad or iPhone, and I can return to the original style by cliquing "default style".
It's great!

Finally, Assignment doesn't work for 3.8.5? :(

behcet 07-31-2013 06:59 PM

upgrade pls

Mark93x 09-07-2013 10:17 PM

Dartho please update this to 4.2.x

sadiq6210 01-17-2014 07:38 AM

Already there is an option in vBulletin admincp to choose the default mobile style, what this mod will add?

Thanks

madness85 02-26-2014 11:42 AM

Using 4.2 can seem to change back to PC mode


All times are GMT. The time now is 07:35 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.01714 seconds
  • Memory Usage 1,886KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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