/**
 * dashboard.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:41
 */
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();
$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">
Exemple #2
0
<?php

/**
 * login.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:46
 */
require_once '../../AppLoader.class.php';
\PBPanel\AppLoader::load();
$dataStore = new \PBPanel\Util\DataStore();
$connection = new \PBPanel\Util\BotConnectionHandler($dataStore);
$functions = new \PBPanel\Util\Functions($dataStore, $connection);
$input = filter_input_array(INPUT_POST);
if (!array_key_exists('username', $input) || trim($input['username']) == '') {
    $functions->sendBackError('No username defined', 203);
} elseif (!array_key_exists('password', $input) || trim($input['password']) == '') {
    $functions->sendBackError('No password defined', 203);
} elseif (!$functions->isValidUser($input['username'], $input['password'])) {
    $functions->sendBackError('No Access', 203);
} else {
    $functions->sendBackOk(true);
}
/**
 * bank-heist.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:40
 */
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();
$botSettings = $functions->getIniArray('settings');
$bankHeistTimers = $functions->getIniArray('bankheist_timers', true);
$bankHeistStrings = $functions->getIniArray('bankheist_strings', true);
$bankHeistRatios = $functions->getIniArray('bankheist_ratios', true);
$bankHeistChances = $functions->getIniArray('bankheist_chances', true);
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Bank Heist
        <?php 
