Вход Регистрация
Файл: wml/sroom.php
Строк: 292
<?php

header 
("Content-type:text/vnd.wap.wml; charset=utf-8");

print 
'<?xml version="1.0" encoding="utf-8"?>';
print 
'<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">'.
'<wml><head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>';
include 
"./ini.php";
mysql_query ("select * from bannedib WHERE ci='$ci' AND ( ((ip = '".getenv(REMOTE_ADDR)."')and(browser = '".getenv(HTTP_USER_AGENT)."')) or ((ip = '".getenv(REMOTE_ADDR)."') and (browser = '')) or  (login='$id'))");
            if(
mysql_affected_rows()!=0){include "b.php";}
$start gettime();
$r rand(0,100000);

$login autorize();

$query_settings = @mysql_query("select `val2` from `".$px.$stable."` where var='$room' and mod='room' and ci='".$login['ci']."';");

$settings = @mysql_fetch_array($query_settings);

$num_msgs $login['nmsgs'];
$time_update $login['tupdate'];

if(empty(
$num_msgs)) $num_msgs=5;
if(empty(
$time_update)) $time_update=300;

$timenow strftime("%H:%M:%S");

$rtitle $settings['val2'];

$pass=htmlspecialchars(stripslashes(trim($pass)));
$room=htmlspecialchars(stripslashes(trim($room)));

$q_letters_in = @mysql_query("select count(*) from `".$px.$ltable."` where `to_user`='".$login['login']."' and ci='".$ci."' and `new`=1;");
$num_in=@mysql_fetch_array($q_letters_in);
$pr_count = @mysql_query("SELECT count(*) FROM `".$px.$utable."` WHERE ltime>'".intval(time()-$offline)."' AND room='$room' and ci= '$ci';");

$pdc = @mysql_fetch_array($pr_count);

$q_letters_in = @mysql_query("select count(*) from `".$px.$ltable."` where `to_user`='".$login['login']."' and ci='".$ci."' and `new`=1;");
$num_in=@mysql_fetch_array($q_letters_in);
$pr_count = @mysql_query("SELECT count(*) FROM `".$px.$utable."` WHERE ltime>'".intval(time()-$offline)."' AND room='$room' and ci= '$ci';");

if(
$mod=="privat")
print 
'<card id="main" title="'.$lang['sort'].'-('.$pdc['count(*)'].')" ontimer="sroom.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;room='.$room.'&amp;mod=privat&amp;r='.$r.'"><timer value="'.$time_update.'0"/>';
else
if (
$room == "intim"){     print '<card id="main" title="&#1048;&#1085;&#1090;&#1080;&#1084; -('.$pdc['count(*)'].')" ontimer="sroom.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;key='.$key.'&amp;room='.$room.'&amp;r='.$r.'"><timer value="'.$time_update.'0"/>';
    }else{
print 
'<card id="main" title="'.$lang['sort'].'-('.$pdc['count(*)'].')" ontimer="sroom.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;room='.$room.'&amp;r='.$r.'"><timer value="'.$time_update.'0"/>';
}
if (
$login['sftwhr'] == "1")
print 
'<do type="options" name="whowhere" label="&#1050;&#1090;&#1086;?&#1043;&#1076;&#1077;?"><go href="online.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;room='.$room.'&amp;r='.$r.'" method="get"/></do>';
if (
$login['sftltrs'] == "1")
print 
'<do type="options" name="letters" label="&#1055;&#1080;&#1089;&#1100;&#1084;&#1072;('.$num_in['count(*)'].')"><go href="letters/inbox.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;r='.$r.'" method="get"/></do>';
if ((
$login['sfthr'] == "1") and ($room !== "intim"))
print 
'<do type="options" name="whohere" label="&#1050;&#1090;&#1086; &#1079;&#1076;&#1077;&#1089;&#1100;('.$pdc['count(*)'].')"><go href="here.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;room='.$room.'&amp;r='.$r.'" method="get"/></do>';
if (
$login['sftsay'] == "1")
print 
'<do type="options" name="say" label="&#1054;&#1073;&#1085;&#1086;&#1074;&#1080;&#1090;&#1100;"><go href="sroom.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;room='.$room.'&amp;r='.$r.'" method="get"/></do>';
if (
$login['sftref'] == "1")
print 
'<do type="options" name="refresh" label="&#1057;&#1082;&#1072;&#1079;&#1072;&#1090;&#1100;"><go href="#say" method="get"/></do>';
if ((
$room !== "intim") and ($login['sftpriv'] == "1")) print '<do type="options" name="privat"  label="'.$lang['privat'].'"><go href="./sroom.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;room='.$room.'&amp;mod=privat&amp;r='.$r.'" method="get"/></do>';
if (
$room == "intim") print '<do type="options" name="changekey"  label="&#1057;&#1084;&#1077;&#1085;&#1080;&#1090;&#1100; &#1082;&#1083;&#1102;&#1095;"><go href="./intim.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;room=intim" method="get"/></do>';
if (
$room=="vict") print '<do type="options" name="stats" label="&#1058;&#1086;&#1087; 10"><go href="statistic.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;room='.$room.'&amp;mod=stats&amp;r='.$r.'" method="get"/></do>';

print 
'<p>';

$posts $login['posts'];
$moder $login['moder'];
$admin $login['admin'];
$ltime $login['ltime'];
$ban $login['ban'];
$btime $login['btime'];
$breason $login['breason'];

if(
$login) {
    if(!empty(
$room)) {

    if(!empty(
$private)) $pr explode(".",$private);

    if(
$room=="vict")
    
$query_msg = @mysql_query("select * from `".$px.$vtable."` where ci='".$ci."' and login='".$login['login']."' order by id desc;");
    else
    
$query_msg = @mysql_query("select * from `".$px.$mtable."` where ci='".$ci."' and login='".$login['login']."' order by id desc;");
    if(
$room=="intim")
    
$query_msg = @mysql_query("select * from `".$px.$prtable."` where ci='".$ci."' and login='".$login['login']."' and key='$key' order by id desc;");
    if(
$room=="unlim")
    
$query_msg = @mysql_query("select * from `".$px.$untable."` where ci='".$ci."' and login='".$login['login']."' order by id desc;");
    
$prevmsg = @mysql_fetch_array($query_msg);

    if(
$ban == "kill")
    print 
$lang['you_are_killed'];

    elseif(!empty(
$ban)) {
    if(
$btime >= time()) {
    
$enter $btime time();
    print 
"<b>$ban ".$lang['kick_you'].$lang['reason'].": $breason! ".$lang['unban']."<u>".$enter."</u>".$lang['s']."!</b><br/>";
    } else {
    @
mysql_query("update `".$px.$utable."` set ban='', btime='', breason='' where id='".$id."' and ci='$ci';");
    require 
"./sroom.inc.php"; }
    } else {
    @
mysql_query("update `".$px.$utable."` set ltime='".time()."', room='".$room."' where id='".$id."' and ci='$ci';");

    if(
$translit=="user") { $nik=strtok($msg," "); $msg=strstr($msg," "); $msg=latrus($msg); $msg=$nik.$msg; }
    if(
$translit=="toall") { $msg=latrus($msg); }
    
$msg=htmlspecialchars(stripslashes(trim($msg)));
    if(
$login['admin'] && $bold$msg "<b>".$msg."</b>";
    if(
$login['moder'] && $underline$msg "<u>".$msg."</u>";

    include 
"./sm/convert_to_smiles.php";

    if(!empty(
$msg) && $msg!=$prevmsg['msg']) {

    if(
$room=="vict")
    {@
mysql_query("insert into `".$px.$vtable."` values(0,'".$login['login']."','$msg','".$pr[0]."','".$pr[1]."','','','".time()."','$ci');");}
    if(
$room=="unlim")
    {@
mysql_query("insert into `".$px.$untable."` values(0,'".$login['login']."','$msg','".$pr[0]."','".$pr[1]."','".time()."','$ci');");}
    if(
$room=="intim")
    {@
mysql_query("insert into `".$px.$prtable."` values(0,'".$login['login']."','$msg','$key','".time()."','$ci');");}
    if ((
$room !== "vict") and ($room !== "intim") and ($room !== "unlim"))
    {@
mysql_query("insert into `".$px.$mtable."` values(0,'".$login['login']."','$msg','".$pr[0]."','".$pr[1]."','".time()."','$room','$ci');");
    }
    @
mysql_query("update `".$px.$utable."` set posts='".++$posts."', ltime='".time()."' where id='".$id."' and ci='$ci';"); }

    if(
$room=="vict") include "./vict.inc.php";

    if(
$login['fsize'] == "small") { $fsize1 "<small>"$fsize2 "</small>"; }
    elseif(
$login['fsize'] == "big") { $fsize1 "<big>"$fsize2 "</big>"; }
    else { 
$fsize1 ""$fsize2 ""; }

    print 
$fsize1;
    include 
"./sroom.inc.php";
    print 
$fsize2;
        }     } else { print 
$lang['room_not_exist']; }
    } else { print 
$lang['not_loged']; }

@
mysql_close();
$end gettime();
print 
"<small>[".round(($end $start), 5)."]</small>";

print 
'</p>'.
'</card>'.
'<card id="say" title="'.$lang['say'].'">'.
'<p>'.
'<input name="msg'.$r.'"/><br/>'.
'<select multiple="true" name="translit">'.
'<option value="toall">Translit</option></select><br/>';
if(
$login['admin']) print '<select multiple="true" name="bold"><option value="1">'.$lang['bold'].'</option></select><br/>';
if(
$login['moder']) print '<select multiple="true" name="underline"><option value="1">'.$lang['underline'].'</option></select><br/>';
if (
$room == "intim"){
print 
'<anchor>'.$lang['say'].'<go href="sroom.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;key='.$key.'&amp;room='.$room.'&amp;r='.$r.'" method="post">';
}else {     print 
'<anchor>'.$lang['say'].'<go href="sroom.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;room='.$room.'&amp;r='.$r.'" method="post">';
    }
print 
'<postfield name="msg" value="$(msg'.$r.')"/>'.
'<postfield name="bold" value="$(bold)"/>'.
'<postfield name="underline" value="$(underline)"/>'.
'<postfield name="translit" value="$(translit)"/></go></anchor>';
if (
$room == "intim"){
print 
'<br/><a href="sroom.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;key='.$key.'&amp;room='.$room.'&amp;r='.$r.'">'.$lang['to_chat'].'</a><br/>';
}else{     print 
'<br/><a href="sroom.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;room='.$room.'&amp;r='.$r.'">'.$lang['to_chat'].'</a><br/>';
    }
print 
'</p>'.
'</card>'.
'</wml>';
?>
Онлайн: 1
Реклама