File size: 2.6Kb
<?php
//////////////////////////////////////////
// CHAT POWERED : http://sim-sim.h2m.ru//
// ICQ : 378036650 //
// Email : olegarhi75@mail.ru //
// WEB SITE Version 1.0 www.waufon.ru //
////////////////////////////////////////
require( "inc/conf.inc.php" );
require( "inc/check.php" );
$rm = intval( $rm );
if ( $rm < 0 || 10 < $rm || !isset( $rm ) )
{
$rm = 10;
}
$room = "room".$rm;
$qsetts = @mysql_query( @"select `name` from `setts` where var='".$rm."';" );
$setts = @mysql_fetch_array( @$qsetts );
$title = $setts['name'];
$max = $row['num_msgs'];
if ( empty( $max ) )
{
$max = 5;
}
$pwd = $row['pwd'];
echo "<title>Архив</title>";
echo "<style type=\"text/css\">";
echo "body { font-size: {$fs}; color: {$tcol}; background-color: {$bcol} }";
echo "a:link,a:visited { text-decoration: underline; color: {$lcol} }";
echo "div { border-style:solid; border-width: 1px; background-color: {$rcol} }";
echo "</style>";
echo "</head>";
echo "<body>";
echo "<div align=\"center\">{$title}</div>";
echo "<a href=\"room.php?id={$id}&pass={$pass}&rm={$rm}&ref={$ref}\">Обновить</a>";
echo "<br/><div>";
$s = intval( $s );
if ( $s < 0 )
{
$s = 0;
}
if ( $rm == 10 )
{
$res = mysql_query( "select * from intim where pwd='{$pwd}' AND (id_to='0' OR id_to='{$id}' OR id_from='{$id}') order by id desc limit {$s},{$max}" );
}
else
{
$res = mysql_query( "select * from mess where (room='{$room}' OR room = 'all') AND (id_to='0' OR id_to='{$id}' OR id_from='{$id}') order by id desc limit {$s},{$max}" );
}
$i = mysql_num_rows( $res );
while ( $data = @mysql_fetch_array( @$res ) )
{
$dblogin = $data['login'];
$dbid = $data['id_from'];
$dbmsg = $data['msg'];
$dbtime = date( "H:i", $data['wtime'] );
$id_to = $data['id_to'];
if ( $id_to == 0 )
{
echo "<b><a href=\"say.php?id={$id}&pass={$pass}&rm={$rm}&dbid={$dbid}&ref={$ref}\">{$dblogin}</a></b> [{$dbtime}]>{$dbmsg}<br/>\n";
}
else
{
echo "<b><a href=\"say.php?id={$id}&pass={$pass}&rm={$rm}&dbid={$dbid}&ref={$ref}\">{$dblogin}</a>[!]</b> [{$dbtime}]>{$dbmsg}<br/>\n";
}
}
print "</div>";
if ( $max <= $i )
{
print "<br/><a href=\"history.php?id={$id}&pass={$pass}&rm={$rm}&s=".( $s + $max )."\">Next»</a>";
}
print "<br/><a href=\"enter.php?id={$id}&pass={$pass}\">Прихожая</a><br/>";
$end = gettime( );
echo "<p align=\"center\">\r\n[".round( $end - $mystart, 5 )."]";
print "</p></body></html>";
mysql_close( $link );
echo "\r\n";
?>