Файл: forum/ini.php
Строк: 199
<?
$host="localhost";
$loginb="root";
$password="";
$base="forum";
$ref=rand(100000,1000000000);
//posts and status
$how1=50; $status1="Новичок";
$how2=100; $status2="Продвинутый";
$how3=500; $status3="Бывалый";
$how4=1000; $status4="Живет на форуме";
$how5=2000; $status5="Крутой чел";
$how6=3000; $status6="Реальный медвед";
$how7=5000; $status7="Злобный тусик";
$begin="Вчера родился"; //начальный статус
//
$addr = $REMOTE_ADDR;
$agent = $HTTP_USER_AGENT;
$link = mysql_connect($host, $loginb, $password)
or die ("Could not connect to MySQL");
mysql_select_db ($base)
or die ("Could not select database");
function autorize() {
global $login, $pass;
$q = @mysql_query("select * from users where ((login='$login') and (pass='$pass')) limit 1;");
$duser = @mysql_fetch_array($q);
return $duser;
}
$autorize=autorize();
function delNullUsers() {
$data=date("YmdHi");
$timenow=date("YmdHi");
$newtimenow=$timenow-3;
@mysql_query("UPDATE users SET online=0,onlf='',onlp='',onlt='' WHERE time<$newtimenow;");
}
function delNullAnonim() {
$timenow=@time();
$newtimenow=$timenow-300;
@mysql_query("delete from `anonims` WHERE `time`<$newtimenow;");
}
$id=$autorize['id'];
$post=$autorize['posts'];
if ($post>$how1) $status=$status1;
if ($post>$how2) $status=$status2;
if ($post>$how3) $status=$status3;
if ($post>$how4) $status=$status4;
if ($post>$how5) $status=$status5;
if ($post>$how6) $status=$status6;
if ($post>$how7) $status=$status7;
if (empty($status)) $status=$begin;
@mysql_query("UPDATE users SET `status`='$status' WHERE `id`='$id';");
function latrus($string)
{
$string = ereg_replace("zh","ж",$string);
$string = ereg_replace("Zh","Ж",$string);
$string = ereg_replace("ZH","Ж",$string);
$string = ereg_replace("yo","ё",$string);
$string = ereg_replace("Yu","Ю",$string);
$string = ereg_replace("shc","щ",$string);
$string = ereg_replace("Shc","Щ",$string);
$string = ereg_replace("SHC","Щ",$string);
$string = ereg_replace("yu","ю",$string);
$string = ereg_replace("sh","ш",$string);
$string = ereg_replace("ye","э",$string);
$string = ereg_replace("ya","я",$string);
$string = ereg_replace("Sh","Ш",$string);
$string = ereg_replace("SH","Ш",$string);
$string = ereg_replace("ch","ч",$string);
$string = ereg_replace("Ch","Ч",$string);
$string = ereg_replace("CH","Ч",$string);
$string = ereg_replace("Yo","Ё",$string);
$string = ereg_replace("YO","Ё",$string);
$string = ereg_replace("Ya","Я",$string);
$string = ereg_replace("YA","Я",$string);
$string = ereg_replace("Ye","Э",$string);
$string = ereg_replace("YE","Э",$string);
$string = ereg_replace("i","и",$string);
$string = ereg_replace("'","ь",$string);
$string = ereg_replace("c","ц",$string);
$string = ereg_replace("u","у",$string);
$string = ereg_replace("k","к",$string);
$string = ereg_replace("e","е",$string);
$string = ereg_replace("n","н",$string);
$string = ereg_replace("g","г",$string);
$string = ereg_replace("z","з",$string);
$string = ereg_replace("h","х",$string);
$string = ereg_replace("''","ъ",$string);
$string = ereg_replace("f","ф",$string);
$string = ereg_replace("x","ы",$string);
$string = ereg_replace("v","в",$string);
$string = ereg_replace("a","а",$string);
$string = ereg_replace("p","п",$string);
$string = ereg_replace("j","й",$string);
$string = ereg_replace("y","ы",$string);
$string = ereg_replace("r","р",$string);
$string = ereg_replace("o","о",$string);
$string = ereg_replace("l","л",$string);
$string = ereg_replace("d","д",$string);
$string = ereg_replace("s","с",$string);
$string = ereg_replace("m","м",$string);
$string = ereg_replace("t","т",$string);
$string = ereg_replace("b","б",$string);
$string = ereg_replace("Y","Ы",$string);
$string = ereg_replace("C","Ц",$string);
$string = ereg_replace("U","У",$string);
$string = ereg_replace("K","К",$string);
$string = ereg_replace("J","Й",$string);
$string = ereg_replace("E","Е",$string);
$string = ereg_replace("N","Н",$string);
$string = ereg_replace("G","Г",$string);
$string = ereg_replace("Z","З",$string);
$string = ereg_replace("H","Х",$string);
$string = ereg_replace("F","Ф",$string);
$string = ereg_replace("X","Ы",$string);
$string = ereg_replace("V","В",$string);
$string = ereg_replace("A","А",$string);
$string = ereg_replace("P","П",$string);
$string = ereg_replace("R","Р",$string);
$string = ereg_replace("O","О",$string);
$string = ereg_replace("L","Л",$string);
$string = ereg_replace("D","Д",$string);
$string = ereg_replace("S","С",$string);
$string = ereg_replace("M","М",$string);
$string = ereg_replace("I","И",$string);
$string = ereg_replace("T","Т",$string);
$string = ereg_replace("B","Б",$string);
return $string;
}
?>