vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Add-On Releases - Mobile Phone / iPhone / PDA Detection and Style Assignment (https://vborg.vbsupport.ru/showthread.php?t=226946)

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

Quote:

Originally Posted by BeefyBeefo (Post 2026770)
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

Quote:

Originally Posted by el-q6ri (Post 2027795)
for me its not working with 385

Just 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

Quote:

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

Quote:

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

Quote:

Originally Posted by madbatty1 (Post 2046893)
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.

Code:

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
Code:

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

to

Code:

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


Megatr0n 06-28-2010 07:11 PM

Quote:

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

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

to

Code:

      $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


All times are GMT. The time now is 03:35 PM.

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.02930 seconds
  • Memory Usage 1,844KB
  • 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
  • (5)bbcode_code_printable
  • (6)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