View file f_say.dat

File size: 2.99Kb
if (strpos($say,"/index.php?sid=")!==false) $say=substr($say,0,strpos($say,"/index.php?sid="));
	if ($translit) {
		include "f_transl.dat";
		$say=trans($say);
		}
	$s=$to.$say;
	// UTF-8 русские буквы
	$s=str_replace("\xd0\x81","Ё",$s);
	$s=str_replace("\xd1\x91","ё",$s);
	$s=preg_replace("/\xd0([\x90-\xbf])/e","chr(ord('\\1')+48)",$s);
	$s=preg_replace("/\xd1([\x80-\x8f])/e","chr(ord('\\1')+112)",$s);

	$s=str_replace('\\',"",$s);
	$s=str_replace('"',"",$s);
	$s=str_replace("'","",$s);
	$s=preg_replace('/([^ -}А-я#])|\$|&/e',"",$s);
	$s=preg_replace('/(с|c)(у|y)(ч)?(к|k)(а|a)/i',"[бип]",$s);
	$s=preg_replace('/пидор/i',"[бип]",$s);
	$s=preg_replace('/пид(о|o|a|а)(р|p)(а|a)(з|c|с)/i',"[бип]",$s);
	$s=preg_replace('/\w*(х|x)(у|y)\w*/i',"[бип]",$s);
	$s=preg_replace('/\w*пизд\w*/i',"[бип]",$s);
	$s=preg_replace('/\w*(е|e)б(а|a)\w*/i',"[бип]",$s);
	$s=preg_replace('/\w*бля\w*/i',"[бип]",$s);
	$s=str_replace("|","",$s);
	$s=str_replace("<","",$s);
	$s=str_replace(">","",$s);
	$s=str_replace(".ru","",$s);
	$s=str_replace(".org","",$s);
	$s=str_replace(".net","",$s);
	$s=str_replace(".com","",$s);
	$s=str_replace(".ua","",$s);
	$s=str_replace("waps.ru","bigwap.org",$s);
	
$jad=explode("|",$game[$loc][$login]["title"]);
if (time()<$jad[17]) {
                     $s=str_replace("к", "o", $s);
            $s=str_replace("К", "Щ", $s);
            $s=str_replace("а", "и", $s);
            $s=str_replace("А", "И", $s);
            $s=str_replace("В", "P", $s);
           // $s=str_replace("м", "m", $s);
            $s=str_replace("М", "П", $s);
            $s=str_replace("о", "у", $s);
            $s=str_replace("О", "У", $s);
            $s=str_replace("р", "з", $s);
            $s=str_replace("Р", "З", $s);
            $s=str_replace("Н", "Ф", $s);
            $s=str_replace("с", "х", $s);
            $s=str_replace("С", "Х", $s);
            $s=str_replace("у", "а", $s);
            $s=str_replace("У", "А", $s);
            $s=str_replace("е", "ю", $s);
            $s=str_replace("Е", "Ю", $s);
            $s=str_replace("х", "д", $s);
            $s=str_replace("Х", "Ж", $s);
            $s=str_replace("Т", "Г", $s);
            $s=str_replace("Ь", "ь", $s);
            $s=str_replace("З", "Ч", $s);
            $s=str_replace("и", "ы", $s);
}
$say=substr($s,0,250);
	// добавим всем, включая себя, в журнал что сказали
	if (!$player["ghost"]) addjournalall($player["loc"],$player["title"].": ".$say); 
		else foreach (array_keys($game["loc"][$player["loc"]]) as $i) if (substr($i,0,5)=='user.'){
		$skills=split("\|",$game["loc"][$player["loc"]][$i]["skills"]);
		if (rand(0,100)<=$skills[21]*20) addjournal($i,$player["title"].":".$say);
			else {
				$stmp = preg_replace("/[A-ZА-Я]/","O",$say);
				$stmp = preg_replace("/[a-zа-я]/","o",$stmp);
				addjournal($i,$player["title"].": ".$stmp);
				}
		}
	// добавим в макросы, что последнее действие было say
	$player["macros"]["last"]["action"]="say";
	$player["macros"]["last"]["object"]="\"".$say."\"";