Example #1
0
/**
 * 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\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$botSettings = $functions->getDbTableArray('settings');
$groups = $functions->getDbTableArray('groups');
$customCommandsIni = $functions->getDbTableArray('command');
$commandAliasIni = $functions->getDbTableArray('aliases');
$commandPriceIni = $functions->getDbTableArray('pricecom');
$commandPermIni = $functions->getDbTableArray('permcom');
$commandCooldown = $functions->getDbTableArray('commandCooldown');
$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) {
/**
 * 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\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$pointSettings = $functions->getDbTableArray('pointSettings');
$heistSettings = $functions->getDbTableArray('adventureSettings');
$rouletteSettings = $functions->getDbTableArray('roulette');
?>
<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>
<?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\FunctionLibrary($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->getDbTableValueByKey('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"
Example #4
0
/**
 * 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\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$pointSettings = $functions->getDbTableArray('pointSettings');
$raffleFiles = array_reverse(preg_split('/\\n/', trim($functions->getOtherFile('./addons/raffleSystem/'))));
$previousRaffleFileDataRows = '';
foreach ($raffleFiles as $id => $raffleFile) {
    if ($raffleFile == '') {
        continue;
    }
    $fileContents = preg_split('/\\n/', str_replace('New Raffle: ', '', $functions->getOtherFile('./addons/raffleSystem/' . $raffleFile)));
    $previousRaffleFileDataRows .= '<tr>' . '<td>' . getRaffleFileDateString($raffleFile) . ($id == 0 ? '<br /><span class="text-muted">(Entire file)</span>' : '') . '</td>' . '<td>' . ($id == 0 ? join('<br />', $fileContents) : $fileContents[0]) . '</td>' . '</tr>';
}
function getRaffleFileDateString($raffleFile)
{
    $raffleFile = str_replace(['raffle_', '.txt'], '', $raffleFile);
    $fileDate = DateTime::createFromFormat('d-m-Y_G:i:s_e', $raffleFile);
/**
 * 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\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
Example #6
0
<?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\FunctionLibrary($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->getDbTableArray('visited')) ? $input['username'] : $dataStore->getVar('connector', 'channelOwner')));
/**
 * 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\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$botSettings = $functions->getDbTableArray('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));
<?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\FunctionLibrary($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->getDbTableValueByKey('time', strtolower($username), true));
    echo json_encode(['username' => $username, 'points' => $functions->getDbTableValueByKey('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]"');
}
Example #9
0
<?php

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();
$phpInput = $functions->getPhpInput();
$minTimeSec = 3600;
$viewersDataRows = '';
$groups = $functions->getDbTableArray('groups');
$psName = ucfirst($functions->getDbTableValueByKey('pointSettings', 'pointNameMultiple'));
$followers = $functions->getDbTableArray('followed');
$viewerGroups = $functions->getDbTableArray('group');
$lastSeen = $functions->getDbTableArray('lastseen');
$viewerRanks = $functions->getDbTableArray('viewerRanks');
$viewerPoints = $functions->getDbTableArray('points');
$viewerTime = $functions->getDbTableArray('time');
$incRaids = $functions->getDbTableArray('incommingRaids');
if ($psName == '0') {
    $psName = 'Points';
}
if (array_key_exists('time', $phpInput)) {
    $minTimeSec = intval($phpInput['time']);
}
$viewers = array_filter(array_keys($viewerTime), function ($username) use($viewerTime, $minTimeSec) {
Example #10
0
<?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\FunctionLibrary($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');
?>
/**
 * 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\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 
Example #12
0
/**
 * 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\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$botSettings = $functions->getDbTableArray('settings');
$botStreamInfo = $functions->getDbTableArray('streamInfo');
$noticeCount = count($functions->getDbTableArray('notices'));
$latestFollower = checkFile($functions->getOtherFile($dataStore->getVar('paths', 'latestFollower')));
$latestDonator = checkFile($functions->getOtherFile($dataStore->getVar('paths', 'latestDonation')));
function checkFile($file)
{
    return trim($file) == '' || substr(trim($file), 0, 1) == '<' ? false : $file;
}
?>
<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>
Example #13
0
/**
 * 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\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$greetingSettings = $functions->getDbTableArray('greeting');
$userGreetingRows = '';
foreach ($greetingSettings as $username => $greeting) {
    if (!in_array($username, ['_default', 'autoGreetEnabled'])) {
        $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 
/**
 * 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\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$botSettings = $functions->getDbTableArray('settings');
$chatModSettings = $functions->getDbTableArray('chatModerator');
?>
<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'));
?>
Example #15
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\FunctionLibrary($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);
}
/**
 * Created by IntelliJ IDEA.
 * User: Robin | Juraji
 * Date: 6-2-2016
 * Time: 17:31
 */
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);
$phpInput = $functions->getPhpInput();
if (array_key_exists('type', $phpInput) && array_key_exists('input', $phpInput)) {
    $values = [];
    if ($phpInput['type'] == 'command' || $phpInput['type'] == 'all') {
        $values = array_merge($values, array_keys($functions->getDbTableArray('command')), loadDefaultCommands());
    }
    if ($phpInput['type'] == 'user' || $phpInput['type'] == 'all') {
        $values = array_merge($values, array_keys($functions->getDbTableArray('time')));
    }
    sort($values);
    sendMatches(array_filter($values, function ($value) use($phpInput) {
        return strpos($value, $phpInput['input']) > -1;
    }));
}
function sendMatches($matches)
/**
 * 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\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$botSettings = $functions->getDbTableArray('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>
Example #18
0
/**
 * 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\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$botSettings = $functions->getDbTableArray('settings');
$incommingRaids = $functions->getDbTableArray('incommingRaids');
$outgoingRaids = $functions->getDbTableArray('outgoingRaids');
$incommingRaidsDataRows = '';
$outgoingRaidsDataRows = '';
foreach ($incommingRaids as $username => $count) {
    $incommingRaidsDataRows .= '<tr><td>' . $username . '</td><td>' . $count . '</td></tr>';
}
foreach ($outgoingRaids as $username => $count) {
    $outgoingRaidsDataRows .= '<tr><td>' . $username . '</td><td>' . $count . '</td></tr>';
}
?>
<div class="app-part">
  <div class="panel panel-default">
/**
 * 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\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$botModules = $functions->getDbTableArray('modules');
$modulesTableRows = '';
$NOModules = 0;
$NOModulesActive = 0;
ksort($botModules);
foreach ($botModules as $modulePath => $status) {
    if (strpos($modulePath, './lang') > -1) {
        continue;
    }
    $NOModules++;
    if ($functions->strToBool($status)) {
        $NOModulesActive++;
    }
    $toggle = $templates->switchToggle('', $templates->_wrapInJsToggledDoQuickCommand('module', $functions->strToBool($status) ? 'true' : 'false', 'disable ' . $modulePath, 'enable ' . $modulePath), null, null, $functions->strToBool($status), false, true, false, strpos($modulePath, './core') > -1);
<?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\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$userPoints = $functions->getDbTableArray('points');
$customCommands = $functions->getDbTableArray('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 
<?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\FunctionLibrary($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->getDbTableArray('settings');
$isBotOnline = $connection->testConnection()[2] == 52;
$hostHandlerActive = $functions->getDbTableValueByKey('modules.ini', 'hostHandler.js', true);
$subscribeHandlerActive = $functions->getDbTableValueByKey('modules.ini', 'subscribeHandler.js', true);
$musicPlayerCurrentSong = $functions->getOtherFile($dataStore->getVar('paths', 'youtubeCurrentSong'));
$NOHosts = -1;
/**
 * host-events.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\FunctionLibrary($dataStore, $connection);
$templates = new \PBPanel\Util\ComponentTemplates();
$botSettings = $functions->getDbTableArray('settings');
?>
<div class="app-part">
  <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>
/**
 * 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\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) {
Example #24
0
/**
 * 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\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