View file chatservice/ini.php

File size: 4.16Kb
<?php
include 'lang.inc.php';

$DB_HOST = "localhost";
$DB_USER = "chatik_sv";
$DB_PASS = "sv";
$DB_NAME = "chatik_sv";
$limit ="10";
$offline = 300;                        ;
$divide = "<small>*****</small><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, $ci;


        $q = @mysql_query("select * from `".$px.$utable."` where id='$id' and pass='$pass' and ci='$ci' 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="&#65533;&#65533;&#65533;&#65533;!">'.
        '<p>'.
        '&#65533;&#65533;&#65533;&#65533; &#65533;&#65533;&#65533;&#65533;&#65533;&#65533; &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533; &#65533;&#65533; &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;!'.
        '<br/>'.
        '<anchor>&#65533;&#65533;&#65533;&#65533;&#65533;<prev/></anchor><br/>'.
        '<u><a href="http://ruwap.com.ru">ruwap.com.ru</a></u>'.
        '</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='&#1055;&#1088;&#1086;&#1093;&#1086;&#1078;&#1080;&#1081;' where id='".$login['id']."' and ci='$ci';");
if($posts>=100 && $posts<500 && $status=="&#1055;&#1088;&#1086;&#1093;&#1086;&#1078;&#1080;&#1081;")
@mysql_query("update `".$px.$utable."` set status='&#1053;&#1086;&#1074;&#1080;&#1095;&#1086;&#1082;' where id='".$login['id']."' and ci='$ci';");
if($posts>=500 && $posts<1000 && $status=="&#1053;&#1086;&#1074;&#1080;&#1095;&#1086;&#1082;")
@mysql_query("update `".$px.$utable."` set status='&#1055;&#1086;&#1083;&#1100;&#1079;&#1086;&#1074;&#1072;&#1090;&#1077;&#1083;&#1100;' where id='".$login['id']."' and ci='$ci';");
if($posts>=1000 && $posts<3000 && $status=="&#1055;&#1086;&#1083;&#1100;&#1079;&#1086;&#1074;&#1072;&#1090;&#1077;&#1083;&#1100;")
@mysql_query("update `".$px.$utable."` set status='&#1055;&#1088;&#1086;&#1076;&#1074;&#1080;&#1085;&#1091;&#1090;&#1099;&#1081;' where id='".$login['id']."' and ci='$ci';");
if($posts>=3000 && $posts<5000 && $status=="&#1055;&#1088;&#1086;&#1076;&#1074;&#1080;&#1085;&#1091;&#1090;&#1099;&#1081;")
@mysql_query("update `".$px.$utable."` set status='&#1063;&#1072;&#1090;&#1090;&#1077;&#1088;' where id='".$login['id']."' and ci='$ci';");
if($posts>=5000 && $posts<7000 && $status=="&#1063;&#1072;&#1090;&#1090;&#1077;&#1088;")
@mysql_query("update `".$px.$utable."` set status='&#1058;&#1091;&#1089;&#1086;&#1074;&#1097;&#1080;&#1082;' where id='".$login['id']."' and ci='$ci';");
if($posts>=7000 && $status=="&#1058;&#1091;&#1089;&#1086;&#1074;&#1097;&#1080;&#1082;")
@mysql_query("update `".$px.$utable."` set status='&#1055;&#1086;&#1095;&#1077;&#1090;&#1085;&#1099;&#1081;' where id='".$login['id']."' and ci='$ci';");
}


?>