Esempio n. 1
0
$dataStore = new \PBPanel\Util\DataStore();
$connection = new \PBPanel\Util\BotConnectionHandler($dataStore);
$functions = new \PBPanel\Util\Functions($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$botSettings = $functions->getIniArray('settings');
$pastRaiders = $functions->getIniArray('raiders');
$pastRaidersTableRows = '';
$doRaidCommandResponse = $functions->getIniValueByKey('command', 'doraid');
$firstTime = false;
$addCommandJsActive = $functions->getModuleStatus('addCommand.js');
$doRaidCommandForm = $templates->botCommandForm('doraid', 'Raid target', '[username]');
if ($addCommandJsActive == 1 && (!$doRaidCommandResponse || $doRaidCommandResponse == '')) {
    $connection->send('!addcom doraid Let\'s raid (1)! Go to http://twitch.tv/(1) and say "' . $dataStore->getVar('connector', 'channelOwner') . ' Raid!", throw them a follow and show the love! <3');
    $firstTime = true;
} elseif ($addCommandJsActive == '0') {
    $doRaidCommandForm = $templates->addTooltip($templates->botCommandForm('doraid', 'Raid target', '[username]', null, 'Send', true), 'Enable the addCommand.js module to use this form.' . $templates->botCommandButton('!module enable ./commands/addCommand.js', 'Enable addCommand.js Now', 'primary btn-block'));
}
foreach ($pastRaiders as $username => $timesRaided) {
    $pastRaidersTableRows .= '<tr><td>' . str_replace('_count', '', $username) . '</td><td>' . $timesRaided . ' raids</td></tr>';
}
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Raid System
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('raidSystem.js'));
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Chat Game Settings
        <?php 
echo $templates->toggleFavoriteButton();
?>
      </h3>
    </div>
    <div class="panel-body">
      <h4>Play</h4>

      <div class="btn-toolbar">
        <?php 
echo $templates->botCommandButton('adventure 500', 'Adventure (500 ' . $pointSettings['pointNameMultiple'] . ')');
?>
        <?php 
echo $templates->botCommandButton('random', 'Random');
?>
        <?php 
echo $templates->botCommandButton('roll', 'Roll');
?>
        <?php 
echo $templates->botCommandButton('roulette', 'Roulette');
?>
        <?php 
echo $templates->botCommandButton('slot', 'Slot Machine');
?>
      </div>
      <hr/>
Esempio n. 3
0
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Host Events
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('hostHandler.js'));
?>
      </h3>
    </div>
    <div class="panel-body">
      <div class="btn-group">
        <?php 
echo $templates->botCommandButton('hostcount', 'Current Host Count');
?>
        <?php 
echo $templates->botCommandButton('hostlist', 'Hoster List');
?>
      </div>
      <hr/>
      <h4 class="collapsible-master">Hosts Settings</h4>

      <div class="collapsible-content">
        <?php 
echo $templates->botCommandForm('hostmessage', 'Message on host', '[message]', array_key_exists('hostmessage', $botSettings) ? $botSettings['hostmessage'] : '');
?>
        <div class="row">
          <div class="col-sm-4">
            <?php 
Esempio n. 4
0
        Bidding System
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('bidSystem.js'));
?>
      </h3>
    </div>
    <div class="panel-body">
      <div class="row">
        <div class="col-sm-4">
          <?php 
echo $templates->botCommandForm('!bid start', 'Start a new bid', '[amount] [increment amount]');
?>
        </div>
        <div class="col-sm-8">
          <div class="spacer"></div>
          <div class="btn-group">
            <?php 
echo $templates->botCommandButton('bid warn', 'Warn About End Current Bidding');
?>
            <?php 
echo $templates->botCommandButton('bid end', 'End Current Bidding');
?>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
      <h3 class="panel-title">
        Chat Moderator
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('chatModerator.js'));
?>
      </h3>
    </div>
    <div class="panel-body">
      <h4>Moderate Now</h4>

      <div class="btn-toolbar">
        <?php 
echo $templates->botCommandButton('clear', 'Clear The Chat');
?>
      </div>
      <div class="spacer"></div>
      <div class="row">
        <div class="col-sm-8">
          <?php 
