PDA

View Full Version : Add-On Releases - Mobile Phone / iPhone / PDA Detection and Style Assignment


dartho
10-27-2009, 10:00 PM
This add-on will detect most mobile phones, iPhones, PDAs and other mobile browsing devices and automatically for the user to a specific vBulletin style.

Release Information
1.0.1 Initial release for 3.8 ported over from 3.7 version

THIS IS IDENTICAL CODE TO THE 3.7 RELEASE!

I only re-released as soooo many people ask the question "is this OK for 3.8" You do not need to upgrade if you already have installed! However - should there be any changes in the future, it will likely happen here.

What can it do?
Detects most mobile phones and force the user to a specific style (users will not be able to select other styles from a mobile device with this add-on installed). 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 - some links will appear at the bottom of this post
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 or 3.6 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.

Styles released on vBulletin which you can use:
Dartho's (https://vborg.vbsupport.ru/member.php?u=110638) Mobile, Cell, Phone, PDA, iPhone Style (https://vborg.vbsupport.ru/showthread.php?t=174375) for vBulletin 3.7 (<-- yep, that's mine)
ElForro's (https://vborg.vbsupport.ru/member.php?u=132539) iPhone / iPod Touch Optimized Style (https://vborg.vbsupport.ru/showthread.php?t=171947)
Zachery's (https://vborg.vbsupport.ru/member.php?u=18025) vB Lite Style (https://vborg.vbsupport.ru/showthread.php?t=92071)
vBMechanics Mobile Alabama Style (http://www.vbulletin.com/forum/showthread.php?p=1085230#post1085230)

Due to the stripped down nature of these mobile styles, you will find that most for 3.5 and 3.6 will work quite happily on 3.5, 3.6, 3.7 & 3.8 although additional features introduced in vBulletin in recent years such as Social Groups, Blogs and Photo Galleries will not show well on a small screen. All should display your actual forums well.

dartho
10-28-2009, 10:01 AM
If there are features to add in, let me know.

As mentioned above, this is currently IDENTICAL CODE TO THE 3.7 RELEASE! Don't expect anything new.

However, I will release another version soon with the option to be able to override this addon if a user manually changes style.

TheChaosFactor
10-28-2009, 10:04 AM
That's awesome... I've had a few complaints about this. Appreciate the links to the styles as well. :)

Installed, and nominated.

Kingdombuilder
10-30-2009, 07:43 AM
Do you think that this mod will detect Blackberry phones? I have a blackberry site that I would love to be able to put up a mobile version of the sight.

dartho
10-30-2009, 08:21 AM
There have been a couple people (out of over 1000) who have had issues with Blackberrys, but it should work fine and I'm happy to help if it doesn't.

MuddyPaws
11-01-2009, 07:17 PM
I am getting a security tolkin error when I try to post from the mobile device. Any ideas?

dartho
11-01-2009, 08:13 PM
That would be your Style causing the error ...

bart6767
11-01-2009, 08:20 PM
Thanks very much this works well .

boggseric
11-27-2009, 05:02 PM
Does this mod override the users adding styleid= to the url? One of the skins I'm using has a "Normal" button but the mobile device won't switch to the normal skin.

On my computer if I change to the mobile skin and click the normal button it does take me back to the normal skin.

Any thoughts?

HACKERS PAL
12-01-2009, 12:27 AM
thanks buddy

aspen1018
12-09-2009, 02:45 PM
will this work on vb4?

aspen1018
12-09-2009, 02:48 PM
just tested it works great on 4.0

thanks

dutchbb
12-10-2009, 11:10 AM
Problem/bug: iphone users can't change the style with automatic style assignment set to 'no' for them alone. How do I make the style chooser show for them?

dartho
12-10-2009, 08:18 PM
That's by design. It's meant to detect most devices, and then has the option of assigning alternative styles to a couple familys of phone (PDA/iPhone)

To get around this for iPhones, edit the Detect Mobile Device and Assign Style plugin and find

"Mazingo",
"iPhone",
"iPod",
"Mobile",

and replace with

"Mazingo",
"Mobile",

dutchbb
12-10-2009, 08:53 PM
Well the mod allows me to disable the automatic style assignment for iphone, so wouldn't it be logical then to allow the user to select the style he wants on the iphone? That's why I thought it is a bug :)

But thanks I'll try that.

PS: also, when changing the style on the PC to your mobile skin, there is no quick style chooser to change it back to normal...

hurricane_sh
12-11-2009, 11:25 AM
For option Enable user defined device detection?

If I set Yes, forum will use mobile style for any clients including PC.

If I set No, no mobile style at all.

How should I setup this option?

I leave it blank for "Custom/User Defined Useragent String", do I have to input something?

Thanks!

dartho
12-11-2009, 08:12 PM
unless you have any extra user agents to add, you should leave this blank and disabled. Enable the product, and enable mobile device detection - you can leave all other options disabled.

hurricane_sh
12-12-2009, 07:08 AM
Weird, my forum can't detect any mobile device, no matter how I setup the options. Tested your own forum, it does work well.

dartho
12-12-2009, 10:00 AM
A conflict with anotehr add-on could yield unexpexcted results. Try editing the Detect Mobile Device and Assign Style plugin and changing the execution order to 10. If that doesnt work, try changing to 1, if t hat doesnlt work..... we'll play it buy ear...

hurricane_sh
12-12-2009, 10:40 AM
Doesn't work, there are only two plugins (including this one) in the same hook, no difference to put it before or after the other plugin.

I will try to add some debug code.

Thanks!

