Can anyone suggest a module that will determine Operation System of the visitor and then display content based on the result?

eg: If Window X is determined, then display category Windows Software. If Mac is determined, show Apple software first.

I know this can be done with a JavaScript function or PHP variable to get 'HTTP_USER_AGENT'.

Comments

WillHall’s picture

don't know of any module off the top of my head - but you can do this

http://data.agaric.com/node/2316

Then when you create your view - use an embed tag for the display that goes with each browser.

mcfilms’s picture

You may be able to do this with Mobile Tools and Browser Cap.

http://drupal.org/project/mobile_tools

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

rewted’s picture

Not quite what I'm looking for. A perfect example is on the SourceForge website, look under the search "By default, we'll show you software that runs on X"

WillHall’s picture

Again - I don't think you are going to be happy with any module that exists for this - instead you could do something like this.

<?php
    $OSList = array
    (
            // Match user agent string with operating systems
            'Windows 3.11' => 'Win16',
            'Windows 95' => '(Windows 95)|(Win95)|(Windows_95)',
            'Windows 98' => '(Windows 98)|(Win98)',
            'Windows 2000' => '(Windows NT 5.0)|(Windows 2000)',
            'Windows XP' => '(Windows NT 5.1)|(Windows XP)',
            'Windows Server 2003' => '(Windows NT 5.2)',
            'Windows Vista' => '(Windows NT 6.0)',
            'Windows 7' => '(Windows NT 7.0)',
            'Windows NT 4.0' => '(Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT)',
            'Windows ME' => 'Windows ME',
            'Open BSD' => 'OpenBSD',
            'Sun OS' => 'SunOS',
            'Linux' => '(Linux)|(X11)',
            'MacOS' => '(Mac_PowerPC)|(Macintosh)',
            'QNX' => 'QNX',
            'BeOS' => 'BeOS',
            'OS/2' => 'OS/2',
            'Search Bot'=>'(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves/Teoma)|(ia_archiver)'
    );

    // Loop through the array of user agents and matching operating systems
    foreach($OSList as $CurrOS=>$Match)
    {
            // Find a match
            if (eregi($Match, $_SERVER['HTTP_USER_AGENT']))
            {
                    // We found the correct match
                    break;
            }
    }
    if($CurrOS == 'MacOS') {
        print views_embed_view('myview', 'maclist');
    }
?>

Know what I mean?

alpp’s picture

i know it's been too long, but i also need a solution with this task.

it's ok until "// We found the correct match" but what happens after that?

i mean after "if($CurrOS == 'MacOS')" what could be written to give it a straight url, rather than a views solution?

and where is this code used? in page.tpl?

sorry for being such a newbie... but i really would like this redirection to be functioning in my site's frontpage, for mac os, windows, linux, freebsd and mobile operating systems.