0) { $row = mysql_fetch_array($result); $match = explode('.', $row['version']); } else { $result = @mysql_query('SHOW VARIABLES LIKE \'version\''); if ($result != FALSE && @mysql_num_rows($result) > 0){ $row = mysql_fetch_row($result); $match = explode('.', $row[1]); } } } // end server id is defined case if (!isset($match) || !isset($match[0])) { $match[0] = 3; } if (!isset($match[1])) { $match[1] = 21; } if (!isset($match[2])) { $match[2] = 0; } define('MYSQL_INT_VERSION', (int)sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2]))); unset($match); } // Determines platform (OS), browser and version of the user // Based on a phpBuilder article: // see http://www.phpbuilder.net/columns/tim20000821.php3 if (!defined('USR_OS')) { if (!empty($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) { $HTTP_USER_AGENT = $HTTP_SERVER_VARS['HTTP_USER_AGENT']; } // 1. Platform if (strstr($HTTP_USER_AGENT, 'Win')) { define('USR_OS', 'Win'); } else if (strstr($HTTP_USER_AGENT, 'Mac')) { define('USR_OS', 'Mac'); } else if (strstr($HTTP_USER_AGENT, 'Linux')) { define('USR_OS', 'Linux'); } else if (strstr($HTTP_USER_AGENT, 'Unix')) { define('USR_OS', 'Unix'); } else { define('USR_OS', 'Other'); } // 2. browser and version if (ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) { define('USR_BROWSER_VER', $log_version[1]); define('USR_BROWSER_AGENT', 'IE'); } else if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) { define('USR_BROWSER_VER', $log_version[2]); define('USR_BROWSER_AGENT', 'OPERA'); } else if (ereg('Mozilla/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) { define('USR_BROWSER_VER', $log_version[1]); define('USR_BROWSER_AGENT', 'MOZILLA'); } else if (ereg('Konqueror/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) { define('USR_BROWSER_VER', $log_version[1]); define('USR_BROWSER_AGENT', 'KONQUEROR'); } else { define('USR_BROWSER_VER', 0); define('USR_BROWSER_AGENT', 'OTHER'); } } ?>