hurricane_sh
12-12-2009, 04:56 PM
Fixed the problem, may be because I set the mobile style as 'not allow use selection'. Now I use your another mod to hide the mobile styple from the style chooser.

Thanks for your great work!

EWGF
12-28-2009, 01:35 AM
Thank you, this works great!

ma3ali.net
01-01-2010, 11:11 AM
Thank you.
It worked great on iPhone and Java based mobile phones..

However, it didn't work on HTC HD2 which is a windows based mobile. It has 2 browsers (IE and Opera). Both didn't work.

ma3ali.net
01-01-2010, 12:08 PM
Thank you.
It worked great on iPhone and Java based mobile phones..

However, it didn't work on HTC HD2 which is a windows based mobile. It has 2 browsers (IE and Opera). Both didn't work.

solved by adding HTC_Touch_HD_T8282 to the custom user agents.

egclive
01-22-2010, 07:29 PM
will this be available for vb 4x

doopz
01-27-2010, 11:03 AM
Hmm, when I login using my phone I go to the normal default style again.. any fix for this?

Kingdombuilder
02-02-2010, 05:41 AM
This works great on 4.0.1 for me... I do however need alittle help. It does not show the home screen well bet shows the forum awesome. Is there a way in the detection to get it to go straight to the forum with out fist going to the home page.

In the settings I set the home page as the forum so it works great as far as once the home link is hit. I just need theat little extra whatever to get me to the forum page when it first load up. Any help would be greatly appreciated. Once this is solved it can be set to 4.0.1 mod as well...

By the way this is a great mod...

dartho
02-02-2010, 07:23 AM
what is your current default page - vBulletin CMS, vBAdvanced, Custom?

Kingdombuilder
02-02-2010, 03:37 PM
what is your current default page - vBulletin CMS, vBAdvanced, Custom?

Well it was the CMS page, but i redirected it to the forum page from my site control panel. The only thing is that all visitors are bypassing the front CMS page. I just want the mobile surfers to by pass. If there is an adjust that I can make then i can lift the redirectand allow things to take their course. I'm truly grateful for your help bruh, thank you...

dartho
02-02-2010, 08:18 PM
Try this:

Edit the vbcms_page template in the mobile style and replace

{vb:raw toolbar}
<div class="vbcms_content">
{vb:raw layout}
</div>

with something like


<div class="vbcms_content">
Home page unavailable in mobile view, click <a href="forum.php">HERE</a> to view forums.
</div>

LCN2007
03-10-2010, 03:47 AM
Try this:

Edit the vbcms_page template in the mobile style and replace

{vb:raw toolbar}
<div class="vbcms_content">
{vb:raw layout}
</div>

with something like


<div class="vbcms_content">
Home page unavailable in mobile view, click <a href="forum.php">HERE</a> to view forums.
</div>

This fix didnt work for me, any ideas?

dartho
03-10-2010, 03:54 AM
That would depend on what you are trying to fix? This template edit removes the CMS content and replaces it with a link direct to forums.

dutchbb
03-10-2010, 06:34 AM
"users will not be able to select other styles from a mobile device with this add-on installed"

Do you have plans to add the ability to change this like on Google mobile style vs regular?

LCN2007
03-10-2010, 11:07 PM
That would depend on what you are trying to fix? This template edit removes the CMS content and replaces it with a link direct to forums.

I did the edit as described above nad it does not remove the cms or make a link for it.

dartho
03-11-2010, 12:11 AM
I made the edits as posted on a fresh install with no otehr addons and it worked as described.

I'll need more information in order to be able to help. A URL is always a good start, possibly admincp admin access to edit styles also

LCN2007
03-11-2010, 01:39 AM
dartho,

Thank you for your hard work.

I reviewed my install and realized that i edited the wrong style.

Works great.

Only thing i noticed is a big gap under the header before it actually list the forums.

dartho
03-11-2010, 04:13 AM
I would guess the gap is being created by another add-on you may have - do you have advertising or similar?

cTak
03-28-2010, 10:57 AM
So this works on 4.0.2? Along with the style you made for 4.0?

dartho
03-28-2010, 10:14 PM
yep

steve1966
04-02-2010, 09:46 AM
hi i have installd this and its not detecting my mobile

dartho
04-02-2010, 11:27 AM
what is your mobiles user agent string?

steve1966
04-02-2010, 01:35 PM
just tried again and its working sorry for the bother

Kingdombuilder
04-07-2010, 02:08 AM
I have use the code above and it works great for my site, thanks for the mobile redirect from the CMS page... This mod is the bomb!!

BeefyBeefo
04-24-2010, 11:19 PM
Installed...works great on my Droid, not detecting my BlackBerry Tour. :(

Disabled for now, I will look for some input a little later. Thanks! :)

BeefyBeefo
04-25-2010, 05:00 AM
Installed...works great on my Droid, not detecting my BlackBerry Tour. :(

Disabled for now, I will look for some input a little later. Thanks! :)

Nevermind, I was using a combination that wouldn't work. Thanks. :)

el-q6ri
04-26-2010, 08:35 PM
for me its not working with 385

Simon Lloyd
04-27-2010, 05:46 AM
for me its not working with 385Just using this mod will not make any difference unless you are setting a mobile style that people using a mobile device will see, i'm using 3.8.5 with no problems, heres my mobile view http://www.thecodecage.com/forumz/index.php?styleid=19 and my normal view http://www.thecodecage.com/forumz/index.php?styleid=9 people viewing my site via mobile cannot view the normal view as the style is set.

