<?php
#############################################################
# Project:      bCounter                                    #
# File:         ua_output.php                               #
# Decription:   functions to print the user agent data
#                                                           #
# Copyright (c) Alexander Bondar (http://bondar.de/)        #
#############################################################

function getOSstring( $strOS, $strOS_ver ) {
    $strReturn = "";
    switch( $strOS ) {
        case "windows":
            $strReturn = "Windows $strOS_ver";
            break;
        case "linux":
            $strReturn = "Linux $strOS_ver";
            break;
        case "macosx":
            $strReturn = "Mac OS X";
            break;
        case "javame":
            $strReturn = "Java Platform Micro Edition";
            break;
        case "sun":
            $strReturn = "SunOS";
            break;
        case "psp":
            $strReturn = "PlayStation Portable";
            break;
        case "google":
            $strReturn = "Google";
            break;
        case "msn":
            $strReturn = "MSN";
            break;
        case "askjeeves":
            $strReturn = "Ask Jeeves";
            break;
        case "sogou":
            $strReturn = "Sogou";
            break;
        case "yahoo":
            $strReturn = "Yahoo";
            break;
        case "yandex":
            $strReturn = "Yandex";
            break;
        case "libwww":
            $strReturn = "libWWW";
            break;
        case "java":
            $strReturn = "Java";
            break;
        case "webalta":
            $strReturn = "WebAlta";
            break;
        case "cazoodle":
            $strReturn = "Cazoodle";
            break;
        case "infometrics":
            $strReturn = "Infometrics";
            break;
        case "myweb":
            $strReturn = "myWebbot";
            break;
        case "gigablast":
            $strReturn = "Gigabot";
            break;
        case "www-mechanize":
            $strReturn = "WWW-Mechanize";
            break;
        case "seekport":
            $strReturn = "Seekport";
            break;
        case "scoutjet":
            $strReturn = "ScoutJet";
            break;
        case "adshadow":
            $strReturn = "AdShadow";
            break;
        case "walhello":
            $strReturn = "Walhello";
            break;
        case "dotbot":
            $strReturn = "DotBot";
            break;
        case "wmp":
            $strReturn = "Windows-Media-Player";
            break;
        case "toplistbot":
            $strReturn = "Toplist";
            break;
        case "cityreview":
            $strReturn = "Cityreview";
            break;
        case "webdatacentre":
            $strReturn = "WebDataCentre";
            break;
        case "squidwall":
            $strReturn = "Squidwall";
            break;
        case "toplist":
            $strReturn = "Toplist";
            break;
        case "picsearch":
            $strReturn = "Picsearch";
            break;
        case "suchende":
            $strReturn = "suchen.de";
            break;
        case "naver":
            $strReturn = "Naver";
            break;
        case "eurobot":
            $strReturn = "Eurobot";
            break;
        case "cyberpatrol":
            $strReturn = "CyberPatrol SiteCat Webbot";
            break;
        case "suchbaerde":
            $strReturn = "suchbaer.de";
            break;
        case "ichiro":
            $strReturn = "ichiro";
            break;
        case "eurip":
            $strReturn = "Eurip";
            break;
        case "bejibot":
            $strReturn = "BejiBot";
            break;
        case "voodooit":
            $strReturn = "voodoo-it";
            break;
        case "yanga":
            $strReturn = "Yanga WorldSearch";
            break;
        case "turnitin":
            $strReturn = "Turnitin";
            break;
        case "cuil":
            $strReturn = "Cuil";
            break;
        case "exabot":
            $strReturn = "Exabot";
            break;
        case "jyxo":
            $strReturn = "Jyxo";
            break;
        case "winhttp":
            $strReturn = "WinHTTP";
            break;
        case "alexa":
            $strReturn = "Alexa";
            break;
        case "touche":
            $strReturn = "Touche";
            break;
        case "askpeter":
            $strReturn = "Askpeter";
            break;
        case "runnk":
            $strReturn = "Runnk Online Reader";
            break;
        case "grub":
            $strReturn = "Grub";
            break;
        case "wwwster":
            $strReturn = "WWWster";
            break;
        case "searchme":
            $strReturn = "Searchme";
            break;
        case "findlinks":
            $strReturn = "FindLinks";
            break;
        case "daumoa":
            $strReturn = "Daumoa";
            break;
        case "setooz":
            $strReturn = "SetooZ";
            break;
        case "vbseo":
            $strReturn = "vBSEO";
            break;
        case "majestic12":
            $strReturn = "Majestic-12";
            break;
        case "worio":
            $strReturn = "Worio";
            break;
        case "panscient":
            $strReturn = "Panscient";
            break;
        case "favorg":
            $strReturn = "FavOrg";
            break;
        case "snap":
            $strReturn = "Snap.com";
            break;
        case "entireweb":
            $strReturn = "Entire Web";
            break;
        case "indy":
            $strReturn = "Internet Direct Library for Borland";
            break;
        case "multicrawler":
            $strReturn = "MultiCrawler";
            break;
        case "baidu":
            $strReturn = "Baidu";
            break;
        case "msurlcontrol":
            $strReturn = "Microsoft URL Control";
            break;
        case "whoisdede":
            $strReturn = "whoisde.de";
            break;
        case "thumbshots":
            $strReturn = "Thumbshots.de";
            break;
        case "seznam":
            $strReturn = "Seznam";
            break;
        case "apptus":
            $strReturn = "Apptus";
            break;
        case "rexyobot":
            $strReturn = "Rexyobot";
            break;
        case "anonymouse":
            $strReturn = "Anonymouse";
            break;
        case "qeavis":
            $strReturn = "QEAVis";
            break;
        case "plantynet":
            $strReturn = "PlantyNet";
            break;
        case "ms-webdav-miniredir":
            $strReturn = "Microsoft-WebDAV-MiniRedir";
            break;
        case "metadatalabs":
            $strReturn = "MetaDataLabs";
            break;
        case "kalooga":
            $strReturn = "Kalooga";
            break;
        case "betabot":
            $strReturn = "betaBot";
            break;
        case "ioi":
            $strReturn = "Internet Open Index";
            break;
# libs
        case "w3c":
            $strReturn = "W3C";
            break;
        case "blackspider":
            $strReturn = "Black Spider";
            break;
        case "forumseek":
            $strReturn = "Forumseek";
            break;
        case "jakarta":
            $strReturn = "Jakarta";
            break;
        case "openx":
            $strReturn = "OpenX";
            break;
        case "facebook":
            $strReturn = "Facebook";
            break;
# downloader
        case "wget":
            $strReturn = "Wget";
            break;
        case "fdm":
            $strReturn = "Free Download Manager";
            break;
# SPAM
        case "wep_search_00":
            $strReturn = "WEP Search 00";
            break;
        case "missigua_locator":
            $strReturn = "Missigua Locator";
            break;

# others
        case "none":
            $strReturn = "Keine Angabe";
            break;
        default:
            $strReturn = "Sonstige";
            break;
    }
    return $strReturn;
}