echo $templates->combinedBotCommandForm('', ['permit' => 'Permit', 'purge' => 'Purge', 'timeout' => 'Timeout', 'ban' => 'Ban', 'unban' => 'Unban'], 'Moderate (Choose Option)', '[username]');
?>
        </div>
      </div>
      <div class="row">
        <div class="col-sm-4">
          <?php 
echo $templates->botCommandForm('autopurge', 'Purge on phrase', '[phrase]');
?>
Esempio n. 6
0
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Bank Heist
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('bankHeistSystem.js'));
?>
    </div>
    <div class="panel-body">
      <div class="btn-toolbar">
        <?php 
echo $templates->botCommandButton('bankheist start', 'Start Bank Heist');
?>
        <?php 
echo $templates->switchToggle('Toggle Bankheist', 'doQuickCommand', '[\'bankheist toggle\']', '', array_key_exists('bankheistToggle', $botSettings) ? filter_var($botSettings['bankheistToggle'], FILTER_VALIDATE_BOOLEAN) : false);
?>
      </div>
      <hr/>
      <h4 class="collapsible-master">Session Settings</h4>

      <div class="collapsible-content">
        <div class="row">
          <div class="col-sm-4">
            <?php 
echo $templates->botCommandForm('bankheist signupminutes', 'Sign up time', '[minutes]', array_key_exists('signupMinutes', $bankHeistTimers) ? $bankHeistTimers['signupMinutes'] : '1');
?>
          </div>
Esempio n. 7
0
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Raffle System
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('raffleSystem.js'));
?>
      </h3>
    </div>
    <div class="panel-body">
      <div class="btn-toolbar">
        <?php 
echo $templates->botCommandButton('raffle', 'Anounce Current Raffle', 'default');
?>
        <?php 
echo $templates->botCommandButton('raffle close', 'Close Current Raffle', 'default');
?>
        <?php 
echo $templates->botCommandButton('raffle redraw', 'Redraw Current Raffle Winner', 'default');
?>
      </div>
      <div class="spacer"></div>
      <h4>Start a new raffle</h4>

      <div class="row">
        <div class="col-sm-4">
          <form class="raffle-start-form">
            <div class="form-group">
Esempio n. 8
0
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Bet System
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('betSystem.js'));
?>
      </h3>
    </div>
    <div class="panel-body">
      <div class="btn-group">
        <?php 
echo $templates->botCommandButton('bet start', 'Start Default Bet');
?>
        <?php 
echo $templates->botCommandButton('bet results', 'Latest Bet Results');
?>
      </div>
      <hr/>
      <h4>Custom Bet</h4>

      <div class="row">
        <div class="col-sm-4">
          <?php 
echo $templates->botCommandForm('bet start', 'Start Custom bet', '[option] [option2] [option3] [option4]');
?>
        </div>
        <div class="col-sm-4">
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();
$botSettings = $functions->getDbTableArray('settings');
$commandTimerSettings = $functions->getDbTableArray('commandTimerSettings');
$commandTimerCommands = $functions->getDbTableArray('commandTimer');
$commandTimerCommandsDataRows = '';
foreach ($commandTimerCommands as $command => $active) {
    $commandTimerCommandsDataRows .= '<tr>' . '<td>' . $templates->botCommandButton($command, '!' . $command, 'default') . '</td>' . '<td style="width:54px;">' . $templates->botCommandButton('delcommandtimer ' . $command, '<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 Timer
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('commandTimer.js'));
?>
      </h3>
    </div>
Esempio n. 10
0
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Roll Command
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('rollCommand.js'));
?>
      </h3>
    </div>
    <div class="panel-body">
      <div class="btn-toolbar">
        <?php 
echo $templates->botCommandButton('roll', 'Make A Roll');
?>
        <?php 
echo $templates->switchToggle('Toggle Cool Down', 'doQuickCommand', '[\'roll wait\']', null, array_key_exists('roll_wait', $rollSettings) && filter_var($rollSettings['roll_wait'], FILTER_VALIDATE_BOOLEAN));
?>
        <?php 