Check out Dartho's two other threads https://vborg.vbsupport.ru/showthread.php?t=229241 and https://vborg.vbsupport.ru/showthread.php?t=229238 with these other things in place you will have no problem :)

el-q6ri
04-27-2010, 08:46 AM
I already have them and was using the 3.7 and it was working ok then after the upgrade to 385 I couldent get it to work ?

I will try to reinstall the style

Simon Lloyd
04-27-2010, 01:54 PM
Dartho, i have a problem in as much as ANY opera browser is seen as mobile im using the desktop version of Opera 10.52, is there anyway to detect whether its desktop or PC?

dartho
04-27-2010, 09:46 PM
mm... Try adding "Windows NT" to the exclusions section?

You could of course add "opera" to this section, but then all the opera mobiles wouldn't get picked up.

Just don't add any strings with commas for slashes

Simon Lloyd
04-30-2010, 04:56 AM
mm... Try adding "Windows NT" to the exclusions section?

You could of course add "opera" to this section, but then all the opera mobiles wouldn't get picked up.

Just don't add any strings with commas for slashes
Thanks, that seems to have done the trick for now, i will post back any other bugs found.

Jhonnydc
04-30-2010, 09:52 AM
Hello... one question...

I have installed this mod.. but...
If i go on my forum with the iphone style it's ok... if I click on "NORMAL VERISION" I view the default style and:
the align's forum isn't perfect and the zoom on the iphone is disabilited...

If i view my forum with default style in the Iphone with this mod disabilited.. it's all ok...
Why???Solution???

dartho
04-30-2010, 10:07 AM
If this mod is installed, you sholdn't be able to view the default style from a mobile device? That aside, I have no idea! a URL may help?

GoTTi
05-02-2010, 05:29 AM
hey is this working with vb4?

dartho
05-02-2010, 06:40 AM
yep

H_CAGE
05-03-2010, 05:14 PM
Did it's work for Vb 4.0 ?
Regards

H_CAGE
05-03-2010, 05:15 PM
Sorry I didn't last post before me .. thanks.

Simon Lloyd
05-08-2010, 04:36 PM
Dartho, i seem to have a problem, i've been losing visibility in Google and no longer appeared on page one, when i checked it seems google were picking up the mobile style rather than the main style?

I've disabled this for now could you shed any light on it?

dartho
05-08-2010, 08:56 PM
I know google crawlers present themselves as desktop and mobile devices and would as such trigger this add-on. I wouldn;t think it would dilute your google presence as the same content is being presented.

I actually have "google" as one of my custom strings so that google always gets the mobile style - it saves me many, mnay gigabytes of bandwidth a month (although google does also hide itself sometimes too)

Simon Lloyd
05-09-2010, 08:10 AM
Thanks for replying, i'll take a look at the mobile style, maybe it's something i'm missing or haven't done.

Interesting take on setting google etc as a custom string (can you show me how to do that?) would it be possible to have all spiders from the vbulletin spiders.xml to get the mobile style? and would the spiders still pick up the same content?, as with your styles you only see the link and no text until you click through the link.

Probably not explaining myself well but hope you get what i mean.

dartho
05-09-2010, 09:40 AM
Adding google as a custom user agent string is done via the "Custom User Agent String" section in AdminCP - I just added "google" You could add as many spiders as you want assuming they have unique usert-agent strings, but you'd have to do this manually

Some might suggest that the mobile style is more SEO friendly as it has little markup and lots of content - but I have no real knowledge in this area, and did not design it for such.

As for showing text in links - I assume you mean alt or title tags. I don;t know how google treats these, but it wouldn't take much to add them in to this style if one was keen.

Simon Lloyd
05-09-2010, 10:36 AM
Adding google as a custom user agent string is done via the "Custom User Agent String" section in AdminCP - I just added "google" You could add as many spiders as you want assuming they have unique usert-agent strings, but you'd have to do this manually

Some might suggest that the mobile style is more SEO friendly as it has little markup and lots of content - but I have no real knowledge in this area, and did not design it for such.

As for showing text in links - I assume you mean alt or title tags. I don;t know how google treats these, but it wouldn't take much to add them in to this style if one was keen.Thanks for that, and i will look at how to get the mod to reference the spiders.xml for the future.

I found the issue though, it was the header_includes template all that was there was the link to the wireless.css it was missing the site keywords and description, i added those, turned it back on and all is well in the search engines :)

Thanks for your time dartho!

AURFSCAN
05-24-2010, 11:11 PM
seems to be working on 4.01 just nice....thx

madbatty1
06-02-2010, 04:45 AM
Someone may know why the iPad is not handeled like the iPhone via this plugin?

or I better say ... how to get rid of that problem^^

AURFSCAN
06-27-2010, 12:16 PM
Someone may know why the iPad is not handeled like the iPhone via this plugin?

or I better say ... how to get rid of that problem^^


try adding the iPad to the list of user agents in the plugin (plugin manager)
- Edit: Plugin Detect Mobile Device and Assign Style

-Scroll down about half way, you'll see what I mean.


