Запустился чат.

This commit is contained in:
Ivor Barhansky 2023-02-13 19:24:48 +02:00
parent 656e3549eb
commit d9bf4b0bdc
3 changed files with 655 additions and 651 deletions

View File

@ -40,8 +40,9 @@ if (isset($_GET['showcode'])) {
if ($u->info['joinIP'] == 1 && $u->info['ip'] != IP) { if ($u->info['joinIP'] == 1 && $u->info['ip'] != IP) {
er('#Пожалуйста авторизируйтесь с главной страницы'); er('#Пожалуйста авторизируйтесь с главной страницы');
} elseif (isset($_GET['exit'])) { } elseif (isset($_GET['exit'])) {
setcookie('login', '', time() - 60 * 60 * 24 * 30, '', Config::get('host')); setcookie('login', '', 0, '', Config::get('host'));
setcookie('login', '', time() - 60 * 60 * 24 * 30); setcookie('login', '', 0);
setcookie('auth', '', 0);
Db::sql('update users set online = unix_timestamp() - 420 where id = ?', [$u->info['id']]); Db::sql('update users set online = unix_timestamp() - 420 where id = ?', [$u->info['id']]);
die(Config::get('exit')); die(Config::get('exit'));
} elseif (!isset($u->info['id'])) { } elseif (!isset($u->info['id'])) {
@ -63,13 +64,13 @@ $u->stats = $u->getStats($u->info['id'], 0);
<meta name="description" content="<?= Config::get('desc') ?>"/> <meta name="description" content="<?= Config::get('desc') ?>"/>
<meta name="keywords" content="<?= Config::get('keys') ?>"/> <meta name="keywords" content="<?= Config::get('keys') ?>"/>
<meta name="msapplication-config" content="browserconfig.xml"/> <meta name="msapplication-config" content="browserconfig.xml"/>
<link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="i/main.css">
<link rel="stylesheet" href="css/clu0b.css"/> <link rel="stylesheet" href="css/clu0b.css"/>
<link rel="stylesheet" href="css/windows.css"/> <link rel="stylesheet" href="css/windows.css"/>
<link rel="stylesheet" href="css/hack.css"/> <link rel="stylesheet" href="css/hack.css"/>
<script> <script>
let des = 1; const des = 1;
let c = { const c = {
noEr: 0, noEr: 0,
noErTmr: 0, noErTmr: 0,
url: '<?= Config::get('host') ?>', url: '<?= Config::get('host') ?>',
@ -93,14 +94,14 @@ $u->stats = $u->getStats($u->info['id'], 0);
enterUse = 0; enterUse = 0;
function ctest(city) { function ctest(city) {
if (city !== c['city']) { if (city != c['city']) {
top.location = '/bk'; top.location = '/bk';
} }
} }
function testKey(event) { function testKey(event) {
if (event.keyCode === 10 || event.keyCode === 13) { if (event.keyCode == 10 || event.keyCode == 13) {
if (top.enterUse === 0) { if (top.enterUse == 0) {
chat.subSend(); chat.subSend();
top.enterUse = 1; top.enterUse = 1;
setTimeout('top.enterUse = 0', 1000); setTimeout('top.enterUse = 0', 1000);
@ -153,9 +154,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
$deviceType = $_COOKIE['d1c']; $deviceType = $_COOKIE['d1c'];
} }
if ($deviceType == 'tablet' || $deviceType == 'phone') { if ($deviceType == 'tablet' || $deviceType == 'phone'): ?>
echo '<script type="text/javascript" src="js/jquery.nicescroll.js"></script>';
?>
<style> <style>
#touchmain { #touchmain {
padding: 0; padding: 0;
@ -164,17 +163,15 @@ $u->stats = $u->getStats($u->info['id'], 0);
margin: 0; margin: 0;
} }
</style> </style>
<script type="text/javascript" src="js/jquery.nicescroll.js"></script>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$("#touchmain").niceScroll("#main", {autohidemode: false, boxzoom: false}); $("#touchmain").niceScroll("#main", {autohidemode: false, boxzoom: false});
}); });
</script> </script>
<?php <?php endif; ?>
}
?>
<link href="./js/trainingModals/registration/trainingModalStyles.css" rel="stylesheet" type="text/css"/> <link href="./js/trainingModals/registration/trainingModalStyles.css" rel="stylesheet" >
<style> <style>
/* Additional classes examples */ /* Additional classes examples */
@ -556,19 +553,18 @@ $u->stats = $u->getStats($u->info['id'], 0);
right: 18px; right: 18px;
} }
</style> </style>
<script>
function chatHello() {
chat.sendMsg(["new", "<?=time()?>", "1", "", "<?=$u->info['login']?>", "global:<b style='background-color:#ffcccc'>&nbsp; Приветствуем в игре, не забываем поздороваться и прочесть новости проекта! <a href='https://new-combats.com/n' target='_blank'>читать новости</a> &nbsp;</b>", "red", "1", "1", "0"]);
}
</script>
</head> </head>
<body onLoad="bodyLoaded();chatHello();"> <body>
<div style="display:none" class="qel0" id="qel0"></div> <div style="display:none" class="qel0" id="qel0"></div>
<noscript>В вашем браузере отсутствует поддержка <strong>javascript<strong></noscript> <noscript>В вашем браузере отсутствует поддержка <strong>javascript<strong></noscript>
<script> <script>
if (window.top !== window.self) { window.onLoad(){
bodyLoaded();
chat.sendMsg(["new", "<?=time()?>", "1", "", "<?=$u->info['login']?>", "global:<b style='background-color:#ffcccc'>&nbsp; Приветствуем в игре, не забываем поздороваться и прочесть новости проекта! <a href='https://new-combats.com/n' target='_blank'>читать новости</a> &nbsp;</b>", "red", "1", "1", "0"]);
}
if (window.top != window.self) {
document.write = ""; document.write = "";
window.top.location = window.self.location; window.top.location = window.self.location;
setTimeout(function () { setTimeout(function () {
@ -595,7 +591,6 @@ $u->stats = $u->getStats($u->info['id'], 0);
?> ?>
<script> <script>
function startRegistration() { function startRegistration() {
//if( goodread >= 9 ) {
$.post('reg.php', { $.post('reg.php', {
'ajax_reg': true, 'ajax_reg': true,
'reg_login': $('#reg_login').val(), 'reg_login': $('#reg_login').val(),
@ -615,7 +610,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
cc('#regblock'); cc('#regblock');
</script> </script>
<?php <?php
} elseif ($u->info['active'] != '' && $u->info['mail'] == 'No E-mail') { } elseif (!empty($u->info['active']) && $u->info['mail'] == 'No E-mail') {
if (!empty($error)) { if (!empty($error)) {
echo '<script>alert("' . $error . '");</script>'; echo '<script>alert("' . $error . '");</script>';
} }
@ -625,7 +620,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
} }
?> ?>
<script> <script>
let lasts = [-1, -1]; var lasts = [-1, -1];
function myexpLineTop27(e1, e2) { function myexpLineTop27(e1, e2) {
$('#exp23mkrtkm').attr('title', "Опыт персонажа" + "\n" + e1 + " / " + e2); $('#exp23mkrtkm').attr('title', "Опыт персонажа" + "\n" + e1 + " / " + e2);
@ -636,7 +631,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
if (lasts[1] < e2) { if (lasts[1] < e2) {
$('#myexplin233').css('width', '1%'); $('#myexplin233').css('width', '1%');
} }
if (lasts[0] !== e1 || lasts[1] !== e2) { if (lasts[0] != e1 || lasts[1] != e2) {
$('#myexplin233').animate({'width': Math.ceil(e1 / e2 * 100) + '%'}, 3000); $('#myexplin233').animate({'width': Math.ceil(e1 / e2 * 100) + '%'}, 3000);
} }
} }
@ -647,7 +642,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
let smlk1 = 0; let smlk1 = 0;
function smiles1load() { function smiles1load() {
if (smlk1 === 0) { if (smlk1 == 0) {
$('#btnsmlrz').html('<small>&nbsp; Общие смайлики &nbsp;</small>'); $('#btnsmlrz').html('<small>&nbsp; Общие смайлики &nbsp;</small>');
smlk1 = 1; smlk1 = 1;
$('#smilesDiv').hide(); $('#smilesDiv').hide();
@ -771,17 +766,17 @@ $u->stats = $u->getStats($u->info['id'], 0);
<td style="font-size:10px; text-align: center; vertical-align: top; background-image: url('https://img.new-combats.com/i/lite/top_lite_low_15.gif')"> <td style="font-size:10px; text-align: center; vertical-align: top; background-image: url('https://img.new-combats.com/i/lite/top_lite_low_15.gif')">
<span style="display:none; text-align:center;" id="menu1"> <span style="display:none; text-align:center;" id="menu1">
<a href="/main.php?referals" target="main" class="menutop" style="color:green">Реферал</a> | <a href="/main.php?referals" target="main" class="menutop" style="color:green">Реферал</a> |
<a href="https://new-combats.com/forum/" target="_blank" class="menutop">Форум</a> | <a href="/forum/" target="_blank" class="menutop">Форум</a> |
<a href="https://new-combats.com/encicl/law.html" target="_blank" class="menutop" style="color: red">Законы</a> | <a href="/encicl/law.html" target="_blank" class="menutop" style="color: red">Законы</a> |
<a href="https://new-combats.com/rating_pers" target="_blank" class="menutop">Рейтинг</a> | <a href="/rating_pers" target="_blank" class="menutop">Рейтинг</a> |
<a href="https://new-combats.com/rating_clans" target="_blank" class="menutop">Кланы</a> | <a href="/rating_clans" target="_blank" class="menutop">Кланы</a> |
<a href="main.php?security" target="main" class="menutop" style="color:green">Безопасность</a> | <a href="/main.php?security" target="main" class="menutop" style="color:green">Безопасность</a> |
<a href="https://new-combats.com/news_script/lib/pisheri.html" target="_blank" class="menutop" style="color: darkgreen">Всё о пещерах</a> <a href="/news_script/lib/pisheri.html" target="_blank" class="menutop" style="color: darkgreen">Всё о пещерах</a>
</span> </span>
<span style="display:; text-align:center;" id="menu2"> <span style="display:; text-align:center;" id="menu2">
<a href="/main.php?inv=1&rn=<?= $code ?>" target="main" class="menutop">Инвентарь</a> | <a href="/main.php?inv=1&rn=<?= $code ?>" target="main" class="menutop">Инвентарь</a> |
<span style="display:; text-align:center;" id="menu2"> <span style="display:; text-align:center;" id="menu2">
<a href="main.php?titul" target="main" class="menutop" style="color:green"> Достижения</a> | <a href="/main.php?titul" target="main" class="menutop" style="color:green"> Достижения</a> |
<a href="/main.php?skills=1&side=5" target="main" class="menutop">Умения</a> | <a href="/main.php?skills=1&side=5" target="main" class="menutop">Умения</a> |
<a href="/main.php?zayvka=1" target="main" class="menutop">Поединки</a> | <a href="/main.php?zayvka=1" target="main" class="menutop">Поединки</a> |
<a href="/forum/?read=10957&rnd=1" target="_blank" class="menutop" style="color:red">Всем игрокам</a> | <a href="/forum/?read=10957&rnd=1" target="_blank" class="menutop" style="color:red">Всем игрокам</a> |
@ -855,7 +850,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
<div id="smilesDiv">Загрузка смайликов</div> <div id="smilesDiv">Загрузка смайликов</div>
<div id="smilesDiv2" style="display:none"> <div id="smilesDiv2" style="display:none">
<?php <?php
echo '<center><small>Новые смайлики возможно купить в <a href="/ekr.php" target="_blank">Коммерческом Отделе</a><br>Обновите страницу, если купленный смайлик не отобразился</small></center><hr>'; echo '<small>Новые смайлики возможно купить в <a href="/ekr.php" target="_blank">Коммерческом Отделе</a><br>Обновите страницу, если купленный смайлик не отобразился</small><hr>';
// //
if (empty($u->info['add_smiles'])) { ?> if (empty($u->info['add_smiles'])) { ?>
<div style="text-align: center; color: grey;">У вас нет личных смайликов</div> <div style="text-align: center; color: grey;">У вас нет личных смайликов</div>
@ -891,6 +886,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
</div> </div>
</td> </td>
<td style="border-left:2px solid #CCCCCC;border-top:1px solid #808080; background-color: #faf2f2; vertical-align: top; width: 350px;" id="online"> <td style="border-left:2px solid #CCCCCC;border-top:1px solid #808080; background-color: #faf2f2; vertical-align: top; width: 350px;" id="online">
<div id="online_list" style="cursor:default;"> <div id="online_list" style="cursor:default;">
<div style="margin-top:5px; text-align: center;"> <div style="margin-top:5px; text-align: center;">
<button class="btn" id="robtn" onClick="chat.reflesh()">Обновить</button> <button class="btn" id="robtn" onClick="chat.reflesh()">Обновить</button>
@ -900,16 +896,20 @@ $u->stats = $u->getStats($u->info['id'], 0);
<img src="https://img.new-combats.com/i/fighttype0.gif" width="20" height="20" alt="fight type"> <img src="https://img.new-combats.com/i/fighttype0.gif" width="20" height="20" alt="fight type">
</button> </button>
</div> </div>
<span class="db" style="padding:0 0 8px 0;font-size: 10pt; color:#8f0000;"> <span class="db" style="padding:0 0 8px 0;font-size: 10pt; color:#8f0000;"><b id="roomName"></b></span>
<b id="roomName"></b></span>
<div id="onlist"></div> <div id="onlist"></div>
<div style="padding:5px;margin-top:5px;"> <div style="padding:5px;margin-top:5px;">
<div><label><input type="checkbox" value="1" checked id="autoRefOnline">Обновлять <div>
автомат.</label></div> <input type="checkbox" value="1" checked id="autoRefOnline">
<div><label><input name="chcf10" type="checkbox" id="chcf10" checked value="0">Показать <label for="autoRefOnline">Обновлять автомат.</label>
всех игроков</label></div> </div>
<div>
<input name="chcf10" type="checkbox" id="chcf10" checked value="0">
<label for="chcf10">Показать всех игроков</label>
</div> </div>
</div> </div>
</div>
</td> </td>
</tr> </tr>
</table> </table>
@ -1238,4 +1238,3 @@ $u->stats = $u->getStats($u->info['id'], 0);
</body> </body>
</html> </html>
<?php

View File

@ -14,10 +14,10 @@ $(document).ready(function () {
function bodyLoaded() { function bodyLoaded() {
top.recounter(); top.recounter();
//генерируем смайлики //генерируем смайлики
var i = 0, let i = 0,
j = ''; j = '';
while (i != -1) { while (i !== -1) {
if (top.sml[i] != undefined) { if (top.sml[i] !== undefined) {
j += `<img style="cursor:pointer" onclick="chat.addSmile(\'${top.sml[i]}\')" src="https://${c['img']}/i/smile/${top.sml[i]}.gif" width="${top.sml[i + 1]}" height="${top.sml[i + 2]}" title=":${top.sml[i]}:"/> `; j += `<img style="cursor:pointer" onclick="chat.addSmile(\'${top.sml[i]}\')" src="https://${c['img']}/i/smile/${top.sml[i]}.gif" width="${top.sml[i + 1]}" height="${top.sml[i + 2]}" title=":${top.sml[i]}:"/> `;
} else i = -4; } else i = -4;
i += 3; i += 3;
@ -29,54 +29,60 @@ function bodyLoaded() {
function startEngine() { function startEngine() {
//стандартные настройки //стандартные настройки
if ($.cookie('chatCfg0') === undefined) { if ($.cookie('chatCfg0') === undefined) {
$.cookie('chatCfg0',2,{expires:320}); $.cookie('chatCfg0', 2, {expires: 320});
$.cookie('chatCfg1','Black',{expires:320}); $.cookie('chatCfg1', 'Black', {expires: 320});
} }
$('#reline1').mousedown(function () { $('#reline1').mousedown(function () {
start_NRESize({ start_NRESize({
generalArgs: { cssName: 'reline1', whatSee: 'height', whereTo: 'top' }, generalArgs: {cssName: 'reline1', whatSee: 'height', whereTo: 'top'},
nowArgs: { clientAxis: 'clientY', axisCount: 31 }, nowArgs: {clientAxis: 'clientY', axisCount: 31},
stopArgs: { jCount: 35, cssNameExt: 'chat' }, stopArgs: {jCount: 35, cssNameExt: 'chat'},
stopTrue: true stopTrue: true
}) })
}); });
$('#reline2').mousedown(function () { $('#reline2').mousedown(function () {
start_NRESize({ start_NRESize({
generalArgs: { cssName: 'reline2', whatSee: 'width', whereTo: 'left' }, generalArgs: {cssName: 'reline2', whatSee: 'width', whereTo: 'left'},
nowArgs: { clientAxis: 'clientX', axisCount: 40 }, nowArgs: {clientAxis: 'clientX', axisCount: 40},
stopArgs: { jCount: 18, cssNameExt: 'online' }, stopArgs: {jCount: 18, cssNameExt: 'online'},
stopTrue: true stopTrue: true
}) })
}); });
$(window).resize(function(){resizeFinish()}); $(window).resize(function () {
resizeFinish()
});
resizeFinish(); resizeFinish();
//Добавляем действия //Добавляем действия
var i = 0; var i = 0;
while (i != -1) { while (i != -1) {
if ($(`#chcf${i}`).attr('id') != undefined) { if ($(`#chcf${i}`).attr('id') != undefined) {
$(`#chcf${i}`).change(function(){saveChatConfig();if(this.id=='chcf10'){chat.reflesh()}}); $(`#chcf${i}`).change(function () {
saveChatConfig();
if (this.id == 'chcf10') {
chat.reflesh()
}
});
if (i > 1) { if (i > 1) {
if ($.cookie(`chatCfg${i}`) == 1) { if ($.cookie(`chatCfg${i}`) == 1) {
$('#chcf'+i).attr('checked',true); $('#chcf' + i).attr('checked', true);
if (i == 11) chat.globalMsg = 1; if (i == 11) chat.globalMsg = 1;
} } else if ($.cookie(`chatCfg${i}`) == 0) {
else if ($.cookie(`chatCfg${i}`) == 0) {
$(`#chcf${i}`).attr('checked', false); $(`#chcf${i}`).attr('checked', false);
} }
} }
}else i = -2; } else i = -2;
i++; i++;
} }
//загрузка сохраненных настроек //загрузка сохраненных настроек
if ($('#chcf0').val().length >= 1) { if ($('#chcf0').val().length >= 1) {
srcv = $.cookie('chatCfg0'); srcv = $.cookie('chatCfg0');
$('#chcf0 option:selected').each(function(id){ $('#chcf0 option:selected').each(function (id) {
$(this).removeAttr('selected'); $(this).removeAttr('selected');
}); });
$('#chcf0 option').each(function(){ $('#chcf0 option').each(function () {
if ($(this).val().indexOf(srcv) > -1) { if ($(this).val().indexOf(srcv) > -1) {
$(this).attr('selected','yes'); $(this).attr('selected', 'yes');
} }
}); });
} }
@ -85,9 +91,9 @@ function startEngine() {
$('#chcf8 option:selected').each(function (id) { $('#chcf8 option:selected').each(function (id) {
$(this).removeAttr('selected'); $(this).removeAttr('selected');
}); });
$('#chcf8 option').each(function(){ $('#chcf8 option').each(function () {
if ($(this).val().indexOf(srcv) > -1) { if ($(this).val().indexOf(srcv) > -1) {
$(this).attr('selected','yes'); $(this).attr('selected', 'yes');
} }
}); });
} }
@ -121,7 +127,8 @@ function saveChatConfig() {
return saveChatConfig_work(chat, 0, 'none') return saveChatConfig_work(chat, 0, 'none')
} }
function saveChatConfig_work (chatObj, count, display) {
function saveChatConfig_work(chatObj, count, display) {
$('#globalMode').css({'display': display}); $('#globalMode').css({'display': display});
chatObj.globalMsg = count; chatObj.globalMsg = count;
chatObj.genchatData(null); chatObj.genchatData(null);
@ -133,13 +140,13 @@ function unpx(v) {
} }
// GENERAL // GENERAL
function start_NRESize (objArgs) { function start_NRESize(objArgs) {
var { generalArgs, nowArgs, stopArgs, stopTrue } = objArgs var {generalArgs, nowArgs, stopArgs, stopTrue} = objArgs
var { cssName, whatSee, whereTo } = generalArgs var {cssName, whatSee, whereTo} = generalArgs
var { clientAxis, axisCount } = nowArgs var {clientAxis, axisCount} = nowArgs
var { jCount, cssNameExt } = stopArgs var {jCount, cssNameExt} = stopArgs
$(cssName).css({'z-index': 1003}); // reline2 или 1 $(cssName).css({'z-index': 1003}); // reline2 или 1
$('#upbox').css({'display': 'block'}); $('#upbox').css({'display': 'block'});
@ -172,12 +179,12 @@ function start_NRESize (objArgs) {
} }
// GENERAL 2 // GENERAL 2
function now_NRESize (objArgs) { function now_NRESize(objArgs) {
// 1: 'clientY', 31, 'heigth', '#reline1', 'top' // 1: 'clientY', 31, 'heigth', '#reline1', 'top'
// 2: 'clientX', 40, 'width', '#reline2', 'left' // 2: 'clientX', 40, 'width', '#reline2', 'left'
var { element, clientAxis, axisCount, whatSee, cssName, whereTo } = objArgs var {element, clientAxis, axisCount, whatSee, cssName, whereTo} = objArgs
if (element[clientAxis] > axisCount && element[clientAxis] < $(window)[whatSee]() - 40) { if (element[clientAxis] > axisCount && element[clientAxis] < $(window)[whatSee]() - 40) {
$(`#${cssName}`).css({ $(`#${cssName}`).css({
@ -187,15 +194,15 @@ function now_NRESize (objArgs) {
} }
// GENERAL 3 // GENERAL 3
function stop_NRESize (objArgs) { function stop_NRESize(objArgs) {
// 1: 35, 'chat', 'heigth', 'reline1', 'top' // 1: 35, 'chat', 'heigth', 'reline1', 'top'
// 2: 18, 'online', 'width', 'reline2', 'left' // 2: 18, 'online', 'width', 'reline2', 'left'
var { jCount, cssNameExt, whatSee, cssName, whereTo } = objArgs var {jCount, cssNameExt, whatSee, cssName, whereTo} = objArgs
j = jCount; j = jCount;
if($.browser.msie==true) j += 2; if ($.browser.msie == true) j += 2;
$(`#${cssNameExt}`).css({ $(`#${cssNameExt}`).css({
[whatSee]: Math.round(($(window)[whatSee]() - unpx($(`#${cssName}`).css(whereTo)) - j) / $(window)[whatSee]() * 100) + '%' [whatSee]: Math.round(($(window)[whatSee]() - unpx($(`#${cssName}`).css(whereTo)) - j) / $(window)[whatSee]() * 100) + '%'
@ -204,12 +211,12 @@ function stop_NRESize (objArgs) {
} }
// GENERAL 4 // GENERAL 4
function stop2_NRESize (objArgs) { function stop2_NRESize(objArgs) {
// 1: true, 'resize1', 'reline1' // 1: true, 'resize1', 'reline1'
// 2: false, 'resize2', 'resize2' // 2: false, 'resize2', 'resize2'
var { stopTrue, cssName } = objArgs var {stopTrue, cssName} = objArgs
$('#upbox').css({'display': 'none'}); $('#upbox').css({'display': 'none'});
@ -231,24 +238,35 @@ function stop2_NRESize (objArgs) {
function resizeFinish() { function resizeFinish() {
j = 30; i = 3; j = 30;
i = 3;
if ($.browser.msie == true) { if ($.browser.msie == true) {
j += 1; j += 1;
i += 2; i += 2;
} }
$('#main').css({'width':'20px','height':'20px'}); $('#main').css({'width': '20px', 'height': '20px'});
$('#touchmain').css({'width':'20px','height':'20px'}); $('#touchmain').css({'width': '20px', 'height': '20px'});
$('#chat_list').css({'width':'20px','height':'20px'}); $('#chat_list').css({'width': '20px', 'height': '20px'});
$('#online_list').css({'width':'20px','height':'20px'}); $('#online_list').css({'width': '20px', 'height': '20px'});
$('#chat_list').css({'width':($('#chat').width()-$('#online').width()-4),'height':$('#online').height()}); $('#chat_list').css({'width': ($('#chat').width() - $('#online').width() - 4), 'height': $('#online').height()});
$('#online_list').css({'width':$('#online').width()-5,'height':$('#online').height()}); $('#online_list').css({'width': $('#online').width() - 5, 'height': $('#online').height()});
$('#main').css({'height':($(window).height()-j-$('#chat_block').height()-42),'width':($(window).width()-19)}); $('#main').css({
$('#touchmain').css({'height':($(window).height()-j-$('#chat_block').height()-42),'width':($(window).width()-19)}); 'height': ($(window).height() - j - $('#chat_block').height() - 42),
$('#reline1').css({'top':($(window).height()-j-$('#chat').height()-6)+'px'}); 'width': ($(window).width() - 19)
$('#reline2').css({'left':($(window).width()-i-$('#online').width()-9)+'px','height':($('#chat').height())+'px','top':($('#main_td').height()+j+2)+'px'}); });
$('#touchmain').css({
'height': ($(window).height() - j - $('#chat_block').height() - 42),
'width': ($(window).width() - 19)
});
$('#reline1').css({'top': ($(window).height() - j - $('#chat').height() - 6) + 'px'});
$('#reline2').css({
'left': ($(window).width() - i - $('#online').width() - 9) + 'px',
'height': ($('#chat').height()) + 'px',
'top': ($('#main_td').height() + j + 2) + 'px'
});
} }
function showtable(id) { function showtable(id) {
@ -257,15 +275,18 @@ function showtable(id) {
document.getElementById(`menu${id}`).style.display = ''; document.getElementById(`menu${id}`).style.display = '';
} }
function hidemenu (time) { function hidemenu(time) {
for (var i=1;i<=2;i++) { for (var i = 1; i <= 2; i++) {
document.getElementById(`menu${i}`).style.display = 'none'; document.getElementById(`menu${i}`).style.display = 'none';
} }
} }
function hidesel (id) { function hidesel(id) {
for (var i=1;i<=2;i++) { for (var i = 1; i <= 2; i++) {
if (i!=id) {document.getElementById(`el${i}`).style.backgroundColor='';document.getElementById(`el${i}`).style.color='';} if (i != id) {
document.getElementById(`el${i}`).style.backgroundColor = '';
document.getElementById(`el${i}`).style.color = '';
}
} }
} }
@ -281,6 +302,7 @@ function chconf() {
} }
var doTest; var doTest;
function MBcMenu() { function MBcMenu() {
T_cm = setTimeout("if(doTest){ top.infoMenuClose(1); clearTimeout(T_cm);}", 100); T_cm = setTimeout("if(doTest){ top.infoMenuClose(1); clearTimeout(T_cm);}", 100);
} }
@ -321,8 +343,7 @@ function mousePageXY(e) {
}; };
} }
function infoMenu(u,e,f) function infoMenu(u, e, f) {
{
if (!e) e = window.event; if (!e) e = window.event;
var d = top.document.getElementById('persmenu'); var d = top.document.getElementById('persmenu');
var d2 = top.document.getElementById('upbox'); var d2 = top.document.getElementById('upbox');
@ -337,13 +358,13 @@ function infoMenu(u,e,f)
d2.style.display = ''; d2.style.display = '';
d.className = 'topusermenu'; d.className = 'topusermenu';
s.display = ''; s.display = '';
var obtop = mousePageXY(e)['y']+dptop; var obtop = mousePageXY(e)['y'] + dptop;
if (getNameBrouser() == 'msie') { if (getNameBrouser() == 'msie') {
obtop -= dp.document.body.scrollTop; obtop -= dp.document.body.scrollTop;
} else { } else {
obtop -= dp.document.documentElement.scrollTop + dp.document.body.scrollTop; obtop -= dp.document.documentElement.scrollTop + dp.document.body.scrollTop;
} }
var obleft = mousePageXY(e)['x']+dpleft; var obleft = mousePageXY(e)['x'] + dpleft;
d.style.top = `${obtop}px`; d.style.top = `${obtop}px`;
d.style.left = `${obleft}px`; d.style.left = `${obleft}px`;
var hmmmt = `<DIV onmouseover="top.doTest = false;" onmouseout="top.doTest = true; top.MBcMenu();"> var hmmmt = `<DIV onmouseover="top.doTest = false;" onmouseout="top.doTest = true; top.MBcMenu();">
@ -352,9 +373,9 @@ function infoMenu(u,e,f)
<div onClick="window.open(\'inf.php?login=${u}\'); infoMenuClose(4);" class="topusermenuBtn">INFO</div> <div onClick="window.open(\'inf.php?login=${u}\'); infoMenuClose(4);" class="topusermenuBtn">INFO</div>
<div onClick="top.infoMenuClose(4);" class="topusermenuBtn"><div id="d_clip_button">COPY</div></div>`; <div onClick="top.infoMenuClose(4);" class="topusermenuBtn"><div id="d_clip_button">COPY</div></div>`;
if( top.iusrno[u] == undefined || top.iusrno[u] == 0 ) { if (top.iusrno[u] == undefined || top.iusrno[u] == 0) {
hmmmt = `${hmmmt}<div onClick="top.ignoreUser(\'${u}\'); infoMenuClose(4);" class="topusermenuBtn">IGNORE</div>`; hmmmt = `${hmmmt}<div onClick="top.ignoreUser(\'${u}\'); infoMenuClose(4);" class="topusermenuBtn">IGNORE</div>`;
}else{ } else {
hmmmt = `${hmmmt}<div onClick="top.ignoreUser(\'${u}\'); infoMenuClose(4);" class="topusermenuBtn">- IGNORE</div>`; hmmmt = `${hmmmt}<div onClick="top.ignoreUser(\'${u}\'); infoMenuClose(4);" class="topusermenuBtn">- IGNORE</div>`;
} }
hmmmt = `${hmmmt}</DIV>`; hmmmt = `${hmmmt}</DIV>`;
@ -364,8 +385,8 @@ function infoMenu(u,e,f)
var bdy = document.body.clientHeight; var bdy = document.body.clientHeight;
var obx = d.clientWidth; var obx = d.clientWidth;
var oby = d.clientHeight; var oby = d.clientHeight;
var ots = bdy-obtop-oby; var ots = bdy - obtop - oby;
var ols = bdx-obleft-obx; var ols = bdx - obleft - obx;
if (ots < 10) { if (ots < 10) {
obtop = bdy - 10 - oby; obtop = bdy - 10 - oby;
d.style.top = `${obtop}px`; d.style.top = `${obtop}px`;
@ -376,21 +397,20 @@ function infoMenu(u,e,f)
} }
$("#d_clip_button").zclip({ $("#d_clip_button").zclip({
path: "js/ZeroClipboard.swf", path: "js/ZeroClipboard.swf",
copy: function(){ copy: function () {
return u; return u;
} }
}); });
} }
} }
function infoMenuClose(id) function infoMenuClose(id) {
{
var d = top.document.getElementById('persmenu'); var d = top.document.getElementById('persmenu');
var d2 = top.document.getElementById('upbox'); var d2 = top.document.getElementById('upbox');
if (d != undefined) { if (d != undefined) {
if (id > 0 && id < 5) { if (id > 0 && id < 5) {
d.className = `topusermenu inviseMen${id}`; d.className = `topusermenu inviseMen${id}`;
T_mn = setTimeout(`top.infoMenuClose(${(id+1)})`,30); T_mn = setTimeout(`top.infoMenuClose(${(id + 1)})`, 30);
} else if (id == 5) { } else if (id == 5) {
var s = d.style; var s = d.style;
s.display = 'none'; s.display = 'none';
@ -415,22 +435,22 @@ function infoMenuMy(u, e, f, dtm) {
d2.style.display = ''; d2.style.display = '';
d.className = 'topusermenu'; d.className = 'topusermenu';
s.display = ''; s.display = '';
var obtop = mousePageXY(e)['y']+dptop; var obtop = mousePageXY(e)['y'] + dptop;
if (getNameBrouser() == 'msie') { if (getNameBrouser() == 'msie') {
obtop -= dp.document.body.scrollTop; obtop -= dp.document.body.scrollTop;
} else { } else {
obtop -= dp.document.documentElement.scrollTop + dp.document.body.scrollTop; obtop -= dp.document.documentElement.scrollTop + dp.document.body.scrollTop;
} }
var obleft = mousePageXY(e)['x']+dpleft; var obleft = mousePageXY(e)['x'] + dpleft;
d.style.top = `${obtop}px`; d.style.top = `${obtop}px`;
d.style.left = `${obleft}px`; d.style.left = `${obleft}px`;
var hmmmt = '<DIV onmouseover="top.doTest = false;" onmouseout="top.doTest = true; top.MBcMenu();">'; var hmmmt = '<DIV onmouseover="top.doTest = false;" onmouseout="top.doTest = true; top.MBcMenu();">';
var i = 0; var i = 0;
while( i != -1 ) { while (i != -1) {
if(dtm[i] != undefined) { if (dtm[i] != undefined) {
hmmmt += `<div onClick="${dtm[i][0]} infoMenuClose(4);" class="topusermenuBtn">${dtm[i][1]}</div>`; hmmmt += `<div onClick="${dtm[i][0]} infoMenuClose(4);" class="topusermenuBtn">${dtm[i][1]}</div>`;
i++; i++;
}else i = -1; } else i = -1;
} }
hmmmt = `${hmmmt}</DIV>`; hmmmt = `${hmmmt}</DIV>`;
d.innerHTML = hmmmt; d.innerHTML = hmmmt;
@ -439,8 +459,8 @@ function infoMenuMy(u, e, f, dtm) {
var bdy = document.body.clientHeight; var bdy = document.body.clientHeight;
var obx = d.clientWidth; var obx = d.clientWidth;
var oby = d.clientHeight; var oby = d.clientHeight;
var ots = bdy-obtop-oby; var ots = bdy - obtop - oby;
var ols = bdx-obleft-obx; var ols = bdx - obleft - obx;
if (ots < 10) { if (ots < 10) {
obtop = bdy - 10 - oby; obtop = bdy - 10 - oby;
d.style.top = `${obtop}px`; d.style.top = `${obtop}px`;
@ -451,7 +471,7 @@ function infoMenuMy(u, e, f, dtm) {
} }
$("#d_clip_button").zclip({ $("#d_clip_button").zclip({
path: "js/ZeroClipboard.swf", path: "js/ZeroClipboard.swf",
copy: function(){ copy: function () {
return u; return u;
} }
}); });
@ -460,49 +480,57 @@ function infoMenuMy(u, e, f, dtm) {
//Окна //Окна
var win = { var win = {
winc:{}, //координаты окон winc: {}, //координаты окон
wsdr:null, wsdr: null,
scor:{}, //начальные координаты scor: {}, //начальные координаты
openw:function(id,title,text,date,type,style){ openw: function (id, title, text, date, type, style) {
if ($(`#win_${id}`).attr('id') == undefined) { if ($(`#win_${id}`).attr('id') == undefined) {
//Создаем новое окно //Создаем новое окно
this.add(id, title, text, date, type, 1, ''); this.add(id, title, text, date, type, 1, '');
} }
}, },
WstartDrag:function(id){ WstartDrag: function (id) {
$('#wupbox').css({'display':'block','cursor':'move'}); $('#wupbox').css({'display': 'block', 'cursor': 'move'});
this.wsdr = id; this.wsdr = id;
$('.w1').css({'z-index':1102}); $('.w1').css({'z-index': 1102});
$(`#win_${id}`).css({'z-index':1103}); $(`#win_${id}`).css({'z-index': 1103});
delete cm; delete cm;
}, },
WmoveDrag:function(e){ WmoveDrag: function (e) {
//Сохраняем начальные координаты //Сохраняем начальные координаты
var x = mousePageXY(e)['x'],y = mousePageXY(e)['y']; var x = mousePageXY(e)['x'], y = mousePageXY(e)['y'];
if(this.scor.x==undefined){ if (this.scor.x == undefined) {
this.scor.x = x; this.scor.x = x;
this.scor.y = y; this.scor.y = y;
this.scor.x2 = unpx($(`#win_${this.wsdr}`).css('left')); this.scor.x2 = unpx($(`#win_${this.wsdr}`).css('left'));
this.scor.y2 = unpx($(`#win_${this.wsdr}`).css('top')); this.scor.y2 = unpx($(`#win_${this.wsdr}`).css('top'));
} }
x = x-this.scor.x; x = x - this.scor.x;
y = y-this.scor.y; y = y - this.scor.y;
x += this.scor.x2; x += this.scor.x2;
y += this.scor.y2; y += this.scor.y2;
if(x < 9){ x = 9; } if (x < 9) {
if(x + $(`#win_${this.wsdr}`).width() > $(window).width() - 9 ){ x = $(window).width() - 9 - $(`#win_${this.wsdr}`).width(); } x = 9;
if(y<35){ y = 35; } }
if(y + $(`#win_${this.wsdr}`).height() > $(window).height() - 35 ){ y = $(window).height() - 35 - $(`#win_${this.wsdr}`).height(); } if (x + $(`#win_${this.wsdr}`).width() > $(window).width() - 9) {
$(`#win_${this.wsdr}`).css({'top':`${y}px`,'left':`${x}px`}); x = $(window).width() - 9 - $(`#win_${this.wsdr}`).width();
}
if (y < 35) {
y = 35;
}
if (y + $(`#win_${this.wsdr}`).height() > $(window).height() - 35) {
y = $(window).height() - 35 - $(`#win_${this.wsdr}`).height();
}
$(`#win_${this.wsdr}`).css({'top': `${y}px`, 'left': `${x}px`});
}, },
WstopDrag:function(){ WstopDrag: function () {
$('#wupbox').css({'display':'none','cursor':'move'}); $('#wupbox').css({'display': 'none', 'cursor': 'move'});
this.wsdr = null; this.wsdr = null;
this.scor = {}; this.scor = {};
}, },
add:function(id,title,text,date,type,style,css){ add: function (id, title, text, date, type, style, css) {
var nw = ''; var nw = '';
if($(`#win_${id}`).attr('id') == undefined){ if ($(`#win_${id}`).attr('id') == undefined) {
var acts = {}; var acts = {};
if (date.usewin != undefined) { if (date.usewin != undefined) {
@ -518,46 +546,46 @@ var win = {
} }
//нижняя часть //нижняя часть
if(date.n != undefined){ if (date.n != undefined) {
text += `<div style="margin-left:11px;">${date.n}</div>`; text += `<div style="margin-left:11px;">${date.n}</div>`;
} }
var kyps = ['','']; var kyps = ['', ''];
//Вывод главных данных //Вывод главных данных
if (type == 0) { if (type == 0) {
nw = text; nw = text;
} else if (type == 1) { } else if (type == 1) {
//Просто вывод данных //Просто вывод данных
nw = text; nw = text;
}else if(type==2){ } else if (type == 2) {
//Да \ Нет //Да \ Нет
nw = `<div>${text}</div><div style="padding:5px"><div style="float:left"><button onClick="${date.a1};win.closew(\'${id}\');${acts[9]}" class="btnnew wi${style}sbtn11" id="winyesbtnfox${id}" style="width:100px">Да</button></div><div style="float:right"><button class="btnnew wi${style}sbtn12" onClick="${date.a2};win.closew(\'${id}\')" style="width:100px">Нет</button></div><br></div>`; nw = `<div>${text}</div><div style="padding:5px"><div style="float:left"><button onClick="${date.a1};win.closew(\'${id}\');${acts[9]}" class="btnnew wi${style}sbtn11" id="winyesbtnfox${id}" style="width:100px">Да</button></div><div style="float:right"><button class="btnnew wi${style}sbtn12" onClick="${date.a2};win.closew(\'${id}\')" style="width:100px">Нет</button></div><br></div>`;
kyps[0] = `${date.a1};top.win.closew(\\\'${id}\\\');${acts[9]}top.win.addaction(0,\\\'\\\');`; kyps[0] = `${date.a1};top.win.closew(\\\'${id}\\\');${acts[9]}top.win.addaction(0,\\\'\\\');`;
}else if(type==3){ } else if (type == 3) {
//Да \ Нет , изображения //Да \ Нет , изображения
var stylebtn = ''; var stylebtn = '';
if( style > 1 ) { if (style > 1) {
stylebtn = style; stylebtn = style;
} }
nw = `<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>${text}</td><td width="40" align="center" valign="middle"><img class="prmimgyn" style="margin-top:5px;cursor:pointer" onClick="${date.a1};win.closew(\'${id}\');" src="https://${c.img}/i/b__ok${stylebtn}.gif" width="25" height="18"><br><img onClick="win.closew(\'${id}\')" class="prmimgyn" style="cursor:pointer;margin-top:2px;" src="https://${c.img}/i/b__cancel${stylebtn}.jpg" width="25" height="18"></td></tr></table>`; nw = `<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>${text}</td><td width="40" align="center" valign="middle"><img class="prmimgyn" style="margin-top:5px;cursor:pointer" onClick="${date.a1};win.closew(\'${id}\');" src="https://${c.img}/i/b__ok${stylebtn}.gif" width="25" height="18"><br><img onClick="win.closew(\'${id}\')" class="prmimgyn" style="cursor:pointer;margin-top:2px;" src="https://${c.img}/i/b__cancel${stylebtn}.jpg" width="25" height="18"></td></tr></table>`;
kyps[0] = `${date.a1};top.win.closew(\\\'${id}\\\');${acts[9]}top.win.addaction(0,\\\'\\\');`; kyps[0] = `${date.a1};top.win.closew(\\\'${id}\\\');${acts[9]}top.win.addaction(0,\\\'\\\');`;
}else if(type==4){ } else if (type == 4) {
//Тройной блок //Тройной блок
nw = text[0]; nw = text[0];
} }
//Если есть вторая информация //Если есть вторая информация
if(date.d!=undefined){ if (date.d != undefined) {
nw = nw+date.d; nw = nw + date.d;
} }
nw = `<div style="margin:2px;${css}">${nw}</div>`; nw = `<div style="margin:2px;${css}">${nw}</div>`;
//Заголовок окна //Заголовок окна
if(title != ''){ if (title != '') {
if( date.a3 == undefined ) { if (date.a3 == undefined) {
date.a3 = ''; date.a3 = '';
} }
if( acts[9] == undefined ) { if (acts[9] == undefined) {
acts[9] = ''; acts[9] = '';
} }
nw = `<div class="wi${style}s10" onselectstart="return false"> nw = `<div class="wi${style}s10" onselectstart="return false">
@ -592,24 +620,23 @@ var win = {
//Вешаем окно //Вешаем окно
nw = `<div class="w1" ${acts[0]} id="win_${id}">${nw}</div>`; nw = `<div class="w1" ${acts[0]} id="win_${id}">${nw}</div>`;
$('#windows').html($('#windows').html()+nw); $('#windows').html($('#windows').html() + nw);
$(`#win_${id}`).center(); $(`#win_${id}`).center();
if(type == 2 || type == 3) { if (type == 2 || type == 3) {
if(type == 2) { if (type == 2) {
$(`#winyesbtnfox${id}`).focus(); $(`#winyesbtnfox${id}`).focus();
} }
} }
} }
delete nw; delete nw;
}, },
addaction:function(nm,vl) { addaction: function (nm, vl) {
top.key_actions[nm] = vl; top.key_actions[nm] = vl;
if(nm != 2) { if (nm != 2) {
top.key_actions[2] = 1; top.key_actions[2] = 1;
} }
}, },
closew:function(id) closew: function (id) {
{
$(`#win_${id}`).html(''); $(`#win_${id}`).html('');
$(`#win_${id}`).remove(); $(`#win_${id}`).remove();
} }

View File

@ -16,6 +16,8 @@ $u = User::start();
$filter = new Filter(); $filter = new Filter();
$chat = new Chat(); $chat = new Chat();
$code = PassGen::intCode();
if ( if (
!isset($u->info['id']) || !isset($u->info['id']) ||
$u->info['banned'] > 0 || $u->info['banned'] > 0 ||
@ -68,10 +70,8 @@ $r = [
if ($u->info['battle'] > 0) { if ($u->info['battle'] > 0) {
$btl = mysql_fetch_array( $btl = Db::getValue('select count(*) from battle where id = ? and time_over = 0', [$u->info['battle']]);
mysql_query('SELECT `id` FROM `battle` WHERE `id` = "' . $u->info['battle'] . '" AND `time_over` = 0 LIMIT 1') if (empty($btl)) {
);
if (!isset($btl['id'])) {
$r['js'] .= 'top.frames["main"].location="main.php";'; $r['js'] .= 'top.frames["main"].location="main.php";';
} }
} }
@ -91,103 +91,60 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
if (strripos($x[$j], 'new-combats.com/info/')) { if (strripos($x[$j], 'new-combats.com/info/')) {
$ulogin = explode('/info/', $x[$j]); $ulogin = explode('/info/', $x[$j]);
$ulogin = $ulogin[1]; $ulogin = $ulogin[1];
$ulogin = mysql_fetch_array( $ulogin = Db::getValue('select login from users where id = ? or login = ?', [$ulogin, $ulogin]);
mysql_query( if (!empty($ulogin)) {
'SELECT `login` FROM `users` WHERE `id` = "' . mysql_real_escape_string( $uname = '<span style="color: #831db7; ">&lt;Информация о &quot;' . $ulogin . '&quot;&gt;</span>';
$ulogin
) . '" OR `login` = "' . mysql_real_escape_string($ulogin) . '" LIMIT 1'
)
);
if (isset($ulogin['login'])) {
$ulogin = htmlspecialchars($ulogin['login']);
$uname = '<font color=#831db7>&lt;Информация о &quot;' . $ulogin . '&quot;&gt;</font>';
} }
} elseif (strripos($x[$j], 'audio_1610649509.mp3')) { //ТУТ аудио } elseif (strripos($x[$j], 'audio_1610649509.mp3')) { //ТУТ аудио
$uname = '<font color=#FF851B>&lt;Голосовое сообщение&gt;</font>'; $uname = '<span style="color: #FF851B; ">&lt;Голосовое сообщение&gt;</span>';
} elseif (strripos($x[$j], 'new-combats.com/item/')) { } elseif (strripos($x[$j], 'new-combats.com/item/')) {
$ulogin = explode('/item/', $x[$j]); $ulogin = explode('/item/', $x[$j]);
$ulogin = $ulogin[1]; $ulogin = $ulogin[1];
$ulogin = mysql_fetch_array( $ulogin = Db::getValue('select name from items_main where id = ?', [$ulogin]);
mysql_query( if (isset($ulogin)) {
'SELECT `name` FROM `items_main` WHERE `id` = "' . mysql_real_escape_string( $uname = '<span style="color: #5f9b00; ">&lt;Предмет &quot;' . $ulogin . '&quot;&gt;</span>';
$ulogin
) . '" LIMIT 1'
)
);
if (isset($ulogin['name'])) {
$ulogin = htmlspecialchars($ulogin['name']);
$uname = '<font color=#5f9b00>&lt;Предмет &quot;' . $ulogin . '&quot;&gt;</font>';
} else { } else {
$uname = '<font color=#5f9b00>&lt;Библиотека предметов&gt;</font>'; $uname = '<span style="color: #5f9b00; ">&lt;Библиотека предметов&gt;</span>';
} }
} elseif (strripos($x[$j], 'new-combats.com/news')) { } elseif (strripos($x[$j], 'new-combats.com/news')) {
$ulogin = explode('/news', $x[$j]); $ulogin = explode('/news', $x[$j]);
$ulogin = $ulogin[1]; $ulogin = $ulogin[1];
$ulogin = ltrim($ulogin, '/'); $ulogin = ltrim($ulogin, '/');
$ulogin = mysql_fetch_array( $ulogin = Db::getValue('select title from events_news where id = ?', [$ulogin]);
mysql_query( if (isset($ulogin)) {
'SELECT `title` FROM `events_news` WHERE `id` = "' . mysql_real_escape_string( $uname = '<span style="color: #b57300; ">&lt;Новость &quot;' . $ulogin . '&quot;&gt;</span>';
$ulogin
) . '" LIMIT 1'
)
);
if (isset($ulogin['title'])) {
$ulogin = htmlspecialchars($ulogin['title']);
$uname = '<font color=#b57300>&lt;Новость &quot;' . $ulogin . '&quot;&gt;</font>';
} else { } else {
$uname = '<font color=#b57300>&lt;Новостная лента&gt;</font>'; $uname = '<span style="color: #b57300; ">&lt;Новостная лента&gt;</span>';
} }
} elseif (strripos($x[$j], 'new-combats.com/lib')) { } elseif (strripos($x[$j], 'new-combats.com/lib')) {
$ulogin = explode('/lib', $x[$j]); $ulogin = explode('/lib', $x[$j]);
$ulogin = $ulogin[1]; $ulogin = $ulogin[1];
$ulogin = ltrim($ulogin, '/'); $ulogin = ltrim($ulogin, '/');
$ulogin = rtrim($ulogin, '/'); $ulogin = rtrim($ulogin, '/');
$ulogin = mysql_fetch_array( $ulogin = Db::getValue('select title from library_content where url_name = ? and moder > 0', [$ulogin]);
mysql_query( if (isset($ulogin)) {
'SELECT `title` FROM `library_content` WHERE `url_name` = "' . mysql_real_escape_string( $uname = '<span style="color: #4c6e00; ">&lt;Библиотека &quot;' . $ulogin . '&quot;&gt;</span>';
$ulogin
) . '" AND `moder` > 0 LIMIT 1'
)
);
if (isset($ulogin['title'])) {
$ulogin = htmlspecialchars($ulogin['title']);
$uname = '<font color=#4c6e00>&lt;Библиотека &quot;' . $ulogin . '&quot;&gt;</font>';
} else { } else {
$uname = '<font color=#4c6e00>&lt;Библиотека&gt;</font>'; $uname = '<span style="color: #4c6e00; ">&lt;Библиотека&gt;</span>';
} }
} elseif (strripos($x[$j], 'new-combats.com/forum')) { } elseif (strripos($x[$j], 'new-combats.com/forum')) {
$ulogin = explode('/forum?read=', $x[$j]); $ulogin = explode('/forum?read=', $x[$j]);
$ulogin = $ulogin[1]; $ulogin = $ulogin[1];
$ulogin = explode('&', $ulogin); $ulogin = explode('&', $ulogin);
$ulogin = $ulogin[0]; $ulogin = $ulogin[0];
// $ulogin = Db::getValue('select title from forum_msg where id = ? and `delete` = 0', [$ulogin]);
$ulogin = mysql_fetch_array( if (isset($ulogin)) {
mysql_query( $uname = '<span style="color: #0055b5; ">&lt;Форум &quot;' . $ulogin . '&quot;&gt;</span>';
'SELECT `title` FROM `forum_msg` WHERE `id` = "' . mysql_real_escape_string(
$ulogin
) . '" AND `delete` = 0 LIMIT 1'
)
);
if (isset($ulogin['title'])) {
$ulogin = htmlspecialchars($ulogin['title']);
$uname = '<font color=#0055b5>&lt;Форум &quot;' . $ulogin . '&quot;&gt;</font>';
} else { } else {
$ulogin = explode('/forum?r=', $x[$j]); $ulogin = explode('/forum?r=', $x[$j]);
$ulogin = $ulogin[1]; $ulogin = $ulogin[1];
$ulogin = explode('&', $ulogin); $ulogin = explode('&', $ulogin);
$ulogin = $ulogin[0]; $ulogin = $ulogin[0];
// $ulogin = Db::getValue('select name from forum_menu where id = ?', [$ulogin]);
$ulogin = mysql_fetch_array( if (isset($ulogin)) {
mysql_query( $uname = '<span style="color: #0055b5; ">&lt;Конференция форума &quot;' . $ulogin . '&quot;&gt;</span>';
'SELECT `name` FROM `forum_menu` WHERE `id` = "' . mysql_real_escape_string(
$ulogin
) . '" LIMIT 1'
)
);
if (isset($ulogin['name'])) {
$uname = '<font color=#0055b5>&lt;Конференция форума &quot;' . $ulogin['name'] . '&quot;&gt;</font>';
} else { } else {
$uname = '<font color=#0055b5>&lt;Форум проекта&gt;</font>'; $uname = '<span style="color: #0055b5; ">&lt;Форум проекта&gt;</span>';
} }
} }
} }
@ -196,10 +153,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
"/(https:\\/\\/)?(new-combats+\\.com(([ \"'>\r\n\t])|(\\/([^ \"'>\r\n\t]*)?)))/", "/(https:\\/\\/)?(new-combats+\\.com(([ \"'>\r\n\t])|(\\/([^ \"'>\r\n\t]*)?)))/",
$x[$j], $x[$j],
$ok $ok
) ? str_replace( ) ? str_replace($ok[2], "<small><a href=https://$ok[2] target=_blank ><i>" . $uname . "</i></a></small>", str_replace("https://", "", $x[$j])) . " " : $x[$j] . " ";
$ok[2], "<small><a href=https://$ok[2] target=_blank ><i>" . $uname . "</i></a></small>",
str_replace("https://", "", $x[$j])
) . " " : $x[$j] . " ";
} }
return $newbuf; return $newbuf;
} }
@ -232,26 +186,15 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
$_POST['msg'] = str_replace(' ', ' ', $_POST['msg']); $_POST['msg'] = str_replace(' ', ' ', $_POST['msg']);
$smg = Db::getRow('select * from chat where login = ? and time > unix_timestamp() - 20 order by time desc limit 1', [$u->info['login']]);
$smg = mysql_fetch_array(
mysql_query(
'SELECT * FROM `chat` WHERE `login` = "' . $u->info['login'] . '" AND `time` > ' . (time(
) - 20) . ' ORDER BY `time` DESC LIMIT 1'
)
);
if ($u->info['exp'] < 499999999) { if ($u->info['exp'] < 499999999) {
$lmg = mysql_fetch_array( $lmg = Db::getValue('select count(id) from chat where login = ? and time = unix_timestamp() - 5 limit 2', [$u->info['login']]);
mysql_query(
'SELECT COUNT(`id`) FROM `chat` WHERE `login` = "' . $u->info['login'] . '" AND `time` > ' . (time(
) - 5) . ' LIMIT 2'
)
);
} else { } else {
$lmg[0] = 0; $lmg = 0;
} }
$testsmg = ' ' . $_POST['msg'] . ' '; $testsmg = ' ' . $_POST['msg'] . ' ';
if ($testsmg == $smg['text'] && $u->info['exp'] > 100000) { if ($testsmg == $smg['text'] && $u->info['exp'] > 100000) {
if ($u->info['molch1'] < time()) { if ($u->info['molch1'] < time()) {
//Молчанка за флуд на 5 минут //Молчанка за флуд на 5 минут
@ -259,11 +202,10 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
$r['js'] .= 'chat.sendMsg(["new","' . time( $r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<small>Вы наказаны за спам на 20 минут </small>","Black","1","1","0"]);'; ) . '","6","","' . $u->info['login'] . '","<small>Вы наказаны за спам на 20 минут </small>","Black","1","1","0"]);';
mysql_query( Db::sql('update users set molch1 = ? where id = ?', [$u->info['molch1'], $u->info['id']]);
'UPDATE `users` SET `molch1` = "' . $u->info['molch1'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' Db::sql('update chat set `delete` = 1 where login = ?', [$u->info['login']]);
);
mysql_query("UPDATE `chat` SET `delete` = 1 WHERE `login` = '" . $u->info['login'] . "' LIMIT 1000"); $_POST['msg'] = 'Я спамер ' . $u->info['login'] . ' и меня нужно заблокировать https://new-combats.com/info/' . $u->info['id'];
$_POST['msg'] = 'Я спамер ' . $u->info['login'] . ' и меня нужно заблокировать https://new-combats.com/info/' . $u->info['id'] . '';
mysql_query( mysql_query(
'INSERT INTO `chat` (`nosee`,`invis`,`da`,`delete`,`molch`,`new`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`) VALUES ( 'INSERT INTO `chat` (`nosee`,`invis`,`da`,`delete`,`molch`,`new`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`) VALUES (
@ -314,7 +256,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
); );
} }
} elseif ($lmg[0] > 0) { } elseif ($lmg > 0) {
$r['js'] .= 'chat.sendMsg(["new","' . time( $r['js'] .= 'chat.sendMsg(["new","' . time(
) . '","6","","' . $u->info['login'] . '","<small>Вы не можете отправлять так часто сообщения... </small>","Black","1","1","0"]);'; ) . '","6","","' . $u->info['login'] . '","<small>Вы не можете отправлять так часто сообщения... </small>","Black","1","1","0"]);';
if ($u->info['molch1'] < time()) { if ($u->info['molch1'] < time()) {
@ -627,20 +569,56 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
//Получаем список онлайн //Получаем список онлайн
if ($_GET['r1'] != 0) { if ($_GET['r1'] != 0) {
$sp = mysql_query( // $_GET['r3'] передаётся из onlineList.js как переключатель "все пользователи\пользователи в комнате".
'SELECT `u`.`pass`,`u`.`sex`,`s`.`dnow`,`u`.`timeMain`,`s`.`bot`,`s`.`atack`,`u`.`afk`,`u`.`dnd`,`u`.`banned`,`u`.`molch1`,`u`.`room`,`u`.`id`,`u`.`city`,`u`.`cityreg`,`u`.`online`,`u`.`align`,`u`.`clan`,`u`.`login`,`u`.`level`,`u`.`inTurnir`,`u`.`battle`,`u`.`invis`,`u`.`inUser`,`s`.`x`,`s`.`y` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE ((`u`.`room` = "' . $u->info['room'] . '" AND "' . mysql_real_escape_string( define('BOT_ROOM', 303);
(int)$_GET['r3']
) . '" != "1") OR ("' . mysql_real_escape_string(
(int)$_GET['r3']
) . '" = "1" AND `pass` NOT LIKE "%saint%")) AND `mail`!="No E-mail" AND `room` != "303" ORDER BY `u`.`inUser` DESC,`u`.`online` DESC,`u`.`login` DESC LIMIT 1000'
);
$ar_id = 0; $ar_id = 0;
$ar_lvl = 0; $ar_lvl = 0;
$ar_all = '0'; $ar_all = '0';
$usl = []; $usl = [];
$cw = []; $cw = [];
$usid = []; $usid = [];
while ($pl = mysql_fetch_array($sp)) { $onlineListQuery = 'select
users.id, pass, sex, dnow, timeMain, bot, atack, afk, dnd, banned, molch1,
room, city, cityreg, online, align, clan, login, level, inTurnir, battle, invis, inUser, x, y
from users left join stats on users.id = stats.id
where
(
(room = ? and ' . (int)$_GET['r3'] . ' != 1) or
(' . (int)$_GET['r3'] . ' = 1 and pass not like ?)
) and
mail != ? and
room != ?
order by inUser desc, online desc, login desc';
$sp = Db::getRows($onlineListQuery, [$u->info['room'], '%saint%', '', BOT_ROOM]);
foreach ($sp as $pl) {
// }
//
// $sp = mysql_query(
// 'SELECT
// `u`.`pass`,
// `u`.`sex`,
// `s`.`dnow`,
// `u`.`timeMain`,
// `s`.`bot`,`s`.`atack`,`u`.`afk`,`u`.`dnd`,`u`.`banned`,`u`.`molch1`,`u`.`room`,`u`.`id`,`u`.`city`,`u`.`cityreg`,`u`.`online`,`u`.`align`,
// `u`.`clan`,`u`.`login`,`u`.`level`,`u`.`inTurnir`,`u`.`battle`,`u`.`invis`,`u`.`inUser`,`s`.`x`,`s`.`y`
//FROM
//`users` AS `u`
// LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id`
//WHERE (
// (`u`.`room` = "' . $u->info['room'] . '" AND "' . mysql_real_escape_string((int)$_GET['r3']) . '" != "1") OR
// ("' . mysql_real_escape_string((int)$_GET['r3']) . '" = "1" AND `pass` NOT LIKE "%saint%")) AND
// `mail`!="No E-mail" AND
// `room` != "303"
// ORDER BY `u`.`inUser` DESC,`u`.`online` DESC,`u`.`login` DESC LIMIT 1000'
// );
// $ar_id = 0;
// $ar_lvl = 0;
// $ar_all = '0';
// $usl = [];
// $cw = [];
// $usid = [];
// while ($pl = mysql_fetch_array($sp)) {
$ysee = 1; $ysee = 1;
if ($pl['inUser'] > 0) { if ($pl['inUser'] > 0) {
if ($pl['inTurnir'] == 0) { if ($pl['inTurnir'] == 0) {