" ;
}
// http://www.php.net/manual/en/function.get-browser.php#101125.
// Cleaned up a bit, but overall it's the same.
function maxbuttons_get_browser() {
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$browser_name = 'Unknown';
$platform = 'Unknown';
$version= "";
// First get the platform
if (preg_match('/linux/i', $user_agent)) {
$platform = 'Linux';
}
elseif (preg_match('/macintosh|mac os x/i', $user_agent)) {
$platform = 'Mac';
}
elseif (preg_match('/windows|win32/i', $user_agent)) {
$platform = 'Windows';
}
// Next get the name of the user agent yes seperately and for good reason
if (preg_match('/MSIE/i', $user_agent) && !preg_match('/Opera/i', $user_agent)) {
$browser_name = 'Internet Explorer';
$browser_name_short = "MSIE";
}
elseif (preg_match('/Firefox/i', $user_agent)) {
$browser_name = 'Mozilla Firefox';
$browser_name_short = "Firefox";
}
elseif (preg_match('/Chrome/i', $user_agent)) {
$browser_name = 'Google Chrome';
$browser_name_short = "Chrome";
}
elseif (preg_match('/Safari/i', $user_agent)) {
$browser_name = 'Apple Safari';
$browser_name_short = "Safari";
}
elseif (preg_match('/Opera/i', $user_agent)) {
$browser_name = 'Opera';
$browser_name_short = "Opera";
}
elseif (preg_match('/Netscape/i', $user_agent)) {
$browser_name = 'Netscape';
$browser_name_short = "Netscape";
}
// Finally get the correct version number
$known = array('Version', $browser_name_short, 'other');
$pattern = '#(?' . join('|', $known) . ')[/ ]+(?[0-9.|a-zA-Z.]*)#';
if (!preg_match_all($pattern, $user_agent, $matches)) {
// We have no matching number just continue
}
// See how many we have
$i = count($matches['browser']);
if ($i != 1) {
// We will have two since we are not using 'other' argument yet
// See if version is before or after the name
if (strripos($user_agent, "Version") < strripos($user_agent, $browser_name_short)){
$version= $matches['version'][0];
}
else {
$version= $matches['version'][1];
}
}
else {
$version= $matches['version'][0];
}
// Check if we have a number
if ($version == null || $version == "") { $version = "?"; }
return array(
'user_agent' => $user_agent,
'name' => $browser_name,
'version' => $version,
'platform' => $platform,
'pattern' => $pattern
);
}
function check_charset() {
global $maxbuttons_installed_version;
global $wpdb;
$check = "SHOW FULL COLUMNS FROM " . maxUtils::get_table_name();
$charset = $wpdb->query($check);
return $charset;
}
if(isset($_POST['alter_charset'])) {
$kludge = 'altering table to be utf-8';
global $maxbuttons_installed_version;
global $wpdb;
$table_name = maxUtils::get_table_name();
$kludge = $table_name;
// IMPORTANT: There MUST be two spaces between the PRIMARY KEY keywords
// and the column name, and the column name MUST be in parenthesis.
$sql = "ALTER TABLE " . $table_name . " CONVERT TO CHARACTER SET utf8";
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
$wpdb->query($wpdb->prepare($sql));
} else {
$kludge = 'Not yet enabled';
}
$charr = check_charset();
?>
getClass('admin');
$page_title = __("Support","maxbuttons");
$action = "" . __("Go to support","maxbuttons") . "";
$admin->get_header(array("title" => $page_title, "title_action" => $action) );
?>