<?
$change=array(
"а" => "а",
"б" => "б",
"в" => "в",
"г" => "г",
"д" => "д",
"е" => "е",
"ё" => "ё",
"ж" => "ж",
"з" => "з",
"и" => "и",
"й" => "й",
"к" => "к",
"л" => "л",
"м" => "м",
"н" => "н",
"о" => "о",
"п" => "п",
"р" => "р",
"с" => "с",
"т" => "т",
"у" => "у",
"ф" => "ф",
"х" => "х",
"ц" => "ц",
"ч" => "ч",
"ш" => "ш",
"щ" => "щ",
"ъ" => "ъ",
"ы" => "ы",
"ь" => "ь",
"э" => "э",
"ю" => "ю",
"я" => "я",
"А" => "А",
"Б" => "Б",
"В" => "В",
"Г" => "Г",
"Д" => "Д",
"Е" => "Е",
"Ё" => "Ё",
"Ж" => "Ж",
"З" => "З",
"И" => "И",
"Й" => "Й",
"К" => "К",
"Л" => "Л",
"М" => "М",
"Н" => "Н",
"О" => "О",
"П" => "П",
"Р" => "Р",
"С" => "С",
"Т" => "Т",
"У" => "У",
"Ф" => "Ф",
"Х" => "Х",
"Ц" => "Ц",
"Ч" => "Ч",
"Ш" => "Ш",
"Щ" => "Щ",
"Ъ" => "Ъ",
"Ы" => "Ы",
"Ь" => "Ь",
"Э" => "Э",
"Ю" => "Ю",
"Я" => "Я",
);
function win2utf($s)
{
global $change;
$s = str_replace("\r\n","",$s);
$s = preg_replace("/[\x01-\x1F\x80-\xA7\xA9-\xB7\xB9-\xBF]/s","?",$s);
return strtr($s,$change);
}
function ShowMess($title,$mess,$linkmess,$link,$wait)
{
Header("Content-type:text/vnd.wap.wml; charset=UTF-8\n\n\n");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
echo "<wml>";
echo "<card title=\"".win2utf($title)."\">";
echo "<onevent type=\"ontimer\">\n";
if ($link == "") {echo "<prev/>\n"; $link="prev/"; }
else { echo "<go href=\"$link\"/>"; $link="go href=\"$link\"/";}
echo "</onevent>";
echo "<timer value=\"$wait\"/>";
echo "<p align=\"center\">";
if ($mess != "") echo win2utf($mess)."<br/>\n";
if ($linkmess != "") echo "<anchor>".win2utf($linkmess),"<$link></anchor>\n";
echo "</p>";
echo "</card>";
echo "</wml>";
exit();
}
if (strpos(" ".strtolower($HTTP_HOST),"mag.su") === false)
ShowMess("- Маг -","","Поздравляем Вас с переездом на новый сервер. Измените в закладках wap.computermag.ru на mag.su","http://mag.su/magforum",20);
else ShowMess("- Маг -","","Технический вход на новый сервер","http://ssp.p8.ru/magforum",20);
?>