echo $templates->switchToggle('Toggle Stream-Online-Only', 'doQuickCommand', '[\'roll stream\']', null, array_key_exists('roll_stream', $rollSettings) && filter_var($rollSettings['roll_stream'], FILTER_VALIDATE_BOOLEAN));
?>
      </div>
      <hr/>
      <h4 class="collapsible-master">Roll Settings</h4>

      <div class="collapsible-content">
        <div class="row">
          <div class="col-sm-4">
            <?php 
Esempio n. 11
0
    </div>
    <div class="panel-body">
      <?php 
echo $latestFollower ? '<h4><small>Latest Follower</small> ' . $latestFollower . '</h4>' : '';
?>
      <?php 
echo $latestDonator ? '<h4><small>Latest Donator</small> ' . $latestDonator . '</h4>' : '';
?>
      <?php 
echo $latestFollower || $latestDonator != '' ? '<hr />' : '';
?>
      <h4>Quick Commands</h4>

      <div class="btn-toolbar">
        <?php 
echo $noticeCount > 0 ? $templates->botCommandButton('notice get ' . rand(0, $noticeCount - 1), 'Random Notice', 'default btn-sm') : '';
?>
        <?php 
echo $templates->botCommandButton('title', 'Announce Current Title', 'default btn-sm');
?>
        <?php 
echo $templates->botCommandButton('game', 'Announce Current Game', 'default btn-sm');
?>
        <?php 
echo $templates->botCommandButton('pausecommands', 'Pause Commands', 'default btn-sm');
?>
      </div>
      <div class="spacer"></div>
      <div class="btn-toolbar">
        <?php 
echo $templates->botCommandButton('unhost', 'Unhost', 'default btn-sm');
Esempio n. 12
0
        }
        $key = explode('=', $line)[0];
        $value = explode('=', $line)[1];
        switch ($key) {
            case 'lastAnnounce':
                $lastAnnouncement = date('D dS M Y @ h:i a', $value / 1000);
                break;
            case 'name':
                $marathonName = $value;
                break;
            case 'link':
                $marathonLink = $value;
                break;
            default:
                $splitValue = explode(';', $value);
                $scheduleTableRows .= '<tr><td>' . $splitValue[1] . '</td><td>' . date('D dS M Y @ h:i a', $splitValue[0] / 1000) . '</td><td>' . $templates->botCommandButton('marathon schedule delete ' . date('m/d H:i', $splitValue[0] / 1000), 'Clear', 'danger btn-sm') . '</td></tr>';
                break;
        }
    }
}
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Marathon System
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('marathonCommand.js'));
Esempio n. 13
0
$botSettings = $functions->getIniArray('settings');
$botStreamInfo = $functions->getIniArray('stream_info', true);
$noticeCount = $functions->getIniValueByKey('notice', 'num_messages');
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">Dashboard <span class="text-muted">Update stream info</span></h3>
    </div>
    <div class="panel-body">
      <h4>Quick Commands</h4>

      <div class="form-group form-group-sm">
        <div class="btn-group btn-group-sm">
          <?php 
echo $templates->botCommandButton('title', 'Announce Current Title');
?>
          <?php 
echo $templates->botCommandButton('game', 'Announce Current Game');
?>
        </div>
      </div>
      <div class="form-group">
        <div class="btn-group btn-group-sm">
          <?php 
echo $templates->botCommandButton('uptime', 'Announce Current Up-time');
?>
          <?php 
echo $templates->botCommandButton('botuptime', 'Announce Current Bot-up-time');
?>
        </div>
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>
Esempio n. 15
0
         $msgClass = 'whisper';
     }
 } else {
     $msgClass = '';
 }
 if (array_key_exists($command, $commandPermIni)) {
     $perm = $groups[getGroupId($commandPermIni[$command])];
 } elseif (array_key_exists($command . '_recursive', $commandPermIni)) {
     $perm = $groups[getGroupId($commandPermIni[$command . '_recursive'])] . '+';
 } else {
     $perm = 'Viewer';
 }
 if (preg_match('/\\([0-9]\\)|\\([.]{3}\\)/i', $message)) {
     $actor = $templates->botCommandForm($command, '', '!' . $command);
 } 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);
 }
