コード例 #1
0
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:47
 */
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\Functions($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$sfxFiles = $functions->getSfxFiles();
$sfxCommands = $dataStore->getTableAsArray('sfxcommands');
$sfxSelectOptions = '';
$sfxTableDataRows = '';
if (count($sfxFiles) > 0) {
    foreach ($sfxFiles as $sfxFile) {
        $sfxSelectOptions .= '<option value="' . $sfxFile['path'] . '">' . $sfxFile['fileName'] . '</option>';
    }
} else {
    $sfxSelectOptions .= '<option>NO FILES!</option>';
}
ksort($sfxCommands);
foreach ($sfxCommands as $command => $file) {
    $sfxTableDataRows .= '<tr><td>' . $templates->botCommandButton($command, '!' . $command, 'default btn-sm') . '</td><td>' . $file . '</td><td><button class="btn btn-danger" onclick="deleteSfx(\'' . $command . '\')"><span class="fa fa-trash"></span></button></td></tr>';
}
?>
<div class="app-part">
コード例 #2
0
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:47
 */
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\Functions($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$users = $dataStore->getTableAsArray('users');
$usersDataRows = '';
$usersDataRowsCurrentPosition = 0;
$usersDataRowsIsFirst = true;
$currentValidatedUser = filter_input(INPUT_POST, 'username');
$userIsAdmin = false;
foreach ($users as $username => $md5Password) {
    $uuid = $templates->randomId();
    $usersDataRowsIsFirst = $username == $currentValidatedUser;
    ++$usersDataRowsCurrentPosition;
    if ($usersDataRowsCurrentPosition == 1 && $username != $currentValidatedUser) {
        continue;
    } elseif ($usersDataRowsCurrentPosition == 1) {
        $userIsAdmin = true;
    }
    if (!$userIsAdmin && $username != $currentValidatedUser) {
コード例 #3
0
  <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
  <script>
    var botAddress = '<?php 
echo $eventServerAdress;
?>
',
        commandPermissions = <?php 
echo json_encode($functions->getIniArray('permcom'));
?>
,
        userGroups = <?php 
echo json_encode($functions->getIniArray('group'));
?>
,
        sfxCommands = <?php 
echo json_encode($dataStore->getTableAsArray('sfxcommands'));
?>
;
  </script>
  <script src="//code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
  <script src="//code.jquery.com/ui/1.11.3/jquery-ui.min.js" type="text/javascript"></script>
  <script src="app/js/rsocket.min.js"></script>
  <script src="app/js/sfx-host.min.js"></script>
</head>
<body>
<div class="info">
  <h3 class="title">Sfx commands on <a
        href="http://twitch.tv/<?php 
echo $dataStore->getVar('connector', 'channelOwner');
?>
"><?php