# Sniffuser Function: Populates $_SESSION with user info # $_SESSION['os'] = "Linux", "Windows", Defaults to windows # $_SESSION['browser'] = Firefox, Konqueror, MSIE, or Opera # $_SESSION['width'] = 800, 1024, 1280, 1600 # MAC/SAFFARI Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/522.11 (KHTML, like Gecko) Version/3.0.2 Safari/522.12 function sniffuser () { if (ereg("Linux", $_SERVER['HTTP_USER_AGENT'])) { $_SESSION['os'] = "Linux"; } elseif (ereg("Windows", $_SERVER['HTTP_USER_AGENT'])) { $_SESSION['os'] = "Windows"; } elseif (ereg("Macin". $_SERVER['HTTP_USER_AGENT'])) { $_SESSION['os'] = "Macintosh"; } else { $_SESSION['os'] = "Unknown"; } if (ereg("Firefox", $_SERVER['HTTP_USER_AGENT'])) { $_SESSION['browser'] = "Firefox"; } elseif (ereg("Konqueror", $_SERVER['HTTP_USER_AGENT'])) { $_SESSION['browser'] = "Konqueror"; } elseif (ereg("MSIE", $_SERVER['HTTP_USER_AGENT'])) { $_SESSION['browser'] = "MSIE"; } elseif (ereg("Opera", $_SERVER['HTTP_USER_AGENT'])) { $_SESSION['browser'] = "Opera"; } elseif (ereg("Safari", $_SERVER['HTTP_USER_AGENT'])) { $_SESSION['browser'] = "Safari"; } else { $_SESSION['browser'] = "Unknown"; } if ($_POST[aheight]) { $_SESSION['height'] = $_POST[aheight]; $_SESSION['width'] = $_POST[awidth]; #this is to fix a bug in opera for linux. It will return double resolution if dual head is running if (($_SESSION[browser] == "Opera") && ($_SESSION[os] == "Linux")) { #checks for dual 800x600 resolutions if (($_SESSION[height] == "600") && ($_SESSION[width] == "1600")) { $_SESSION[width] = "800"; #checks for dual 800x600 resolutions } elseif (($_SESSION[height] == "768") && ($_SESSION[width] == "1024")) { $_SESSION[width] = "1024"; #checks for dual 800x600 resolutions } elseif (($_SESSION[height] == "1024") && ($_SESSION[width] == "2560")) { $_SESSION[width] = "1280"; } elseif (($_SESSION[height] == "1200") && ($_SESSION[width] == "3200")) { $_SESSION[width] = "1600"; } } } #$special = sanitize_system_string($_SERVER[HTTP_USER_AGENT], '0', '255'); #$special = ; $datatemp = mysql_fetch_array(mysql_query("SELECT * FROM `devData` WHERE `ip` = '{$_SERVER[REMOTE_ADDR]}' AND `os` = '{$_SESSION[os]}' AND `browser` = '{$_SESSION[browser]}' AND `width` = '{$_SESSION[width]}' AND `height` = '{$_SESSION[height]}' AND `http_user_agent` = '{$_SERVER[HTTP_USER_AGENT]}' AND `ua_cpu` = '{$_SERVER[HTTP_UA_CPU]}' AND `accept_language` = '{$_SERVER[HTTP_ACCEPT_LANGUAGE]}'")); if ($datatemp[ip] == $_SERVER[REMOTE_ADDR]) { $datatemp[hits] = $datatemp[hits] + 1; mysql_query("UPDATE `devData` SET hits = '{$datatemp[hits]}', `request_time` = '{$_SERVER[REQUEST_TIME]}' WHERE `ip` = '{$_SERVER[REMOTE_ADDR]}' AND `os` = '{$_SESSION[os]}' AND `browser` = '{$_SESSION[browser]}' AND `width` = '{$_SESSION[width]}' AND `height` = '{$_SESSION[height]}' AND `http_user_agent` = '{$_SERVER[HTTP_USER_AGENT]}' AND `ua_cpu` = '{$_SERVER[HTTP_UA_CPU]}' AND `accept_language` = '{$_SERVER[HTTP_ACCEPT_LANGUAGE]}'"); } elseif (($_SERVER[REMOTE_ADDR] != "127.0.0.1") && ($_SESSION[width])) { mysql_query("INSERT INTO `devData` ( `ip` , `os` , `browser` , `width` , `height` , `http_user_agent` , `request_time` , `ua_cpu` , `accept_language` , `hits` ) VALUES ('{$_SERVER[REMOTE_ADDR]}', '{$_SESSION[os]}', '{$_SESSION[browser]}', '{$_SESSION[width]}', '{$_SESSION[height]}', '$_SERVER[HTTP_USER_AGENT]', '{$_SERVER[REQUEST_TIME]}', '{$_SERVER[HTTP_UA_CPU]}', '{$_SERVER[HTTP_ACCEPT_LANGUAGE]}', '1')"); } } function formatCSS ($mode) { $defaultsmall = "12px"; $defaultlarge = "15px"; $spaceMod1 = "8px"; $spaceMod2 = "8px"; $heightMod = "450px"; if (($_SESSION[os] == "Linux") || ($_SESSION[os] == "Macintosh")) { $usefont = "arial"; $spaceMod3 = "12px"; if ($_SESSION[browser] == "Konqueror") { $spaceMod1 = "5px"; $spaceMod3 = "10px"; } } elseif ($_SESSION[os] == "Windows") { $usefont = "tahoma"; $spaceMod3 = "13px"; } switch ($_SESSION[width]) { default: #800x600 and default $overall = ($_SESSION[width]-40)."px"; $top2 = ($_SESSION[width]-230)."px"; $top2half = (($_SESSION[width]-230) / 2)."px"; $footcenter = ($_SESSION[width]-58)."px"; $col1of2 = "495px"; $col2of2 = "242px"; $colby3 = "242px"; if ($_GET[pageMode1] == "req") { $heightMod = "720px"; $hinputwidthmod = "width: 228px;"; $inputwidthmod = "width: 130px;"; $checkboxmod = "width: 474px;"; $checkboxtd = "width: 16px;"; $checkboxtypetd = "width: 101px;"; $bigboxmod = "height: 242px; width: 457px;"; } else { $toursubwidth = "width: 232px;"; } break; case "1024": #1024x768 $overall = ($_SESSION[width]-40)."px"; $top2 = ($_SESSION[width]-230)."px"; $top2half = (($_SESSION[width]-230) / 2)."px"; $footcenter = ($_SESSION[width]-58)."px"; $col1of2 = "645px"; $col2of2 = "316px"; $colby3 = "316px"; if ($_GET[pageMode1] == "req") { $heightMod = "720px"; $hinputwidthmod = "width: 306px;"; $inputwidthmod = "width: 210px;"; $checkboxmod = "width: 674px;"; $checkboxtd = "width: 16px;"; $checkboxtypetd = "width: 129px;"; $bigboxmod = "height: 242px; width: 618px;"; } else { $toursubwidth = "width: 296px;"; } break; case "1280": #1280x1024 $overall = ($_SESSION[width]-40)."px"; $top2 = ($_SESSION[width]-230)."px"; $top2half = (($_SESSION[width]-230) / 2)."px"; $footcenter = ($_SESSION[width]-58)."px"; $col1of2 = "815px"; $col2of2 = "402px"; $colby3 = "402px"; $defaultsmall = "14px"; $defaultlarge = "17px"; if ($_SESSION['browser'] == "Konqueror") { $spaceMod1 = "1px"; $spaceMod2 = "4px"; $spaceMod3 = "2px"; } else { $spaceMod1 = "5px"; $spaceMod2 = "5px"; $spaceMod3 = "4px"; } if ($_GET[pageMode1] == "req") { $heightMod = "820px"; $hinputwidthmod = "width: 382px;"; $inputwidthmod = "width: 262px;"; $checkboxmod = "width: 842px;"; $checkboxtd = "width: 16px;"; $checkboxtypetd = "width: 161px;"; $bigboxmod = "height: 322px; width: 772px;"; } else { $toursubwidth = "width: 370px;"; $heightMod = "550px"; } break; case "1600": #1600x1200 if ($_GET[pageMode1] == "req") { $heightMod = "820px"; $hinputwidthmod = "width: 382px;"; $inputwidthmod = "width: 262px;"; $checkboxmod = "width: 842px;"; $checkboxtd = "width: 16px;"; $checkboxtypetd = "width: 161px;"; $bigboxmod = "height: 322px; width: 772px;"; } else { $toursubwidth = "width: 462px;"; $heightMod = "687px"; } $overall = ($_SESSION[width]-40)."px"; $top2 = ($_SESSION[width]-230)."px"; $top2half = (($_SESSION[width]-230) / 2)."px"; $footcenter = ($_SESSION[width]-58)."px"; $col1of2 = "644px"; $col2of2 = "317px"; break; } $retthis = <<< EONA