if ($vbulletin->options['mob_detect_enabled'] == 1)
{
$mobile=0;
$pda=0;
$ipod=0;
$except_browser=0;
$custom1=0;

if ($vbulletin->options['brows_exceptions_enabled'] == 1)
{
$exceptbrowsers = explode(",",$vbulletin->options['brows_exceptions']);
if(preg_match('/('.implode('|', $exceptbrowsers).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
{
$except_browser=1;
}
}



if ($except_browser==0)
{
if ($vbulletin->options['custom1_skin_enabled'] == 1)
{
$custom1agents = explode(",",$vbulletin->options['custom1_skin_agent']);
if(preg_match('/('.implode('|', $custom1agents).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
{
$custom1=1;
}
}

if ($vbulletin->options['pda_skin_enabled'] == 1 && $custom1==0)
{
$pdabrowsers = array(
"Windows CE"
);
if(preg_match('/('.implode('|', $pdabrowsers).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
{
$pda=1;
}
else if (isset($_SERVER['HTTP_UA_OS']))
{
if (strstr($_SERVER['HTTP_UA_OS'],"POCKET PC") !== false)
{
$pda=1;
}
}
}

if ($vbulletin->options['ipod_skin_enabled'] == 1 && $custom1==0)
{
$ipodbrowsers = array(
"iPod",
"iPhone"
);
if(preg_match('/('.implode('|', $ipodbrowsers).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
{
$ipod=1;
}
}


if ($pda == 0 && $ipod ==0 && $custom1==0)
{
if ($vbulletin->options['mobile_skin_enabled'] == 1)
{
$mobilebrowsers = array(
"WebTV",
"AvantGo",
"Blazer",
"PalmOS",
"lynx",
"Go.Web",
"Elaine",
"ProxiNet",
"ChaiFarer",
"Digital Paths",
"UP.Browser",
"Mazingo",
"iPhone",
"iPod",
"iPad",
"Mobile",
"T68",
"Syncalot",
"Danger",
"Symbian",
"Symbian OS",
"SymbianOS",
"Maemo",
"Nokia",
"Xiino",
"AU-MIC",
"EPOC",
"Wireless",
"Handheld",
"Smartphone",
"SAMSUNG",
"J2ME",
"MIDP",
"MIDP-2.0",
"320x240",
"240x320",
"Blackberry8700",
"Blackberry",
"Opera Mini",
"NetFront",
"BlackBerry",
"Minimo",
"Android",
"Droid ",
"MSIEMobile",
"IEMobile",
"PSP"
);

if(preg_match('/('.implode('|', $mobilebrowsers).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
{
$mobile=1;
}
elseif (strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml'))
{
$mobile=1;
}
elseif (strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml'))
{
$mobile=1;
}
}
}
}



if ($mobile==1)
{
// echo "<!-- Mobile Device -->";
$styleid=$vbulletin->options['mobile_skin'];
}
else if ($pda==1)
{
// echo "<!-- PDA Device -->";
$styleid=$vbulletin->options['pda_skin'];
}
else if ($ipod==1)
{
// echo "<!-- IPOD Device -->";
$styleid=$vbulletin->options['ipod_skin'];
}
else if ($custom1==1)
{
// echo "<!-- CUSTOM1 Device -->";
$styleid=$vbulletin->options['custom1_skin'];
}
else if ($except_browser==1)
{
// echo "<!-- Excepted Device -->";
}

else
{
// echo "<!-- No Mobile Device-->";
}
}




:)

dartho
06-28-2010, 01:31 AM
That would detect as a mobile, but not as an iPhone type device. I would have thought people would want the iPad as an exception so it gets the full style? - but to be treated like iphones etc, you should change the following in the plugin.

from
$ipodbrowsers = array(
"iPod",
"iPhone"
);


to

$ipodbrowsers = array(
"iPod",
"iPad",
"iPhone"
);

Megatr0n
06-28-2010, 07:11 PM
That would detect as a mobile, but not as an iPhone type device. I would have thought people would want the iPad as an exception so it gets the full style? - but to be treated like iphones etc, you should change the following in the plugin.

from
$ipodbrowsers = array(
"iPod",
"iPhone"
);


to

$ipodbrowsers = array(
"iPod",
"iPad",
"iPhone"
);


dartho, what code changes are there between this and the 3.7 version even if it's small?

dartho
06-28-2010, 09:45 PM
just a version number if my memory serves me right?

AURFSCAN
06-30-2010, 06:56 AM
thx for clearing up the ipad thing dartho

AURFSCAN
07-01-2010, 12:58 AM
I have a question dartho. How do I make it that guests see the mobile skin. ATM if your not logged in and view the forum via mobile you see it as full view. Log in you get mobile view.

How to enable forcing of mobile skin to guests viewing via mobile?

thx

dartho
07-01-2010, 02:34 AM
When you say "Guests" - do you mean not you? I would guess that you have not made teh style user selectable and as such guests can not see it - and other users wouldn;t also, but you as admin can as admin can view non user selectable styles.

AURFSCAN
07-01-2010, 12:06 PM
stupid me .. so silly so simple, cheers mate thx again.

AndrewRich
07-05-2010, 10:32 PM
I would like to add a UserCP option that allows users to override mobile detection and always use the full desktop style. I'm having difficulty figuring out where to add code for this or how to determine the UserCP variable.

I have added a User Profile field, checkbox style, defined as 'field16'. How can I determine whether the user has this checkbox checked or not when the plugin loads?

Thanks.

blackberry
07-07-2010, 07:56 PM
woow gr8 installed and nominated.. works

cloferba
07-14-2010, 06:25 PM
does this work with vbulletin 4.0.3?

dartho
07-14-2010, 09:30 PM
yes

Sop
07-16-2010, 10:05 AM
Hi I install the mobile detection and style product but now on mobile phones it says database error.
The complete error is
Database error in vBulletin 3.8.5:

Invalid SQL:

SELECT *
FROM style
WHERE (styleid = AND userselect = 1)
OR styleid = 2
ORDER BY styleid ASC
LIMIT 1;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND userselect = 1)
OR styleid = 2
ORDER BY styleid ASC
LIMIT 1' at line 3
Error Number : 1064
what can I do?

dartho
07-16-2010, 10:26 AM
Neither this add-on nor the mobile style run any MySQL queries - not sure where that one comes from. Do you get DB errors when you disable this product and browse to the mobile style manually?

cclamel
07-29-2010, 11:22 AM
Hello,

thanks for the great Add-on, but i have a problem.

All images, except Smilies, were viewed as a link.
Is it possible to chaange this?

Thanks and best regards

dartho
07-29-2010, 12:13 PM
yes - delete all the "Replacement Variables" for this style

Kahuna900
07-29-2010, 04:08 PM
Has anyone been complaining that it's not working on their iPhone? It's working fine on all the Android phones, but for some reason I'm getting complaints from iPhone users. I don't know anyone with an iPhone, so I can not check it myself.

fabiocesar
08-02-2010, 11:45 PM
detection system does not work with vbulletin 4.0.5 + 3.5.1 VbSEO ..
just out to get him any useragent and displays the default style

Michlerish
08-14-2010, 12:35 AM
That would detect as a mobile, but not as an iPhone type device. I would have thought people would want the iPad as an exception so it gets the full style? - but to be treated like iphones etc, you should change the following in the plugin.

from
$ipodbrowsers = array(
"iPod",
"iPhone"
);


to

$ipodbrowsers = array(
"iPod",
"iPad",
"iPhone"
);


I have this installed as is, no changes. But my users with ipads are still being detected as mobile browsers. I checked the code and ipad is not listed there anywhere. Here is my code (unchanged from download):

if ($vbulletin->options['mob_detect_enabled'] == 1)
{
$mobile=0;
$pda=0;
$ipod=0;
$except_browser=0;
$custom1=0;

if ($vbulletin->options['brows_exceptions_enabled'] == 1)
{
$exceptbrowsers = explode(",",$vbulletin->options['brows_exceptions']);
if(preg_match('/('.implode('|', $exceptbrowsers).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
{
$except_browser=1;
}
}



if ($except_browser==0)
{
if ($vbulletin->options['custom1_skin_enabled'] == 1)
{
$custom1agents = explode(",",$vbulletin->options['custom1_skin_agent']);
if(preg_match('/('.implode('|', $custom1agents).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
{
$custom1=1;
}
}

if ($vbulletin->options['pda_skin_enabled'] == 1 && $custom1==0)
{
$pdabrowsers = array(
"Windows CE"
);
if(preg_match('/('.implode('|', $pdabrowsers).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
{
$pda=1;
}
else if (isset($_SERVER['HTTP_UA_OS']))
{
if (strstr($_SERVER['HTTP_UA_OS'],"POCKET PC") !== false)
{
$pda=1;
}
}
}

if ($vbulletin->options['ipod_skin_enabled'] == 1 && $custom1==0)
{
$ipodbrowsers = array(
"iPod",
"iPhone"
);
if(preg_match('/('.implode('|', $ipodbrowsers).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
{
$ipod=1;
}
}


if ($pda == 0 && $ipod ==0 && $custom1==0)
{
if ($vbulletin->options['mobile_skin_enabled'] == 1)
{
$mobilebrowsers = array(
"WebTV",
"AvantGo",
"Blazer",
"PalmOS",
"lynx",
"Go.Web",
"Elaine",
"ProxiNet",
"ChaiFarer",
"Digital Paths",
"UP.Browser",
"Mazingo",
"iPhone",
"iPod",
"Mobile",
"T68",
"Syncalot",
"Danger",
"Symbian",
"Symbian OS",
"SymbianOS",
"Maemo",
"Nokia",
"Xiino",
"AU-MIC",
"EPOC",
"Wireless",
"Handheld",
"Smartphone",
"SAMSUNG",
"J2ME",
"MIDP",
"MIDP-2.0",
"320x240",
"240x320",
"Blackberry8700",
"Opera Mini",
"NetFront",
"BlackBerry",
"PSP"
);

if(preg_match('/('.implode('|', $mobilebrowsers).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
{
$mobile=1;
}
elseif (strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml'))
{
$mobile=1;
}
elseif (strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml'))
{
$mobile=1;
}
}
}
}

if ($mobile==1)
{
// echo "<!-- Mobile Device -->";
$styleid=$vbulletin->options['mobile_skin'];
}
else if ($pda==1)
{
// echo "<!-- PDA Device -->";
$styleid=$vbulletin->options['pda_skin'];
}
else if ($ipod==1)
{
// echo "<!-- IPOD Device -->";
$styleid=$vbulletin->options['ipod_skin'];
}
else if ($custom1==1)
{
// echo "<!-- CUSTOM1 Device -->";
$styleid=$vbulletin->options['custom1_skin'];
}
else if ($except_browser==1)
{
// echo "<!-- Excepted Device -->";
}
else
{
// echo "<!-- No Mobile Device-->";
}
}

Any idea why ipads are being treated as mobile?

edit: if it matters, I'm on 4.0.6

dartho
08-14-2010, 02:52 AM
Probably has the term iphone or similar in the user agent string.

Try adding the term "iPad" to the exceptions section

wacnstac
08-17-2010, 12:49 PM
My users have started to complain that they can no longer click on the links to see the images in threads. I did verify that this problem exists but can't think of anything that would have broke it. Anyone have any ideas?

dartho
08-17-2010, 01:27 PM
You have an 'Image Resizer' hack installed on your site -this could be causing issues

wacnstac
08-17-2010, 01:34 PM
We do. Thanks for the tip. It's started about the same time we put that hack in.

mrteach
08-20-2010, 02:07 AM
Everything works but when I go to reply, it automatically selects the entire post and quotes it (iphone user). Is this a bug?

mrteach
08-20-2010, 02:07 AM
also when I post, I cannot see my post on the iphone but it does show on my computer

dartho
08-20-2010, 02:34 AM
That would have nothing to do with this add-on. This just selects a style based on device user-agent

Yogesh Sarkar
08-26-2010, 02:15 PM
Anyone knows useragent for Android based devices, which can be added to exceptions list?

moonclamp
09-02-2010, 01:26 PM
I would like to add a UserCP option that allows users to override mobile detection and always use the full desktop style. I'm having difficulty figuring out where to add code for this or how to determine the UserCP variable.

I have added a User Profile field, checkbox style, defined as 'field16'. How can I determine whether the user has this checkbox checked or not when the plugin loads?

I've had a similar idea about creating a custom profile field to "turn off mobile detection" ... but like you I can't quite work out where and how to add the conditional ... I'm thinking I should add it to the user agent list plugin?

Does anyone know how?

Kingdombuilder
09-02-2010, 08:54 PM
Anyone knows useragent for Android based devices, which can be added to exceptions list?

This is what i did to get it to work for me:

Enable user defined device detection?
Select - yes


Custom/User Defined Useragent String:
Linux; U; Android

Then save. It worked for me i hope it works for you as well:D

CvP
09-04-2010, 11:52 PM
dartho, some users like to browse full version even on mobile devices.
when this mod is enabled, even if they click the "full version" (mobile/lightweight), it doesn't work.

any solution?

Ansaar Media
09-05-2010, 02:11 AM
Howe can set that users surfing with there mobile to see avatar's of other members?

Great mod

dartho
09-05-2010, 02:32 AM
dartho, some users like to browse full version even on mobile devices.
when this mod is enabled, even if they click the "full version" (mobile/lightweight), it doesn't work.

any solution?

check this one and see how you go: https://vborg.vbsupport.ru/showpost.php?p=1779571&postcount=222

moonclamp
09-05-2010, 09:15 AM
check this one and see how you go: https://vborg.vbsupport.ru/showpost.php?p=1779571&postcount=222
Will that still work if you have an 'override' style configured for certain forums?

dartho
09-05-2010, 10:41 AM
I dunno - I guess it depends at which point vBulletin overrides the style?

CvP
09-05-2010, 12:16 PM
thanks!!

please add it to main post. I'm sure a lot of users will want this.

dartho
09-05-2010, 12:34 PM
I just release a new version of this for VB4 here: https://vborg.vbsupport.ru/showthread.php?t=249967

CvP
09-05-2010, 01:30 PM
I just release a new version of this for VB4 here: https://vborg.vbsupport.ru/showthread.php?t=249967

cool. so I should uninstall this one:
check this one and see how you go: https://vborg.vbsupport.ru/showpost.php?p=1779571&postcount=222
and install the new vb4 one?

dartho
09-06-2010, 11:01 AM
Correct!

analog-x
09-18-2010, 07:24 PM
This is awesome man!!!!

SorentoUltimate
12-21-2010, 05:01 PM
Hi dartho,

thanks for the perfect addon.

I have a problem, i using HTC Touch HD, i enable user defined device detection, in User Defined Useragent String i put HTC_Touch_HD_T8282 Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)

After that i take the error Warning: preg_match() [function.preg-match]: Unknown modifier '4' in [path]/global.php(238) : eval()'d code on line 78.

Can u Help me on that?

dartho
12-21-2010, 09:30 PM
Just put in HTC_Touch_HD_T8282, although that looks llike it should be detected anyway

doubleclick
02-26-2011, 01:23 PM
This is great. Thanks, dartho

navjotjsingh
03-20-2011, 05:45 AM
Your plugin doesn't detect Opera Mobile properly. Adding "Opera Mobi" to custom list fixes it. :)

MissKalunji
05-13-2011, 04:09 PM
how would I add the playbook? :) I have a specific style for it

dartho
05-13-2011, 08:56 PM
Adding "PlayBook" to the custom user agents should do it

Max Taxable
06-16-2011, 04:07 PM
Installed on a 3.8

Sweet.

TacticalNuke
09-05-2011, 12:48 AM
dartho,

Thanks for the mod. I've downloaded and am using the lightweight style. I also downloaded and installed the options and mobile detection and style assignment.

I'm having some issues with the options and style assignment. The options installs alright but none of the changes actually implement. By that I mean I can access the options under vbulletin options, but nothing happens when I change the options. When I install detection, it doesn't even show up under vbulletin options.

I tried both disabling all my other plugins and disabling them before reinstalling but neither appears to work. Do you have any ideas?

dartho
09-05-2011, 03:41 AM
You're in the mobile device detection addon thread for vb3.8, there is a vb3.8 lightweoight style, but there is no "options" add-on for the "vb3.8 lightweight style", which is why they probably don't work :)

blind-eddie
10-06-2011, 12:21 PM
Try this:

Edit the vbcms_page template in the mobile style and replace

{vb:raw toolbar}
<div class="vbcms_content">
{vb:raw layout}
</div>

with something like


<div class="vbcms_content">
Home page unavailable in mobile view, click <a href="forum.php">HERE</a> to view forums.
</div>

What coding do I need to get this to work on 3.8.4 vbacmps?

pgowder
10-06-2011, 03:31 PM
Is there a way to allow people to go back to the full style?

blind-eddie
10-06-2011, 04:42 PM
Is there a way to allow people to go back to the full style?

Its an addon for this mod.
https://vborg.vbsupport.ru/showthread.php?t=229241&highlight=Mobile

dartho
10-06-2011, 11:59 PM
What coding do I need to get this to work on 3.8.4 vbacmps?


Edit the adv_portal template in the style and replace it's contents with the following or something similar:


$stylevar[htmldoctype]
<html>
<head>
$headinclude
<meta http-equiv="Refresh" content="2; URL=forum.php" />
</head>
<body>

$header

$navbar
<div align="center"><a href="forum.php">Portal Disabled in Mobile View - Click here if your browser does not automatically redirect you.</a></div>

$footer

</body>
</html>


Alternatively the adv_portal template can be edited to only show the centre column.

You can do this by removing the left and right column block conditionals in the template in your mobile style. Find and delete the following 2 blocks of code:


<if condition="$show['left_column']">
<td width="$vba_style[portal_leftcolwidth]"<if condition="$show['center_column'] OR $show['right_column']"> style="padding-$stylevar[right]: $vba_style[portal_colspacing]px"</if>>
$home[leftblocks]
</td>
</if>


<if condition="$show['right_column']">
<td valign="top" width="$vba_style[portal_rightcolwidth]"<if condition="$show['center_column'] OR $show['left_column']"> style="padding-$stylevar[left]: $vba_style[portal_colspacing]px"</if>>
$home[rightblocks]
</td>
</if>


I've tweaked my vbadvanced templates a bit more to make them viewable in this style

djjeffa
01-13-2012, 01:01 AM
is there any way to add Posted via Mobile Device to all the posts?

dartho
01-13-2012, 05:24 AM
This will modify the post text and append a message to it, this means that the user could then edit the post again and remove the text if they wished, but it works for the most part. Disabling the pplugins will not remove the text from posts already made.

Create 2 plugins and change the XXX to the styleid number of your mobile style:
1.
Product:vBulletin
Hook Location:newreply_post_start
Title: Posted via Mobile Device NewPost
Execution Order:5
Plugin PHP Code:

if ($styleid==XXX) {
$vbulletin->GPC['message'] = $vbulletin->GPC['message'] . "\n". "Posted via Mobile Device" . "\n";
}


2.
Product:vBulletin
Hook Location:newthread_post_start
Title: Posted via Mobile Device NewThread
Execution Order:5
Plugin PHP Code:

if ($styleid==XXX) {
$vbulletin->GPC['message'] = $vbulletin->GPC['message'] . "\n". "Posted via Mobile Device" . "\n";
}

Mythotical
01-20-2012, 02:03 AM
Just wanted to let you know I have tested this on vB 4.1.10 and it works perfect. Thanks.

Fluke667
02-27-2012, 09:04 PM
This will modify the post text and append a message to it, this means that the user could then edit the post again and remove the text if they wished, but it works for the most part. Disabling the pplugins will not remove the text from posts already made.

Create 2 plugins and change the XXX to the styleid number of your mobile style:
1.
Product:vBulletin
Hook Location:newreply_post_start
Title: Posted via Mobile Device NewPost
Execution Order:5
Plugin PHP Code:

if ($styleid==XXX) {
$vbulletin->GPC['message'] = $vbulletin->GPC['message'] . "\n". "Posted via Mobile Device" . "\n";
}


2.
Product:vBulletin
Hook Location:newthread_post_start
Title: Posted via Mobile Device NewThread
Execution Order:5
Plugin PHP Code:

if ($styleid==XXX) {
$vbulletin->GPC['message'] = $vbulletin->GPC['message'] . "\n". "Posted via Mobile Device" . "\n";
}





i want make 5 empty lines and than "Posted via Mobile Device", but howto?

This isnt working:


"\n";
"\n";
"\n";
"\n";
"\n";
"\n";
if ($styleid==XXX) {
$vbulletin->GPC['message'] = $vbulletin->GPC['message'] . "\n". "Posted via Mobile Device" . "\n";
}

Fluke667
02-27-2012, 09:33 PM
if ($styleid==XXX) {
$vbulletin->GPC['message'] = $vbulletin->GPC['message'] . "\n". "\n". "\n". "\n". "\n". "\n". "\n". "Posted via Mobile Device" . "\n";
}


This works :)

sportscolumn
03-25-2012, 05:51 AM
I'm having a little trouble with this plugin. It works fine when I view it in Firefox and Safari but when I set my user agent to Iphone via Safari, the "switch to full style" link doesn't work.

For example, i have the fullstyle id as 3.

But while this works http://forum.domain.com/index.php?styleid=3 works in firefox and safari, it doesn't work in iphone.

Any suggestions? Thanks

dartho
03-25-2012, 12:49 PM
From the description:
What can it do?
Detects most mobile phones and force the user to a specific style (users will not be able to select other styles from a mobile device with this add-on installed).

This one for V4 *migyt* work ... https://vborg.vbsupport.ru/showthread.php?p=2179248#post2179248

sportscolumn
03-25-2012, 02:38 PM
From the description:


This one for V4 *migyt* work ... https://vborg.vbsupport.ru/showthread.php?p=2179248#post2179248

noob question. I'm running 3.8.x, are you saying I should replace the code in your product-mobdetect product with the code you linked to?

Also, where do plugins and products live on the server?

thanks

dartho
03-25-2012, 09:48 PM
noob question. I'm running 3.8.x, are you saying I should replace the code in your product-mobdetect product with the code you linked to?

yep - give it a try

Also, where do plugins and products live on the server?

thanks

You managed to install this one? Same place - AdminCP, manage products and plug-ins

sportscolumn
03-26-2012, 02:26 AM
yep - give it a try


You managed to install this one? Same place - AdminCP, manage products and plug-ins

I meant where it lives on the server. I'm used to dealing with wordpress where the themes, plugins and css files are all in a certain folder on the server.

I suspect the styles are uploaded to the database in vbulletin?

dartho
03-26-2012, 03:25 AM
OK - plugins etc all live in the database also, except where you explicitly upload additional files to your server, in which case they often live in your forum root depending on where the developer wanted them (a plugins code can include external files as it's just a PHP eval)

Yep - styles are also in the database

sportscolumn
03-26-2012, 05:28 PM
OK - plugins etc all live in the database also, except where you explicitly upload additional files to your server, in which case they often live in your forum root depending on where the developer wanted them (a plugins code can include external files as it's just a PHP eval)

Yep - styles are also in the database

thanks for your help.

Deafmute
08-03-2012, 10:57 AM
works vb 3.8x?

Max Taxable
08-03-2012, 01:48 PM
works vb 3.8x?Yep... Works on mine just fine.

Afrika
10-06-2013, 10:11 PM
I don´t understand why it is not possible to allow smartphone users to change to the original style.
Someone not like the mobile style and with this mod he have no chance to change, why??

Simon Lloyd
10-07-2013, 05:00 AM
If you haven't kept the style chooser you can always add a link on the forumhome page of the mobile style like www.yourdomain.com/forum/index.php?styleid=3 (where 3 would be your styleid you want them to have choice to see).

Afrika
10-07-2013, 04:06 PM
Jap, but it didn´t go for this mod. The style cannot be changed by user with a mobile device

Simon Lloyd
10-07-2013, 04:30 PM
Just add a checkbox to the mobile style and a conditional in the plugin so that when a user checks the checkbox they get excluded from the mobile style and can see the standard style.

Afrika
10-07-2013, 09:58 PM
This works for 3.8
https://vborg.vbsupport.ru/showthread.php?t=249967

m7sen
04-02-2014, 11:47 PM
upgrade it to be like vb4 style !

mdawg
04-24-2014, 03:30 PM
Running 3.8.7 PL3 Tried out this mod with the Dartho's style for a couple of months.

Going to disable this MOD because of a couple quirks and one bug:

Quirks:
1. We use PMs heavily on my forum, and there is a need to maintain the thread of the PMs as the conversation is ongoing. In other words, to maintain what was typed before in the PM as the members M back and forth.
With this tripped down version, seems no way to maintain the thread of the conversation - as PMs are sent back and forth, only what is newly typed is transmitted.

2. In threads, images do not appear right there embedded in the post. Rather, a link
[image]
appears that the person may click on to view.

3. Google ads do not appear.

Bug:
1. When viewing a post, if a person clicks to PM or view the profile of the poster, instead of that poster's profile coming up, the username of one of the members who is very early in the list alphabetically comes up
Aaaaaaua
instead of the username of the poster.

Tobin Frost
06-08-2014, 02:51 PM
Do you have a photo of this plugin?

mario1973
12-28-2014, 01:50 PM
I need to install this plugin on an important forum.
On the test forum everything works properly . I have not found any problems for PCs and notebooks . Mobile device also detects correctly.

Can anyone noticed any undesirable changes in the operation of a forum?

ouarsenis
03-05-2015, 06:47 AM
please team

how to auto change the style to mobile style when resize the screen ?
bceause it orks for mobile but not when resize the screen

Vibhor
06-12-2015, 06:19 AM
Hi Dartho,

Thanks for creating this amazing plug-in.

It flawlessly redirects to our mobile version but whenever users try to select desktop style, it simply doesn’t work.

I believe this is because the plugin is forcing mobile users to use mobile theme only.

Is there anyway we can redirect users to mobile theme at first but at the same time allow them to switch themes as per their wish?

dartho
06-13-2015, 07:49 AM
I think you *may* be abl;e to use the version for VB4. Try this one: https://vborg.vbsupport.ru/showthread.php?t=249967

0x88
11-07-2015, 11:16 PM
Hi Dartho,

Thanks for creating this amazing plug-in.

It flawlessly redirects to our mobile version but whenever users try to select desktop style, it simply doesn?t work.

I believe this is because the plugin is forcing mobile users to use mobile theme only.

Is there anyway we can redirect users to mobile theme at first but at the same time allow them to switch themes as per their wish?

Waiting solution for this problem :)

JohnSilver
08-12-2017, 12:58 AM
Worked in 3.87

In terms of seo what should i do with archive instead? Should i turn it off and redirect 301 to full version?

Anyone?

JohnSilver
08-12-2017, 01:52 AM
Hi Dartho,

Thanks for creating this amazing plug-in.

It flawlessly redirects to our mobile version but whenever users try to select desktop style, it simply doesn?t work.

I believe this is because the plugin is forcing mobile users to use mobile theme only.

Is there anyway we can redirect users to mobile theme at first but at the same time allow them to switch themes as per their wish?

Yea Dartho. Me also looking for it too. Any chance to add this feature? :D

webnsn
03-10-2020, 12:32 PM
I have implemented
Demo www.Wikinewforum.com

Alihandro
03-15-2020, 01:26 PM
thank you.

dartho
06-23-2020, 11:30 AM
Yea Dartho. Me also looking for it too. Any chance to add this feature? :D

try the VB4 version - should work with 3.8 from memory

Yeah, I know - I'm 3 years late ...

www.ch-joy.com
01-25-2023, 09:07 AM
Thanks and we need an update