Esempio n. 16
0
      <h3 class="panel-title">
        Slot Machine Command
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('slotMachineCommand.js'));
?>
      </h3>
    </div>
    <div class="panel-body">
      <div class="row">
        <div class="col-sm-8">
          <div class="btn-toolbar">
            <?php 
echo $templates->botCommandButton('slot', 'Play The Slots');
?>
            <?php 
echo $templates->botCommandButton('d !chat  NEW!!! The Slot Machine! type !slot to try your luck!', 'Hype The Slots');
?>
            <?php 
echo $templates->switchToggle('Toggle Cool Down Messages', 'doQuickCommand', '[\'slot CooldownMessages toggle\']', null, array_key_exists('slotCMessages', $slotMachineSettings) && $slotMachineSettings['slotCMessages'] == 1);
?>
          </div>
        </div>
        <div class="col-sm-4">
          <?php 
echo $templates->informationPanel('<p>Win points by hitting 3 of the same emotes in a row!</p>Emote 1 is most likely to triple while emote 7 is least likely to!');
?>
        </div>
      </div>
Esempio n. 17
0
$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">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Sound Effect Settings
        <?php 
echo $templates->toggleFavoriteButton();
?>
      </h3>
    </div>
    <div class="panel-body">
      <div class="btn-toolbar">
        <button class="btn btn-primary" onclick="openPopup('sound-effects-player.php', 'PhantomBot WebPanel Sound Effects')">Open Sfx Player</button>
Esempio n. 18
0
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('pollSystem.js'));
?>
      </h3>
    </div>
    <div class="panel-body">
      <h4>Start A New Vote</h4>

      <div class="row">
        <div class="col-sm-4">
          <?php 
echo $templates->botCommandForm('poll open', 'Start a normal poll', '[option1] [option2]');
?>
          <div class="form-group">
            <?php 
echo $templates->botCommandButton('poll close', 'End Current Poll');
?>
          </div>
        </div>
        <div class="col-sm-4">
          <?php 
echo $templates->botCommandForm('poll open -t', 'Start a timed poll', '[seconds] [option1] [option2]');
?>
        </div>
        <div class="col-sm-4">
          <?php 
echo $templates->informationPanel('To vote type <b>!vote "option"</b> in chat.');
?>
        </div>
      </div>
      <hr/>
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('subscribeHandler.js'));
?>
      </h3>
    </div>
    <div class="panel-body">
      <div class="btn-toolbar">
        <?php 
echo $templates->switchToggle('Toggle Subscriber Notices', 'doQuickCommand', '[\'subsilentmode\']', null, array_key_exists('sub_silentmode', $botSettings) && $botSettings['sub_silentmode'] == 1);
?>
        <div class="btn-group">
          <?php 
echo $templates->botCommandButton('subscribecount', 'Current Subscriber Count');
?>
          <?php 
echo $templates->botCommandButton('subscribemode', 'Subscribe Mode');
?>
        </div>
      </div>
      <hr/>
      <h4 class="collapsible-master">Subscriber Settings</h4>

      <div class="collapsible-content">
        <div class="row">
          <div class="col-sm-4">
            <?php 