echo $templates->toggleFavoriteButton();
?>
/**
 * raiders.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:44
 */
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();
$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) {
/**
 * commands.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:42
 */
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();
$botSettings = $functions->getIniArray('settings');
$groups = $functions->getIniArray('groups');
$customCommandsIni = $functions->getIniArray('command');
$commandAliasIni = $functions->getIniArray('aliases');
$commandPriceIni = $functions->getIniArray('pricecom');
$commandPermIni = $functions->getIniArray('permcom');
$commandCooldown = $functions->getIniArray('coolcom');
$defaultCommands = [];
$pointNames = [array_key_exists('pointNameMultiple', $botSettings) ? $botSettings['pointNameMultiple'] : 'points', array_key_exists('pointNameSingle', $botSettings) ? $botSettings['pointNameSingle'] : 'point'];
$customCommandsTableRows = '';
$defaultCommandsTableRows = '';
foreach ($customCommandsIni as $command => $message) {
    $commandAliases = [];
    foreach ($commandAliasIni as $alias => $originalCommand) {
<?php

/**
 * Created by PhpStorm.
 * User: Robin | Juraji
 * Date: 10-12-2015
 * Time: 19:49
 */
require_once '../../AppLoader.class.php';
\PBPanel\AppLoader::load();
$dataStore = new \PBPanel\Util\DataStore();
$connection = new PBPanel\Util\BotConnectionHandler($dataStore);
$functions = new \PBPanel\Util\Functions($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
// Call this file like ".../external-example2.php?username=[USERNAME]"
$username = filter_input(INPUT_GET, 'username');
if ($username) {
    $singleUserPoints = $functions->getIniValueByKey('points', strtolower($username), true);
} else {
    die('Call this file like ".../external-example2.php?username=[USERNAME]"');
}
?>
<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title></title>
  <link href="app/css/<?php 
echo $dataStore->getVar('misc', 'theme', 'style_dark');
?>
.css"
<?php

/**
 * Created by PhpStorm.
 * User: Robin | Juraji
 * Date: 10-12-2015
 * Time: 19:49
 */
require_once '../../AppLoader.class.php';
\PBPanel\AppLoader::load();
$dataStore = new \PBPanel\Util\DataStore();
$connection = new PBPanel\Util\BotConnectionHandler($dataStore);
$functions = new \PBPanel\Util\Functions($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
// Call this file like ".../external-example2-api-like.php?username=[USERNAME]"
$username = filter_input(INPUT_GET, 'username');
if ($username) {
    $userTime = intval($functions->getIniValueByKey('time', strtolower($username), true));
    echo json_encode(['username' => $username, 'points' => $functions->getIniValueByKey('points', strtolower($username), true), 'timeInSeconds' => $userTime, 'timeHMS' => sprintf("%02d%s%02d%s%02d", floor($userTime / 3600), ':', $userTime / 60 % 60, ':', $userTime % 60)]);
} else {
    die('Call this file like ".../external-example2-api-like.php?username=[USERNAME]"');
}
/**
 * modules.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:39
 */
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();
$moduleSettingsIni = $functions->getIniArray('modules');
$modulesTableRows = '';
$moduleNameReplacements = ['./', '_enabled'];
$NOModulesActive = 0;
uksort($moduleSettingsIni, function ($a, $b) use($moduleNameReplacements) {
    return strcasecmp(str_replace($moduleNameReplacements, '', $a), str_replace($moduleNameReplacements, '', $b));
});
foreach ($moduleSettingsIni as $fullPath => $active) {
    if (strpos($fullPath, 'lang-') > -1) {
        continue;
    }
    $moduleName = ucfirst(str_replace($moduleNameReplacements, '', $fullPath));
    $moduleFullPath = str_replace('_enabled', '', $fullPath);
    $active = $active == 1 || strpos($moduleFullPath, 'util') > -1;
/**
 * slot-machine.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:41
 */
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();
$slotMachineSettings = $functions->getIniArray('slotMachine');
$priceComSettings = $functions->getIniArray('pricecom');
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Slot Machine Command
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('slotMachineCommand.js'));
?>
<?php

/**
 * Created by PhpStorm.
 * User: Robin | Juraji
 * Date: 10-12-2015
 * Time: 19:49
 */
require_once '../../AppLoader.class.php';
\PBPanel\AppLoader::load();
$dataStore = new \PBPanel\Util\DataStore();
$connection = new PBPanel\Util\BotConnectionHandler($dataStore);
$functions = new \PBPanel\Util\Functions($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$userPoints = $functions->getIniArray('points');
$customCommands = $functions->getIniArray('command');
$userPointsDataRows = '';
$customCommandsDataRows = '';
foreach ($userPoints as $user => $points) {
    $userPointsDataRows .= '<tr><td>' . $user . '</td><td>' . $points . '</td></tr>';
}
foreach ($customCommands as $command => $output) {
    $customCommandsDataRows .= '<tr><td>!' . $command . '</td><td>' . $output . '</td></tr>';
}
?>
<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title></title>
  <link href="app/css/<?php 
/**
 * part-template.php
 * 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();
$alertCSSFields = ['followerAlertCSS', 'hostAlertCSS', 'subscribeAlertCSS', 'donationAlertCSS'];
foreach ($alertCSSFields as $alertCSSField) {
    if (trim($dataStore->getVar('streamalertsettings', $alertCSSField)) == '') {
        $dataStore->setVar('streamalertsettings', $alertCSSField, $functions->getDefaultAlertCSS());
    }
}
?>
<div class="app-part">
  <script src="app/js/codemirror.min.js" type="text/javascript"></script>
  <script src="app/js/cm-css.min.js" type="text/javascript"></script>
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Stream Alerts
/**
 * part-template.php
 * 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();
$botSettings = $functions->getIniArray('settings');
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        MODULE NAME
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('MODULE SCRIPT NAME'));
?>
      </h3>
/**
 * part-template.php
 * 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();
$botSettings = $functions->getIniArray('settings');
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Donations
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('./handlers/donationHandler.js'));
?>
      </h3>
/**
 * marathon.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:40
 */
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();
$timezoneSettings = $functions->getIniArray('timezone');
$marathonSettings = $functions->getIniRaw('marathon', true);
$lastAnnouncement = null;
$marathonName = null;
$marathonLink = null;
$scheduleTableRows = '';
$marathonSettings = explode(PHP_EOL, $marathonSettings);
if ($marathonSettings) {
    foreach ($marathonSettings as $line) {
        if ($line == '') {
            continue;
        }
        $key = explode('=', $line)[0];
        $value = explode('=', $line)[1];
<?php

/**
 * Created by PhpStorm.
 * User: Robin | Juraji
 * Date: 14-12-2015
 * Time: 15:34
 */
require_once '../AppLoader.class.php';
\PBPanel\AppLoader::load();
$dataStore = new \PBPanel\Util\DataStore();
$connection = new \PBPanel\Util\BotConnectionHandler($dataStore);
$functions = new \PBPanel\Util\Functions($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$fileName = filter_input(INPUT_GET, 'file');
$logDataRows = '';
if ($fileName) {
    $logFileContents = preg_split('/\\n/', trim($functions->getOtherFile($fileName)));
    foreach ($logFileContents as $line) {
        $logDataRows .= '<tr><td>' . $line . '</td></tr>';
    }
}
?>
<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title></title>
  <link href="app/css/<?php 
echo $dataStore->getVar('misc', 'theme', 'style_dark');
?>
Exemple #16
0
/**
 * polls.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:41
 */
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();
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Poll System
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('pollSystem.js'));
?>
      </h3>
    </div>
<?php

/**
 * Created by PhpStorm.
 * User: Robin | Juraji
 * Date: 3-12-2015
 * Time: 03:43
 */
require_once 'AppLoader.class.php';
\PBPanel\AppLoader::load();
$dataStore = new \PBPanel\Util\DataStore();
$connection = new \PBPanel\Util\BotConnectionHandler($dataStore);
$functions = new \PBPanel\Util\Functions($dataStore, $connection);
$eventServerAdress = $dataStore->getVar('connector', 'botIp') . ':' . (intval($dataStore->getVar('connector', 'botBasePort')) + 2);
?>
<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title></title>
  <link href="app/css/music-player.css" rel="stylesheet" type="text/css"/>
  <link rel="icon" href="/favicon.ico" type="image/x-icon"/>
  <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'));
?>
/**
 * greetings.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:42
 */
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();
$greetingSettings = $functions->getIniArray('greeting');
$userGreetingRows = '';
foreach ($greetingSettings as $username => $greeting) {
    if (!in_array($username, ['autogreet', '_default'])) {
        $userGreetingRows .= '<tr><td>' . ucfirst($username) . '</td><td>' . $greeting . '</td></tr>';
    }
}
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Greeting System
        <?php 
<?php

/**
 * connect.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:46
 */
require_once '../../AppLoader.class.php';
\PBPanel\AppLoader::load();
$dataStore = new \PBPanel\Util\DataStore();
$connection = new \PBPanel\Util\BotConnectionHandler($dataStore);
$functions = new \PBPanel\Util\Functions($dataStore, $connection);
$input = filter_input_array(INPUT_POST);
if (!array_key_exists('username', $input) || !array_key_exists('password', $input) || !$functions->isValidUser($input['username'], $input['password'])) {
    $functions->sendBackError('No login');
    exit;
}
if (array_key_exists('action', $input) && $input['action'] != '') {
    $action = $input['action'];
    switch ($action) {
        case 'config':
            $functions->getJSConfig();
            break;
        case 'getConfig':
            $functions->getConfig();
            break;
        case 'command':
            if (array_key_exists('command', $input) && $input['username']) {
                echo json_encode($connection->send('!' . $input['command'], array_key_exists(strtolower($input['username']), $functions->getIniArray('visited')) ? $input['username'] : $dataStore->getVar('connector', 'channelOwner')));
<?php

/**
 * control-panel.php
 * 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();
$dataStore = new PBPanel\Util\DataStore();
$connection = new \PBPanel\Util\BotConnectionHandler($dataStore);
$functions = new \PBPanel\Util\Functions($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
if (\PBPanel\AppLoader::runInstall($dataStore)) {
    require_once 'install.php';
    exit;
}
if (\PBPanel\AppLoader::updateAvailable($dataStore)) {
    require_once 'update.php';
    exit;
}
$session->createToken();
$botSettings = $functions->getIniArray('settings');
$isBotOnline = $connection->testConnection()[2] == 52;
$hostHandlerActive = $functions->getIniValueByKey('modules.ini', 'hostHandler.js', true);
$subscribeHandlerActive = $functions->getIniValueByKey('modules.ini', 'subscribeHandler.js', true);
$musicPlayerCurrentSong = $functions->getOtherFile($dataStore->getVar('paths', 'youtubeCurrentSong'));
$NOHosts = -1;
Exemple #21
0
/**
 * groups.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:42
 */
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();
$botSettings = $functions->getIniArray('settings');
$groups = $functions->getIniArray('groups');
$viewerGroups = $functions->getIniArray('group');
$groupTableRows = '';
$viewerGroupTableRows = '';
foreach ($groups as $gid => $gName) {
    $groupTableRows .= '<tr><td>' . $gid . '</td><td>' . $gName . '</td></tr>';
}
foreach ($viewerGroups as $username => $gid) {
    if ($gid != 'null') {
        $viewerGroupTableRows .= '<tr><td>' . ucfirst($username) . '</td><td>' . $groups[$gid] . '</td></tr>';
    }
}
?>
/**
 * notices.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:43
 */
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();
$botSettings = $functions->getIniArray('settings');
$noticeSettings = $functions->getIniArray('notice');
$notices = $functions->getIniArray('notices');
$noticesTableRows = '';
foreach ($notices as $nid => $message) {
    $noticesTableRows .= '<tr><td>' . str_replace('message_', '', $nid) . '</td><td>' . $message . '</td></tr>';
}
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Notice System
        <?php 
Exemple #23
0
/**
 * quotes.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:44
 */
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();
$botSettings = $functions->getIniArray('settings');
$quotes = $functions->getIniArray('quotes');
$quotesTableRows = '';
unset($quotes['num_quotes']);
foreach ($quotes as $quoteId => $quoteMessage) {
    $quotesTableRows .= '<tr><td>' . str_replace('quote_', '', $quoteId) . '</td><td>' . $quoteMessage . '</td></tr>';
}
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Quote System
        <?php 
/**
 * part-template.php
 * 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();
$botSettings = $functions->getIniArray('settings');
$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 ($requestQueue as $item) {
    if (trim($item) == '') {
        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;
/**
 * part-template.php
 * 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();
$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>';
/**
 * chat-moderator.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:41
 */
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();
$botSettings = $functions->getIniArray('settings');
$urlWhiteList = $functions->getIniArray('whitelist');
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Chat Moderator
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <?php 
echo $templates->moduleActiveIndicator($functions->getModuleStatus('chatModerator.js'));
?>
/**
 * preferences.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:40
 */
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();
$botSettings = $functions->getIniArray('settings');
$currentTheme = $dataStore->getVar('misc', 'theme', 'style_dark');
$themeFiles = new \PBPanel\Util\SortedDirectoryIterator(\PBPanel\AppLoader::getBaseDir() . '/app/css', false);
$themesOptions = '';
/* @var \DirectoryIterator $themeFile */
foreach ($themeFiles as $themeFile) {
    if ($themeFile->getExtension() == 'css' && strpos($themeFile->getBasename(), 'style_') === 0) {
        $themesOptions .= '<option value="' . $themeFile->getBasename('.css') . '">' . ucfirst(str_replace('style_', '', $themeFile->getBasename('.css'))) . '</option>';
    }
}
?>
<script>
  $('#toggle-information-button').prop('checked', pBotStorage.get(pBotStorage.keys.informationActive, true));
  $('#toggle-tooltips-button').prop('checked', !pBotStorage.get(pBotStorage.keys.tooltipsActive, false));
/**
 * time-system.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:45
 */
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();
$filter = filter_input_array(INPUT_POST);
$botSettings = $functions->getIniArray('settings');
$time = $functions->getIniArray('time');
$timeTableRows = '';
if (!is_array($filter)) {
    $filter = [];
}
if (array_key_exists('time', $filter)) {
    if ($filter['time'] == 'ASC') {
        asort($time, SORT_NATURAL);
    }
    if ($filter['time'] == 'DESC') {
        arsort($time, SORT_NATURAL);
    }
/**
 * subscribe-events.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:45
 */
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();
$botSettings = $functions->getIniArray('settings');
$subscribers = $functions->getIniArray('subscribed');
$subscriberTableRows = '';
foreach ($subscribers as $username => $subscribed) {
    if ($subscribed == 1) {
        $subscriberTableRows .= '<tr><td>' . ucfirst($username) . '</td></tr>';
    }
}
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Subscriber Events
Exemple #30
0
/**
 * points.php
 * Created with PhpStorm
 * User: Robin | Juraji
 * Date: 12 okt 2015
 * Time: 12:44
 */
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();
$filter = filter_input_array(INPUT_POST);
$botSettings = $functions->getIniArray('settings');
$points = $functions->getIniArray('points');
$pointsTableRows = '';
$totalPoints = 0;
$pointsName = ' ' . (array_key_exists('pointNameMultiple', $botSettings) ? $botSettings['pointNameMultiple'] : 'points');
if (!is_array($filter)) {
    $filter = [];
}
if (array_key_exists('points', $filter)) {
    if ($filter['points'] == 'MAX') {
        $points = array_filter($points, function ($value) {
            return intval($value) > 1500;
        });