function getBrowserString( $strBrowser, $strBrowser_ver ) {
    $strReturn = "";
    switch( $strBrowser ) {
        case "ie":
            $strReturn = "Internet Explorer";
            break;
        case "opera":
            $strReturn = "Opera";
            break;
        case "operamini":
            $strReturn = "Opera Mini";
            break;
        case "firefox":
            $strReturn = "Firefox";
            break;
        case "mozilla":
            $strReturn = "Mozilla";
            break;
        case "netscape":
            $strReturn = "Netscape";
            break;
        case "aol":
            $strReturn = "AOL";
            break;
        case "seamonkey":
            $strReturn = "SeaMonkey";
            break;
        case "iceape":
            $strReturn = "Iceape";
            break;
        case "chrome":
            $strReturn = "Chrome";
            break;
        case "safari":
            $strReturn = "Safari";
            break;
        case "tonline":
            $strReturn = "T-Online";
            break;
        case "k-meleon":
            $strReturn = "K-Meleon";
            break;
        case "psp":
            $strReturn = "PlayStation Portable Browser";
            break;




        case "googlebot":
            $strReturn = "Googlebot";
            break;
        case "googlebotimage":
            $strReturn = "Googlebot-Image";
            break;
        case "sitemaps":
            $strReturn = "Sitemaps";
            break;
        case "pagefetcher":
            $strReturn = "PageFetcher";
            break;
        case "adsense":
            $strReturn = "AdSense-Bot";
            break;
        case "slurp":
            $strReturn = "Slurp";
            break;
        case "bot":
            $strReturn = "Bot";
            break;
        case "robot":
            $strReturn = "Robot";
            break;
        case "bot-media":
            $strReturn = "MediaBot";
            break;
        case "crawler":
            $strReturn = "Crawler";
            break;
        case "spider":
            $strReturn = "Spider";
            break;
        case "perl":
            $strReturn = "Perl";
            break;
        case "java":
            $strReturn = "Java";
            break;
        case "yeti":
            $strReturn = "Yeti";
            break;
        case "twiceler":
            $strReturn = "Twiceler";
            break;
        case "ia_archiver":
            $strReturn = "ia_archiver";
            break;
        case "charlotte":
            $strReturn = "Charlotte";
            break;
        case "oozbot":
            $strReturn = "Oozbot";
            break;
        case "appengine":
            $strReturn = "AppEngine";
            break;
        case "mj12bot":
            $strReturn = "MJ12bot";
            break;
        case "speedyspider":
            $strReturn = "Speedy Spider";
            break;
        case "mlbot":
            $strReturn = "MLBot";
            break;
# libs

        case "validator":
            $strReturn = "Validator";
            break;
        case "translate":
            $strReturn = "Translate";
            break;
        case "commons-httpclient":
            $strReturn = "Commons-HttpClient";
            break;
        case "facebookexternalhit":
            $strReturn = "External Hit";
            break;



        case "downloader":
            $strReturn = "Downloader";
            break;

#spam
        case "spambot":
            $strReturn = "Spambot";
            break;

        case "":
            $strReturn = "";
            break;

        case "etc":
        default:
            $strReturn = "Sonstige";
            break;
    }
    return $strReturn." ".$strBrowser_ver;
}

