forked from Madmunus/AntiCombats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
users.php
71 lines (58 loc) · 1.88 KB
/
users.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?
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>