TemKa_SD 9 09/12/2018 07:02 AM (edited) Добавил флеш сообщение, как думаете, стоит использовать его каждые 5 сек? timer.html(ips.ui.flashMsg.show('Обновление...')); Сделал отображение фильтра, если ботов больше 1. {{if count($games['botid_data']) > 1}} {{foreach $games['botid_data'] as $name => $id}} <li> <span class="ipsSideMenu_item cForumMiniList_unread"> <input type="checkbox" role="checkbox" name="botid[]" value="{$id}" {{if isset(\IPS\Request::i()->cookie['RunningGames_botid']) AND in_array($id, explode(',', \IPS\Request::i()->cookie['RunningGames_botid']))}}checked{{endif}} id="botid_{$id}" class="botid"> <label for='botid_{$id}' class="cForumMiniList_blob"> <label for='botid_{$id}'></label> <i class="fa fa-check"></i> </label> <label for='botid_{$id}' class="cForumMiniList_title ipsTruncate ipsTruncate_line">{$name}</label> <span class="ipsType_small ipsType_light cForumMiniList_count">1</span> </span> </li> {{endforeach}} {{endif}} Edited September 12, 2018 by TemKa_SD Share this post Link to post
newbie 1,723 09/12/2018 09:04 AM Добавил флеш сообщение, как думаете, стоит использовать его каждые 5 сек?ИМХО ерунда. Share this post Link to post
TemKa_SD 9 09/13/2018 01:13 AM ИМХО ерунда. Согласен, лишнее это. Включил логи nginx, тут вот такое: http://prntscr.com/ktrpwy Share this post Link to post
TemKa_SD 9 09/13/2018 01:18 AM Хотя, на DEV версии такого вроде нет, там где такое происходит чуть старее версия, с багами. Share this post Link to post
newbie 1,723 09/13/2018 10:25 AM Включил логи nginx, тут вот такое: http://ipbskins.ru/forum/topic15719.html/page__view__findpost__p__105194 Share this post Link to post
TemKa_SD 9 09/14/2018 03:12 AM Помогите плиз еще вывести тут кол-во игр на конкретно этом боте, у меня вообще не получается, пробовал разные переменные, не пойму как сделать. <span class="ipsType_small ipsType_light cForumMiniList_count">1</span> Share this post Link to post
newbie 1,723 09/14/2018 05:40 AM Добавляете в выборку botid foreach ($db::i('stats')->select('id, gamename, slotstaken, slotstotal, age, usernames, totalgames, lobby, botid', 'stats_gamelist', $conditions, 'lobby DESC') as $game) { и считаетеif (!isset($botGames[$game['botid']])) { $botGames[$game['botid']] = 0; } else { $botGames[$game['botid']]++; }Возвращаете return [ 'games' => $games, 'total' => $totalGames, 'botGames' => $botGames ];и html<span class="ipsType_small ipsType_light cForumMiniList_count">{{if isset($games['botGames'][$id])}}{$games['botGames'][$id]}{{else}}0{{endif}}</span> 1 Share this post Link to post
TemKa_SD 9 11/10/2018 10:18 PM (edited) Здравствуйте. А как сделать, чтобы обновление не было привязано к счетчику HTML, чтобы я мог выбрать отображать этот счетчик или нет. var table = $('#gamelistTable'); var tableBody = table.find('ol'); var names = new Clipboard('.copy'); var updateUrl = table.attr('data-bind'); var elTotalGames = $('#elTotalGames'); var elTotalPlayers = $('#elTotalPlayers'); var date = new Date(); var timer = $('#elTimer'); var timerTime = timer.html(); var counter = timerTime; date.setTime(date.getTime() + (365 * 86400000)); var ajaxObj = null; setInterval(function() { if (counter === 0) { if (ajaxObj != null) { return; } timer.html(ips.getString('sharedstats_running_games_update')); ajaxObj = ips.getAjax()(updateUrl) .done(function (response) { tableBody.html(response['html']); elTotalGames.html(response['games']); elTotalPlayers.html(response['players']); counter = timerTime; ajaxObj = null; }) .fail(function() { window.location.reload(); }); } else { timer.html(counter); counter -= 1; } }, 1000); Edited November 10, 2018 by TemKa_SD Share this post Link to post
newbie 1,723 11/13/2018 09:08 AM чтобы я мог выбрать отображать этот счетчик или нет.Так скройте его через css Share this post Link to post