<?php
	require("__include-common.php");
	require("../account/__logincheck.php");

	$con = my_mysql_connect(_DB_SCHEMA);
	$sql = 'select * from v_messages where ADDDATE(c_registtime, INTERVAL '.CHAT_LOG_VIEW_INTERVAL_MIN.' MINUTE) > NOW() order by id_messages asc';
	$rs = my_mysql_query($sql);
	$row = mysql_num_rows($rs);
	if ($row == 0) {
		exit;
	}
	if ($row > CHAT_LOG_VIEW_CNT_MIN) {
		$startline = $row - CHAT_LOG_VIEW_CNT_MIN;
	} else {
		$startline = 0;
	}
?>
	<ul class="index_chat_message_area">
<?php
	$GLOBALS['URL_2_ATAG_SHORT_LEN'] = 20;
	mysql_data_seek($rs, $startline);
	while ($rec=mysql_fetch_array($rs)) {
?>
		<li class="index_chat_message" style="background-color: <?= $rec['c_body_background_color'] ?>";><?= my_htmlspecialchars($rec['c_handle']) ?>：<?= ins_atag_br_short($rec['c_message']) ?>
		</li>
<?php
	}
?>
	</ul>
<?php
	$con = mysql_close($con);
?>
