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

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;
@ -49,19 +49,25 @@ function startEngine() {
}) })
}); });
$(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);
} }
} }
@ -121,6 +127,7 @@ 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;
@ -231,7 +238,8 @@ 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;
@ -245,10 +253,20 @@ function resizeFinish() {
$('#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),
'width': ($(window).width() - 19)
});
$('#touchmain').css({
'height': ($(window).height() - j - $('#chat_block').height() - 42),
'width': ($(window).width() - 19)
});
$('#reline1').css({'top': ($(window).height() - j - $('#chat').height() - 6) + 'px'}); $('#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'}); $('#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) {
@ -265,7 +283,10 @@ function hidemenu (time) {
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');
@ -383,8 +404,7 @@ function infoMenu(u,e,f)
} }
} }
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) {
@ -489,10 +509,18 @@ var win = {
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) {
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`}); $(`#win_${this.wsdr}`).css({'top': `${y}px`, 'left': `${x}px`});
}, },
WstopDrag: function () { WstopDrag: function () {
@ -608,8 +636,7 @@ var win = {
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) {