} else { sort($viewers); } foreach ($viewers as $username) { $viewersDataRows .= '<tr> <td> <table> <tr><td>' . $username . '</td></tr> <tr><td class="text-muted">' . (array_key_exists($username, $viewerGroups) ? $groups[$viewerGroups[$username]] : $groups[7]) . '</td></tr> <tr><td>' . (array_key_exists($username, $viewerRanks) ? '<span class="text-muted">' . $viewerRanks[$username] . '</span>' : '') . '</td></tr> </table> </td> <td> <table> <tr><td class="text-muted">Last Seen: </td><td>' . (array_key_exists($username, $lastSeen) ? $functions->secondsToDate(round($lastSeen[$username] / 1000)) : 'Unknown') . '</td></tr> <tr><td class="text-muted">Recorded Time: </td><td>' . $functions->secondsToTime($viewerTime[$username]) . '</td></tr> <tr><td class="text-muted">' . $psName . ': </td><td>' . (array_key_exists($username, $viewerPoints) ? $viewerPoints[$username] : 0) . '</td></tr> <tr> <td colspan="2">' . (array_key_exists($username, $followers) && $functions->strToBool($followers[$username]) ? '<span class="text-success">Follows you</span>' : '<span class="text-danger">Does not follow you</span>') . (array_key_exists($username, $incRaids) ? ', <span class="text-success">Raided you ' . $incRaids[$username] . ' times!</span>' : '') . '</td> </tr> </table> </td> </tr>'; } ?> <div class="app-part"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"> Viewer Info <?php
if (preg_match('/\\([0-9]\\)|\\([.]{3}\\)/i', $message)) { $actor = $templates->botCommandFormV2($command, '', ['placeholder' => '!' . $command, 'autoComplete' => 'user']); } else { $actor = $templates->botCommandButton($command, '!' . $command, 'default btn-block'); } if (array_key_exists($command, $commandPriceIni)) { if (intval($commandPriceIni[$command]) < 1 || intval($commandPriceIni[$command]) > 1) { $price = $commandPriceIni[$command] . ' ' . $pointNames[0]; } else { $price = $commandPriceIni[$command] . ' ' . $pointNames[1]; } } else { $price = '0 ' . $pointNames[0]; } if (array_key_exists($command, $commandCooldown)) { $cooldown = $functions->secondsToTime(intval($commandCooldown[$command])); } else { $cooldown = $functions->secondsToTime(0); } $customCommandsTableRows .= '<tr>' . $templates->addTooltip('<td class="command-actor">' . $actor . '</td>', '<span class="message ' . $msgClass . '">' . $message . '</span>', ['position' => \PBPanel\Util\ComponentTemplates::TOOLTIP_POS_RIGHT, 'offsetY' => strlen($message) < 50 ? 17 : (strlen($message) > 90 ? -17 : 0)]) . '<td>' . '<span class="text-muted">Group:</span> ' . $perm . '<br />' . '<span class="text-muted">Price:</span> ' . $price . '<br />' . '<span class="text-muted">Cooldown:</span> ' . $cooldown . '</td>' . '<td>' . join(', ', $commandAliases) . '</td>' . '<td class="actions">' . $templates->botCommandButton('delcom ' . $command, '<span class="fa fa-trash"></span>', 'danger', 'Are you sure you want to delete !' . $command . '?', true) . '</td>' . '</tr>'; } array_walk($commandPermIni, function ($value) use($defaultCommands) { $defaultCommands[] = str_replace('_recursive', '', $value); }); $defaultCommands = array_unique(array_merge($defaultCommands, array_keys($commandPriceIni), array_keys($commandCooldown))); sort($defaultCommands); foreach ($defaultCommands as $command) { if (array_key_exists($command, $commandAliasIni) || array_key_exists($command, $customCommandsIni)) { continue; } $commandAliases = [];
require_once '../../../AppLoader.class.php'; \PBPanel\AppLoader::load(); $session = new \PBPanel\Util\PanelSession(); if (!$session->checkSessionToken(filter_input(INPUT_POST, 'token'))) { die('Invalid session token. Are you trying to hack me?!'); } $dataStore = new \PBPanel\Util\DataStore(); $connection = new \PBPanel\Util\BotConnectionHandler($dataStore); $functions = new \PBPanel\Util\FunctionLibrary($dataStore, $connection); $templates = new \PBPanel\Util\ComponentTemplates(); $commandCooldowns = $functions->getDbTableArray('commandCooldown'); $commandCooldownsDataRows = ''; foreach ($commandCooldowns as $command => $seconds) { $seconds = intval($seconds); if ($seconds > 0) { $commandCooldownsDataRows .= '<tr>' . '<td>!' . $command . '</td>' . '<td>' . $functions->secondsToTime($seconds) . '</td>' . '<td style="width:64px;">' . $templates->botCommandButton('cooldown ' . $command . ' 0', '<span class="fa fa-trash"></span>', 'danger') . '</td>' . '</tr>'; } } ?> <div class="app-part"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"> Command Cooldown <?php echo $templates->toggleFavoriteButton(); ?> <?php echo $templates->moduleActiveIndicator($functions->getModuleStatus('commandCoolDown.js')); ?> </h3>