Ivor Barhansky
36bf662112
Upload code Изменил(а) на 'README.md' Изменил(а) на 'README.md' Reviewed-on: https://src.lopar.us/lopar/AntiBK/pulls/1 Co-Authored-By: Ivor Barhansky <lopar@noreply.lopar.us> Co-Committed-By: Ivor Barhansky <lopar@noreply.lopar.us>
72 lines
2.0 KiB
PHP
72 lines
2.0 KiB
PHP
<?
|
|
session_start();
|
|
define('AntiBK', true);
|
|
|
|
include("engline/config.php");
|
|
include("engline/dbsimple/Generic.php");
|
|
include("engline/functions/functions.php");
|
|
|
|
$guid = getGuid();
|
|
|
|
$adb = DbSimple_Generic::connect($database['adb']);
|
|
$adb->query("SET NAMES ? ",$database['db_encoding']);
|
|
$adb->setErrorHandler("databaseErrorHandler");
|
|
|
|
$char = Char::initialization($guid, $adb);
|
|
|
|
$char->test->Guid();
|
|
|
|
$chat_list = $char->getChar('char_db', 'chat_list');
|
|
?>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta http-equiv="Content-Language" content="ru" />
|
|
<link rel="StyleSheet" href="styles/chat.css" type="text/css" />
|
|
<script src="scripts/jquery.js" type="text/javascript"></script>
|
|
<script type="text/javascript">
|
|
try {top.checkGame();} catch(e) {location.href = 'index.php';}
|
|
|
|
var TimerOnline = -1;
|
|
var autorefresh = <?echo $chat_list;?>;
|
|
|
|
function updateUsers ()
|
|
{
|
|
$.post('ajax_chat.php', {'do': 'refreshusers'}, function (data){
|
|
var list = top.exploder(data);
|
|
|
|
if (TimerOnline)
|
|
clearTimeout(TimerOnline);
|
|
|
|
$('#user_list').html(list[0]);
|
|
if (autorefresh)
|
|
TimerOnline = setTimeout (updateUsers, 10000);
|
|
});
|
|
}
|
|
|
|
function changeAutoRefresh ()
|
|
{
|
|
autorefresh = !autorefresh;
|
|
$.post('ajax_chat.php', {'do': 'change_button', 'but': 'list', 'val': autorefresh}, function (data){
|
|
var result = top.exploder(data);
|
|
|
|
if (autorefresh)
|
|
updateUsers();
|
|
else
|
|
clearTimeout(TimerOnline);
|
|
});
|
|
}
|
|
|
|
$(function (){
|
|
updateUsers();
|
|
if (autorefresh)
|
|
$('[name=auto_refresh]').attr('checked', 'checked');
|
|
});
|
|
</script>
|
|
</head>
|
|
<body class="users">
|
|
<br><center><input class="nav" type="button" value="Обновить" onclick="updateUsers();this.blur();"></center>
|
|
<div align="left" id="user_list"></div>
|
|
<input type="checkbox" name="auto_refresh" onclick="changeAutoRefresh();" /> Обновлять автомат.
|
|
</body>
|
|
</html>
|