function getOSstring_img( $strOS, $strOS_ver ) {
/*
For "type"="human" only!
*/
    $strReturn = "";
    switch( $strOS ) {
        case "windows":
            $strReturn = "windows";
            switch( $strOS_ver ) {
                case "7":
                    $strReturn .= "7";
                    break;
                case "Vista":
                    $strReturn .= "vista";
                    break;
                case "XP":
                    $strReturn .= "xp";
                    break;
                case "3.1":
                    $strReturn .= "31";
                    break;
                default:
                    break;
            }
            break;
        case "linux":
            $strReturn = "linux";
            break;
        case "macosx":
            $strReturn = "macosx";
            break;
        case "javame":
        case "java":
            $strReturn = "java";
            break;
        case "sun":
            $strReturn = "sun";
            break;
        default:
            $strReturn = "unknown";
            break;
    }
    return $strReturn;
}
function getOSstring_img_robot( $strOS ) {
    $strReturn = "";
    switch( $strOS ) {
# bots
        case "cityreview":
        case "suchbaerde":
        case "askpeter":
        case "turnitin":
        case "webdatacentre":
        case "wwwster":
        case "ichiro":
        case "betabot":
        case "toplist":
        case "touche":
        case "bejibot":
        case "rexyobot":
        case "adshadow":
        case "eurip":
        case "ioi":
#libs
        case "blackspider":
        case "forumseek":
#spam
        case "missigua_locator":
            $strReturn = "unknown";
            break;
        default:
            $strReturn = $strOS;
    }
    return $strReturn;
}
function getBrowserString_img($strBrowser) {
    switch( $strBrowser ) {
        case "operamini":
            $strBrowser = "opera";
            break;
        case "rexyobot":
            $strBrowser = "unknown";
            break;
        case "jakarta":
            $strBrowser = "apache";
            break;
        default:
            $strBrowser = $strBrowser;
            break;
    }
return $strBrowser;
}
?>