Просмотр файла sea/moduls/fun.php

Размер файла: 3.95Kb
<?php
#-----------------------------------------------------#
#     ============ЗАГРУЗ-ЦЕНТР=============           #
#             	 Автор  :  Sea                   	  #
#               E-mail  :  [email protected]              #
#                  ICQ  :  355152215                   #
#   Вы не имеете права распространять данный скрипт.  #
#   		По всем вопросам пишите в ICQ.            #
#-----------------------------------------------------#
function trans($t)
{
	$str = explode("!",$t);
	$a=array("_","YA","Ya","ya","yee","YO","yo","Yo","ZH","zh","Zh","Z","z","CH","ch","Ch","SH","sh","Sh","YE","ye","Ye","YU","yu","Yu","JA","ja","Ja","A","a","B","b","V","v","G","g","D","d","E","e","I","i","J","j","K","k","L","l","M","m","N","n","O","o","P","p","R","r","S","s","T","t","U","u","F","f","H","h","W","w",'x',"q","Y","y","C","c","!");
	$b=array(" ","Я","Я","я","ые","Ё","ё","Ё","Ж","ж","Ж","З","з","Ч","ч","Ch","Ш","ш","Ш","Э","э","Э","Ю","ю","Ю","Я","я","Я","А","а","Б","б","В","в","Г","г","Д","д","Е","е","И","и","Й","й","К","к","Л","л","М","м","Н","н","О","о","П","п","Р","р","С","с","Т","т","У","у","Ф","ф","Х","х","Щ","щ","ъ","ь","Ы","ы","Ц","ц","");
	return $str[0].str_replace($a,$b,$str[1]);
}
function retrans($t)
{
	$a=array("_","YA","Ya","ya","yee","YO","yo","Yo","ZH","zh","Zh","Z","z","CH","ch","Ch","SH","sh","Sh","YE","ye","Ye","YU","yu","Yu","JA","ja","Ja","A","a","B","b","V","v","G","g","D","d","E","e","I","i","J","j","K","k","L","l","M","m","N","n","O","o","P","p","R","r","S","s","T","t","U","u","F","f","H","h","W","w",'x',"q","Y","y","C","c","!");
	$b=array(" ","Я","Я","я","ые","Ё","ё","Ё","Ж","ж","Ж","З","з","Ч","ч","Ch","Ш","ш","Ш","Э","э","Э","Ю","ю","Ю","Я","я","Я","А","а","Б","б","В","в","Г","г","Д","д","Е","е","И","и","Й","й","К","к","Л","л","М","м","Н","н","О","о","П","п","Р","р","С","с","Т","т","У","у","Ф","ф","Х","х","Щ","щ","ъ","ь","Ы","ы","Ц","ц","");
	return str_replace($b,$a,$t);
}
function bbcode($text) //конвертация кодов в теги регулярными выражениями
{
	$text = eregi_replace("(.*)\\[url\\]\\http://(.*)\\[/url\\](.*)","\\1<a href=\"http://\\2\">\\3</a>",$text);
	$text = eregi_replace("(.*)\\[b\\](.*)\\[/b\\](.*)","\\1<b>\\2</b>\\3",$text);
	$text = eregi_replace("(.*)\\[red\\](.*)\\[/red\\](.*)","\\1<font color=\"red\">\\2</font>\\3",$text);
	return $text;
}
function trans2($t)
{
	$a=array("_");
	$b=array(" ");
	return str_replace($a,$b,$t);
}
function clean($txt)
{
	$txt = addslashes(trim(htmlspecialchars(stripslashes($txt))));
	$txt = mysql_real_escape_string($txt);
	return $txt;
}
function cut($txt,$k)
{
	$txt = substr($txt, 0, $k);
	return $txt;
}
function del($text)
{
	$text=str_replace("&","", $text);
	$text=str_replace("$","", $text); //
	$text=str_replace(">","", $text);
	$text=str_replace("<","", $text);
	$text=str_replace("~","", $text);
	$text=str_replace("`","", $text);
	$text=str_replace("#","", $text);
	$text=str_replace("*","", $text);
	return $text;
}
function is_num($txt,$name)
{
	global $hackmess,$_POST,$_GET,$_SESSION;
	if(isset($_POST[$name])) $txt = $_POST[$name];
	elseif (isset($_GET[$name])) $txt = $_GET[$name];
	elseif (isset($_SESSION[$name])) $txt = $_SESSION[$name];
	if ((!ctype_digit($txt) or $txt < 0) and !empty($txt)) die($hackmess);
}
function check($value)
{
	if($value == 0) $result = ""; else $result = "checked";
	return $result;
}
function sel($value,$real)
{
	if($value != $real) $result = ""; else $result = "selected";
	return $result;
}
function get2ses($name)
{
	global $_GET,$_SESSION,$setup;
	$d = $name;
	if(!isset($_SESSION[$name])) {$_SESSION[$name] =  $setup[$name]; }
	if(isset($_GET[$name])) { $_SESSION[$name] = $_GET[$name];}
	return $$name = $_SESSION[$d];
}
?>