| 451 | | $text = 'Name: '.$_POST['name']."\r\n"; |
| 452 | | $text .= 'Email: '.$_POST['email']."\r\n"; |
| 453 | | $text .= 'Host: '.$_SERVER['HTTP_HOST']."\r\n"; |
| 454 | | $text .= 'Blog: '.get_option('home')."\r\n"; |
| 455 | | $text .= 'Subject: '.$_POST['subject']."\r\n"; |
| 456 | | $text .= 'Message: '.$_POST['message']."\r\n"; |
| 457 | | |
| | 451 | $text = 'Name: '.$_POST['name'].'<br>'; |
| | 452 | $text .= 'Email: '.$_POST['email'].'<br>'; |
| | 453 | $text .= 'Host: '.$_SERVER['HTTP_HOST'].'<br>'; |
| | 454 | $text .= 'Blog: '.get_option('home').'<br>'; |
| | 455 | $text .= 'Subject: '.$_POST['subject'].'<br>'; |
| | 456 | $text .= 'Message: '.$_POST['message'].'<br>'; |
| | 457 | |
| | 458 | |
| 1026 | | |
| | 1027 | |
| | 1028 | function GetMLLocale($in){ |
| | 1029 | |
| | 1030 | |
| | 1031 | switch($in){ |
| | 1032 | case 'self'; |
| | 1033 | $type = 'wpmultilingial'; |
| | 1034 | break; |
| | 1035 | case 'parent'; |
| | 1036 | $type = 'wplocalization'; |
| | 1037 | break; |
| | 1038 | default: |
| | 1039 | return false; |
| | 1040 | break; |
| | 1041 | } |
| | 1042 | |
| | 1043 | |
| | 1044 | if (isset($GLOBALS['current_user']->$type)){ |
| | 1045 | return $GLOBALS['current_user']->$type; |
| | 1046 | } |
| | 1047 | |
| | 1048 | if (isset($GLOBALS['WP_MULTILINGUAL'][$type])){ |
| | 1049 | return $GLOBALS['WP_MULTILINGUAL'][$type]; |
| | 1050 | } |
| | 1051 | |
| | 1052 | if (!isset($GLOBALS['current_user'])){ |
| | 1053 | $wppref = 'wordpress_'; |
| | 1054 | foreach($_COOKIE as $k=>$i){ |
| | 1055 | if (substr($k, 0, strlen($wppref )) == $wppref && strlen(substr($k, strlen($wppref), 32)) == '32'){ |
| | 1056 | list($user,,) = explode('|', $i); |
| | 1057 | $sql = 'SELECT um.meta_value FROM '.$GLOBALS['table_prefix'].'users u, '.$GLOBALS['table_prefix'].'usermeta um WHERE u.user_login = \''.WP_Multilingual::SafeVar($user).'\' AND u.ID = um.user_id AND um.meta_key = \''.$type.'\''; |
| | 1058 | $lang = $GLOBALS['wpdb']->get_var($sql); |
| | 1059 | if (!is_null($lang)){ |
| | 1060 | $GLOBALS['WP_MULTILINGUAL'][$type] = $lang; |
| | 1061 | return $lang; |
| | 1062 | } |
| | 1063 | } |
| | 1064 | } |
| | 1065 | } |
| | 1066 | |
| | 1067 | } |
| | 1068 | |
| 1037 | | $language = isset($_GET['language']) ? $_GET['language'] : substr(str_replace(get_option('home'), '', 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']), 1, 2) ; |
| 1038 | | $d = $GLOBALS['wpdb']->get_row("SELECT lang_locale FROM ".$GLOBALS['table_prefix']."langs where lang_shortcode = '".WP_Multilingual::SafeVar($language)."'", ARRAY_A); |
| 1039 | | |
| 1040 | | |
| 1041 | | if (file_exists(ABSPATH . LANGDIR."/".$d['lang_locale'].".mo") && !defined('WPLANG')){ |
| | 1083 | |
| | 1084 | if ($locale == ''){ |
| | 1085 | $language = isset($_GET['language']) ? $_GET['language'] : substr(str_replace(get_option('home'), '', 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']), 1, 2) ; |
| | 1086 | $d = $GLOBALS['wpdb']->get_row("SELECT lang_locale FROM ".$GLOBALS['table_prefix']."langs where lang_shortcode = '".WP_Multilingual::SafeVar($language)."'", ARRAY_A); |
| | 1087 | |
| | 1088 | if (file_exists(ABSPATH . LANGDIR."/".$d['lang_locale'].".mo") && !defined('WPLANG')){ |
| 1280 | | define('WPLANG', $GLOBALS['current_user']->data->wplocalization); |
| 1281 | | load_textdomain('default', ABSPATH . LANGDIR ."/".$GLOBALS['current_user']->data->wplocalization.".mo"); |
| 1282 | | |
| 1283 | | $l = strlen($GLOBALS['current_user']->data->wplocalization); |
| 1284 | | $s = $l == 2 ? 0 : 3; |
| 1285 | | foreach(file(dirname(__FILE__)."/settings/locale.txt") as $str){ |
| 1286 | | if (substr($str, $s, $l) == $GLOBALS['current_user']->data->wplocalization) break; |
| 1287 | | } |
| 1288 | | $GLOBALS['wp_locale']->text_direction = substr($str, 9, 3); |
| | 1326 | if (!defined('WPLANG')) define('WPLANG', $syslang); |
| | 1327 | load_textdomain('default', ABSPATH . LANGDIR ."/".$syslang.".mo"); |
| | 1328 | |
| | 1329 | $l = strlen($GLOBALS['current_user']->data->wplocalization); |
| | 1330 | $s = $l == 2 ? 0 : 3; |
| | 1331 | foreach(file(dirname(__FILE__)."/settings/locale.txt") as $str){ |
| | 1332 | if (substr($str, $s, $l) == $GLOBALS['current_user']->data->wplocalization) break; |
| | 1333 | } |
| | 1334 | $GLOBALS['wp_locale']->text_direction = substr($str, 9, 3); |
| 1290 | | |
| 1291 | | if (isset($GLOBALS['current_user']->data->wpmultilingial) && file_exists(dirname(__FILE__)."/l10n/".MULTILINGUAL_DOMAIN."-".$GLOBALS['current_user']->data->wpmultilingial.".mo")){ |
| 1292 | | $_locale = $locale; |
| 1293 | | |
| 1294 | | $locale = $GLOBALS['current_user']->data->wpmultilingial; |
| 1295 | | load_plugin_textdomain(MULTILINGUAL_DOMAIN, str_replace(str_replace("\\", "/", ABSPATH), '', str_replace("\\", "/", dirname(__FILE__)))."/l10n"); |
| 1296 | | $locale = $_locale; |
| 1297 | | } |
| | 1336 | |
| | 1337 | $selflang = WP_Multilingual::GetMLLocale('self'); |
| | 1338 | |
| | 1339 | if (isset($selflang) && file_exists(dirname(__FILE__).'/l10n/'.MULTILINGUAL_DOMAIN."-".$selflang.".mo")){ |
| | 1340 | |
| | 1341 | $locale = $selflang; |
| | 1342 | load_plugin_textdomain(MULTILINGUAL_DOMAIN, str_replace(str_replace("\\", "/", ABSPATH), '', str_replace("\\", "/", dirname(__FILE__)))."/l10n"); |
| | 1343 | $locale = $syslang; |
| | 1344 | } |