echo $templates->botCommandForm('subscribemessage', 'Message on subscription', '[message]', array_key_exists('subscribemessage', $botSettings) ? $botSettings['subscribemessage'] : 'Thanks for the subscription (name)!');
?>
        continue;
    }
    if (preg_match('/(.*)\\s-\\s(.+?)$/', $functions->cleanYTVideoTitle($item), $matches)) {
        $requestQueueDataRows .= '<tr><td>' . ($requestQueueLength + 1) . '.</td><td>' . $matches[1] . '</td><td>' . $matches[2] . '</td></tr>';
        ++$requestQueueLength;
    } else {
        $requestQueueDataRows .= '<tr><td colspan="2">Could not parse the song queue. Make sure the file location is correct in Extras->Preferences.</td></tr>';
        break;
    }
}
foreach ($defaultPlaylist as $item) {
    if (trim($item) == '') {
        continue;
    }
    if (preg_match('/(.{1,11})\\s[0-9]+\\.\\s(.*)/', $functions->cleanYTVideoTitle($item), $matches)) {
        $defaultPlaylistDataRows .= '<tr><td>' . ($defaultPlaylistLength + 1) . '.</td><td>' . trim($matches[2]) . '</td><td><div class="btn-toolbar">' . $templates->botCommandButton('playsong ' . $matches[1], '<span class="fa fa-play"></span>', 'success btn-sm') . $templates->botCommandButton('defaultdelsong ' . str_replace('https://youtube.com/watch?v=', '', $matches[1]), '<span class="fa fa-trash"></span>', 'danger btn-sm') . $templates->botCommandButton('d !chat Youtube link for ' . $matches[2] . ' -> http://youtube.com/watch?v=' . $matches[1], 'Link In Chat', 'default btn-sm') . '</div></td></tr>';
        ++$defaultPlaylistLength;
    } else {
        $defaultPlaylistDataRows .= '<tr><td colspan="3">Could not parse the default Playlist. Make sure the file location is correct in Extras->Preferences and the playlist has been parsed by the bot.</td></tr>';
        break;
    }
}
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Youtube Player Settings
        <?php 
echo $templates->toggleFavoriteButton();
?>
}
$dataStore = new \PBPanel\Util\DataStore();
$connection = new \PBPanel\Util\BotConnectionHandler($dataStore);
$functions = new \PBPanel\Util\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$botSettings = $functions->getDbTableArray('settings');
$youtubePlayerSettings = $functions->getDbTableArray('youtubePlayer');
$requestQueue = preg_split('/\\n/', trim($functions->getOtherFile($dataStore->getVar('paths', 'youtubePlaylist'))));
$defaultPlaylist = preg_split('/\\n/', trim($functions->getOtherFile($dataStore->getVar('paths', 'defaultYoutubePlaylist'))));
$defaultPlaylistLength = 0;
$requestQueueLength = 0;
$requestQueueDataRows = '';
$defaultPlaylistDataRows = '';
foreach ($defaultPlaylist as $item) {
    preg_match('/[0-9]+\\.\\s(.*)\\s\\(([a-z0-9=?\\/.:_-]+)\\)$/i', $functions->cleanYTVideoTitle($item), $matches);
    $defaultPlaylistDataRows .= '<tr><td>' . ($defaultPlaylistLength + 1) . '.</td><td>' . trim($matches[1]) . '</td><td><div class="btn-toolbar" style="width:125px;">' . $templates->botCommandButton('playsong ' . str_replace('https://youtube.com/watch?v=', '', $matches[2]), '<span class="fa fa-play"></span>', 'success btn-sm') . $templates->botCommandButton('musicplayer deldefault ' . $defaultPlaylistLength, '<span class="fa fa-trash"></span>', 'danger btn-sm') . $templates->botCommandButton('d !chat Youtube link for ' . $matches[1] . ' -> ' . $matches[2], '<span class="fa fa-link"></span>', 'default btn-sm') . '</div></td></tr>';
    ++$defaultPlaylistLength;
}
foreach ($requestQueue as $item) {
    if ($item == '') {
        continue;
    }
    preg_match('/(.*)\\s\\(.+\\s([a-z0-9_]+)\\)$/i', $functions->cleanYTVideoTitle($item), $matches);
    $requestQueueDataRows .= '<tr><td>' . ($requestQueueLength + 1) . '.</td><td>' . $matches[1] . '</td><td>' . $matches[2] . '</td></tr>';
    ++$requestQueueLength;
}
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
Esempio n. 22
0
 */
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();
$quotes = $functions->getDbTableArray('quotes');
$quotesDataRows = '';
foreach ($quotes as $id => $quote) {
    $quote = json_decode($quote);
    $quotesDataRows .= '<tr><td>' . $templates->botCommandButton('quote ' . $id, $id) . '</td><td>' . $quote[0] . '</td><td>' . $quote[1] . '</td><td>' . $functions->secondsToDate(floor($quote[2] / 1000)) . '</td></tr>';
}
?>
<!--suppress HtmlUnknownTarget -->
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Quote System
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('quoteSystem.js'));
?>
      </h3>