Просмотр файла nwchat/chat/ini.php

Размер файла: 4.25Kb
<?php
include 'lang.inc.php';
///////////////////////////////////////////////////////////
$DB_HOST = "localhost";//е®бв Ў¤
$DB_USER = "";	//Ё¬п Ї®«м§®ў вҐЎп Ў¤
$DB_PASS = "";	//Ї а®«м Ї®«м§®ў вҐ«п Ў¤
$DB_NAME = "";	//­ §ў ­ЁҐ Ў¤
////////////////////////////////////////////////////////////
$offline = 300;			//‚६п, зҐаҐ§ Є®в®а®Ґ Ї®«м§®ў вҐ«м бзЁв Ґвбп ®дд« ©­
$divide = "<b>:::::</b><br/>";	//а §¤Ґ«ЁвҐ«м ў ЇаЁе®¦Ґ©
$px = "chat_";			//ЇаҐдЁЄб ­ §ў ­Ёп в Ў«Ёжл
$itable = "ignor";		//Ё¬п в Ў«Ёжл ЁЈ­®а 
$utable = "users";		//Ё¬п в Ў«Ёжл Ї®«м§®ў вҐ«Ґ©
$stable = "settings";		//Ё¬п в Ў«Ёжл ­ бв஥Є
$qtable = "ques";		//Ё¬п в Ў«Ёжл ў®Їа®б®ў
$vtable = "vict";		//Ё¬п в Ў«Ёжл ўЁЄв®аЁ­л
$mtable = "messages";		//Ё¬п в Ў«Ёжл б®®ЎйҐ­Ё©
$meettable = "meets";		//Ё¬п в Ў«Ёжл ўбваҐз
$ltable = "letters";		//Ё¬п в Ў«Ёжл ¤«п ЇЁбҐ¬
////////////////////////////////////////////////////////////
function gettime()
{
	$part_time = explode(' ', microtime());
	$real_time = $part_time[1].substr($part_time[0], 1);
	return $real_time;
}
////////////////////////////////////////////////////////////
//дг­ЄжЁп ¤«п  ўв®аЁ§ жЁЁ Ї®«м§®ў вҐ«п
function autorize() {
	global $px, $utable, $login, $id, $pass;
	//Є®¤Ёа㥬 Ї а®«м
	//$бpass = crypt($pass, $crypt);
	//§ Їа®б ­  ўлЎ®а Ї®«м§®ў вҐ«п Ё§ Ў¤
	$q = @mysql_query("select * from `".$px.$utable."` where id='$id' and pass='$pass' limit 1;");
	//ЇЁе Ґ¬ ¤ ­­лҐ Ё§ § Їа®б  ў ¬ ббЁў
	$duser = @mysql_fetch_array($q);
	//ў®§ўа й Ґ¬ «®ЈЁ­ Ї®«м§®ў вҐ«п
	return $duser;
}
////////////////////////////////////////////////////////////
//¬ ббЁў ¤«п ва ­б«ЁвҐа жЁЁ ЎгЄў
$tran = array(
"A"=>"Рђ","a"=>"Р°","B"=>"Р‘","b"=>"Р±","V"=>"Р’",
"v"=>"РІ","G"=>"Р“","g"=>"Рі","D"=>"Р”","d"=>"Рґ",
"E"=>"Р•","e"=>"Рµ","yo"=>"РЃ","Zh"=>"Р–","zh"=>"Р¶",
"Z"=>"Р—","z"=>"Р·","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"=>"С…",
"C"=>"Р¦","c"=>"С†","Ch"=>"Р§","ch"=>"С‡","Sh"=>"РЁ",
"sh"=>"С€","Sch"=>"Р©","sch"=>"С‰","''"=>"СЉ",
"Y"=>"Р«","y"=>"С‹","'"=>"СЊ","Ye"=>"Р­",
"ye"=>"СЌ","Yu"=>"Р®","yu"=>"СЋ","Ya"=>"РЇ","ya"=>"СЏ",
"Yo"=>"С‘"
);
//дг­ЄжЁп Є®­ўҐав жЁЁ ва ­б«Ёв  ў о­ЁЄ®¤
function latrus($str) {
	global $tran;
	return strtr($str,$tran);
}
////////////////////////////////////////////////////////////
//ўлЇ®«­пҐ¬ ᮥ¤Ё­Ґ­ЁҐ
mysql_connect($DB_HOST,$DB_USER,$DB_PASS) or die ('<card id="error" title="ЋиЁЎЄ ">'.
	'<p>'.
	'К сожалению база данных в данный момент недоступна! Если вы уверены, что это не случайно, обратитесь к админам!'.
	'<br/>'.
	'<anchor>Назад<prev/></anchor><br/>'.
	'<a href="/">corporation</a>'.
	'</p>'.
	'</card>'.
	'</wml>');
//ўлЎЁа Ґ¬ Ў §г ¤«п а Ў®вл
mysql_select_db($DB_NAME);
///////////////////////////////////////////////////////////
//дг­ЄжЁп ®Ў­®ў«Ґ­Ёп бв вгб 
function ustatus() {
global $login, $px, $utable;
$status = $login['status'];
$posts = $login['posts'];
//ўлЎЁа Ґ¬ бв вгб
if(empty($status))
@mysql_query("update `".$px.$utable."` set status='Прохожий' where id='".$login['id']."';");
if($posts>=100 && $posts<500 && $status=="Прохожий")
@mysql_query("update `".$px.$utable."` set status='Новичок' where id='".$login['id']."';");
if($posts>=500 && $posts<1000 && $status=="Новичок")
@mysql_query("update `".$px.$utable."` set status='Пользователь' where id='".$login['id']."';");
if($posts>=1000 && $posts<3000 && $status=="Пользователь")
@mysql_query("update `".$px.$utable."` set status='Продвинутый' where id='".$login['id']."';");
if($posts>=3000 && $posts<5000 && $status=="Продвинутый")
@mysql_query("update `".$px.$utable."` set status='Чаттер' where id='".$login['id']."';");
if($posts>=5000 && $posts<7000 && $status=="Чаттер")
@mysql_query("update `".$px.$utable."` set status='Тусовщик' where id='".$login['id']."';");
if($posts>=7000 && $status=="Тусовщик")
@mysql_query("update `".$px.$utable."` set status='Почетный' where id='".$login['id']."';");
}
?>