View file chatservice/room.inc.php

File size: 2.76Kb
<?php
print '<a href="./room.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'&amp;room='.$room.'&amp;r='.$r.'">&#1054;&#1073;&#1085;&#1086;&#1074;&#1080;&#1090;&#1100;</a><br/>'.

'<a href="#say">&#1057;&#1082;&#1072;&#1079;&#1072;&#1090;&#1100;</a><br/>';
$ignor = "";
$qi = @mysql_query("select `user` from `".$px.$itable."` where `loginid`=".$login['id']." and ci= '$ci';");
while($idata = @mysql_fetch_array($qi)) {
$ignor .= "login != '".$idata['user']."', '$ci' AND ";
}

if($room=="vict") {
if($mod=="privat")
$que = @mysql_query("SELECT `login`,`msg`,`time`,`pr_to`,`pr_from` from `".$px.$vtable."` WHERE ".$ignor." (pr_from = '".$login['id']."' OR pr_to = '".$login['id']."') and ci= '$ci' order by id desc limit $num_msgs;");
else
$que = @mysql_query("SELECT `login`,`msg`,`time`,`pr_to`,`pr_from` from `".$px.$vtable."` WHERE ".$ignor." ((pr_to = '' AND pr_from = '') OR (pr_from = '".$login['id']."' OR pr_to = '".$login['id']."')) and ci= '$ci' order by id desc limit $num_msgs;");
} else {
if($mod=="privat")
$que = @mysql_query("SELECT `login`,`msg`,`time`,`pr_to`,`pr_from` from `".$px.$mtable."` WHERE ".$ignor." room = '$room' AND (pr_from = '".$login['id']."' OR pr_to = '".$login['id']."') and ci= '$ci' order by time desc limit $num_msgs;");
else
$que = @mysql_query("SELECT `login`,`msg`,`time`,`pr_to`,`pr_from` from `".$px.$mtable."` WHERE ".$ignor." room = '$room' AND ((pr_to = '' AND pr_from = '') OR (pr_from = '".$login['id']."' OR pr_to = '".$login['id']."')) and ci= '$ci' order by time desc limit $num_msgs;");
}

while($m = @mysql_fetch_array($que)) {
$dblogin = $m['login'];
$dbmsg = $m['msg'];
$dbtime = ($m['time']);
$pr_to = $m['pr_to'];
$pr_from = $m['pr_from'];
$qdblogin = @mysql_query("select `id` from `".$px.$utable."` where `login`='$dblogin' and ci='$ci'");
$db = @mysql_fetch_array($qdblogin);
if(!empty($pr_to)&&!empty($pr_from)) print "<b><a href=\"user.php?ci=$ci&amp;id=$id&amp;pass=$pass&amp;room=$room&amp;dbid=".$db['id']."&amp;r=$r&amp;mod=$mod\">$dblogin</a>[&#1055;&#1088;&#1080;&#1074;&#1072;&#1090;!]</b>\r[".date("H.i",$dbtime)."]&gt;".$dbmsg."<br/>";
else
print "<b><a href=\"./user.php?ci=$ci&amp;id=$id&amp;pass=$pass&amp;room=$room&amp;dbid=".$db['id']."&amp;r=$r\">$dblogin</a></b>\r[".date("H.i",$dbtime)."]&gt;".$dbmsg."<br/>";
}
if($mod=="privat")
print "<a href=\"./history.php?ci=$ci&amp;id=$id&amp;pass=$pass&amp;room=$room&amp;start=$num_msgs&amp;&amp;mod=$mod&amp;r=$r\">&#1048;&#1089;&#1090;&#1086;&#1088;&#1080;&#1103;</a>";
else
print "<a href=\"./history.php?ci=$ci&amp;id=$id&amp;pass=$pass&amp;room=$room&amp;start=$num_msgs&amp;r=$r\">".$lang['history']."</a>";
print "<br/><a href=\"./enter.php?ci=$ci&amp;id=$id&amp;pass=$pass\">&#1055;&#1088;&#1080;&#1093;&#1086;&#1078;&#1072;&#1103;</a><br/>";
?>