WordPress.org

Forums

PHP Browser Detection
[resolved] How do I set the same property for several browsers? (4 posts)

  1. cbarnett
    Member
    Posted 2 years ago #

    Hi, Firstly, Great plugin!
    Sorry, this answer is probably obvious but I'm not sure how to check for multiple browser types and apply the same PHP to them, then if they aren't those particular browsers, to do something else.

    Currently I am just searching for IE, but I also want it to check for Chrome. My code for IE checking is below in one of my page template php files:

    if ( is_IE($version) ) {
    moover(22);
    }
    else {
    moover (16);
    }

    So where would I put "is chrome" code into the lines?

    Thanks for your help in advance.

    http://wordpress.org/extend/plugins/php-browser-detection/

  2. cbarnett
    Member
    Posted 2 years ago #

    And just a note those are codes for slideshows - I want it to play one slide show for some browsers (without animated GIFs because IE and Chrome both have trouble playing them) and another slideshow for all other browsers (with animated GIFs).

    Thanks.

  3. Mindshare Studios, Inc.
    Member
    Plugin Author

    Posted 2 years ago #

    You could something like this:

    if(is_IE($version)) {
        moover(22);
    elseif(is_chrome($version)) {
        moover(18);
    } else {
        moover(16);
    }

    Make sense?

  4. cbarnett
    Member
    Posted 2 years ago #

    Yes - that worked perfectly! Thanks for your help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • PHP Browser Detection
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic