Вход Регистрация
Файл: xroom.php
Строк: 315
<?php
ini_set
('display_errors''off');
header("Content-type: text/html");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
include 
"./ini.php";
echo 
'<?xml version="1.0" encoding="utf-8"?>';
print 
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head>";
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";}?>
<SCRIPT language=JavaScript>
var tohex = new Array(256);
var hex = "0123456789ABCDEF";
var count = 0;
for (x=0; x<16; x++) {
 for (y=0; y<16; y++) {
 tohex[count] = hex.charAt(x) + hex.charAt(y);
 count++;
 }
}

function ColorCode(hexcode) {
  if (hexcode.length == 7) {
    this.r = parseInt(hexcode.substring(1,3),16);
    this.g = parseInt(hexcode.substring(3,5),16);
    this.b = parseInt(hexcode.substring(5,7),16);
  }
  else if (hexcode.length == 6) {
    this.r = parseInt(hexcode.substring(0,2),16);
    this.g = parseInt(hexcode.substring(2,4),16);
    this.b = parseInt(hexcode.substring(4,6),16);
  }
  else {
    this.r = this.g = this.b = 0;
    alert("Error: ColorCode constructor failed");
  }
  if (isNaN(this.r)||isNaN(this.g)||isNaN(this.b))
    alert("Error: ColorCode constructor failed");
}
 
function ColorList(hexcodes) {
  var i = 0;
  var c = 0;
  this.codes = new Array(Math.round(hexcodes.length/7));
  while (i < hexcodes.length) {
    if (isNaN(parseInt(hexcodes.substring(i,i+6),16))) ++i;
    else {
      this.codes[c] = new ColorCode(hexcodes.substring(i,i+6));
      i += 7;
      ++c;
    }
  }
  this.len = c;
}
 
function interpolate (x1, y1, x3, y3, x2) {
  if (x3 == x1) return y1
  else return (x2-x1)*(y3-y1)/(x3-x1) + y1
}

function lowcolorindex (x, y, z) {
  if (y == 1) return 0
  else return Math.floor( (x*(z-1))/(y-1) )
}
 
function hicolorindex (x, y, z, low) { 
  if ( low*(y-1) == x*(z-1) ) return low
  else if (y == 1) return 0
  else return Math.floor( (x*(z-1))/(y-1) + 1 )
}
 
function gradient (thetext,thecolors) {
    var colors = new ColorList(thecolors);
    var numcolors = colors.len;
    var numchars = thetext.length;
    var rr = 0;
    var gg = 0;
    var bb = 0;
    var lci = 0;
    var hci = 0;
    for (i=0; i<numchars; ++i) {
      lci = lowcolorindex(i, numchars, numcolors);
      hci = hicolorindex(i, numchars, numcolors, lci);
      rr = Math.round(interpolate( lci/(numcolors-1), colors.codes[lci].r, hci/(numcolors-1), colors.codes[hci].r, i/(numchars-1)));
      gg = Math.round(interpolate( lci/(numcolors-1), colors.codes[lci].g, hci/(numcolors-1), colors.codes[hci].g, i/(numchars-1)));
      bb = Math.round(interpolate( lci/(numcolors-1), colors.codes[lci].b, hci/(numcolors-1), colors.codes[hci].b, i/(numchars-1)));
      document.write(thetext.charAt(i).fontcolor('#' + tohex[rr]+tohex[gg]+tohex[bb]));
    }
  }
</script>
<?
$start 
gettime();
$r rand(0,100000);

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

$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=xroom;
$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='xroom';");

$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='xroom';");

if (
$login['sftwhr'] == "1")
print 
'<do type="options" name="whowhere" label="&#1050;&#1090;&#1086;?&#1043;&#1076;&#1077;?"><go href="online.php?s='.$s.'&amp;ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;r='.$r.'" method="get"/></do>';
if (
$login['sftltrs'] == "1")
print 
'<do type="options" name="letters" label="Сообщения('.$num_in['count(*)'].')"><go href="letters/inbox.php?s='.$s.'&amp;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="online.php?s='.$s.'&amp;ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;r='.$r.'" method="get"/></do>';
if (
$login['sftfaq'] == "1")
print 
'<do type="options" name="faq" label="F.A.Q."><go href="/faq.php?s='.$s.'&amp;ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&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="xroom.php?s='.$s.'&amp;ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&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="./xroom.php?s='.$s.'&amp;ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;mod=privat&amp;r='.$r.'" method="get"/></do>';
$pdc = @mysql_fetch_array($pr_count);
if(
$mod=="privat")
print 
"<title>".$lang['xroom']."  (".$pdc['count(*)'].")</title><meta http-equiv="Content-Type" content="text/htmlcharset=utf-8"><link rel="StyleSheet" type="text/css" href="style/0".$s.".css"></head><body>";
else
print 
"<title>".$lang['xroom']." (".$pdc['count(*)'].")</title><meta http-equiv="Content-Type" content="text/htmlcharset=utf-8"><link rel="StyleSheet" type="text/css" href="style/0".$s.".css"></head><body>";
print 
"<meta http-equiv="refresh" content=".$time_update.";url=./xroom.php?s=$s&amp;ci=$ci&amp;id=$id&amp;pass=$pass></a>";

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

if(
$login) {
    if(!empty(
$private)) $pr explode(".",$private);
    
$query_msg = @mysql_query("select * from `".$px.$xtable."` 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'];
if(
$data['post']<)
print 
"У вас недостаточно постов для общения в этой комнате!";
    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 
"./room.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['moder'] && $bold$msg "<b>".$msg."</b>";
    if(
$login['moder'] && $small$msg "<small>".$msg."</small>";
    if(
$login['moder'] && $underline$msg "<u>".$msg."</u>";
    if(
$login['moder'] && $big$msg "<big>".$msg."</big>";
    if(
$login['admin'] && $superbig$msg "<big><big>".$msg."</big></big>";
    if(
$login['admin'] && $blink$msg "<blink>".$msg."</blink>";
    if(
$login && $color$msg "<span style="color:$color;">".$msg."</span>";
    if(
$login && $emotions$msg "$emotions".$msg."";
    include 
"./sm/convert_to_smiles.php";
    if(!empty(
$msg) && $msg!=$prevmsg['msg']) {
if(
$room=="xroom") {
    @
mysql_query("insert into `".$px.$xtable."` values(0,'".$login['login']."','$msg','".$pr[0]."','".$pr[1]."','','','".time()."','$ci');");}
    @
mysql_query("update `".$px.$utable."` set posts='".++$posts."', ltime='".time()."' where id='".$id."' and ci='$ci';"); }
        if(
$room=="xroom") include "./xvict.inc.php";
        if(
$login['fsize'] == "small") { $fsize1 "<small>"$fsize2 "</small>"; }
    elseif(
$login['fsize'] == "big") { $fsize1 "<big>"$fsize2 "</big>"; }
    else { 
$fsize1 ""$fsize2 ""; }

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

@
mysql_close();
$end gettime();
print 
"</div></div><div class="contur_rek"><div class="header_rek">".$fsize1."<a href="./xhistory.php?s=$s&amp;ci=$ci&amp;id=$id&amp;pass=$pass&amp;room=$room&amp;start=$num_msgs&amp;r=$r">".$lang['history']."</a>";
print 
" | <a href="./ignor.php?s=$s&amp;ci=$ci&amp;id=$id&amp;pass=$pass">".$lang['ignor']."</a>";
print 
" | <a href="./enter.php?s=$s&amp;ci=$ci&amp;id=$id&amp;pass=$pass">&#1055;&#1088;&#1080;&#1093;&#1086;&#1078;&#1072;&#1103;</a>";
print 
" | <a href="./cabinet.php?s=$s&amp;ci=$ci&amp;id=$id&amp;id=$id&amp;pass=$pass">Кабинет</a><br/>".$fsize2."</div></div>";

print 
'</div></body></html>';
?>
Онлайн: 1
Реклама