<?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]"');
}
Ejemplo n.º 2
0
 * 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) {
    $pastRaidersTableRows .= '<tr><td>' . str_replace('_count', '', $username) . '</td><td>' . $timesRaided . ' raids</td></tr>';
}
?>
<div class="app-part">
  <div class="panel panel-default">
Ejemplo n.º 3
0
     if (array_key_exists('uri', $input)) {
         $functions->getIniArray($input['uri'], false);
     } else {
         $functions->sendBackError('Missing ini uri');
     }
     break;
 case 'getOtherFile':
     if (array_key_exists('uri', $input)) {
         $functions->getOtherFile($input['uri'], false);
     } else {
         $functions->sendBackError('Missing ini uri');
     }
     break;
 case 'getIniValueByKey':
     if (array_key_exists('uri', $input) && array_key_exists('key', $input)) {
         $functions->sendBackOk($functions->getIniValueByKey($input['uri'], $input['key']));
     } else {
         $functions->sendBackError('Missing parameters');
     }
     break;
 case 'getCurrentTitle':
     $functions->getCurrentTitle();
     break;
 case 'getMusicPlayerPlaylist':
     $functions->sendBackOk($functions->getMusicPlayerPlaylist($dataStore->getVar('paths', 'youtubePlaylist')));
     break;
 case 'saveToConfig':
     if (array_key_exists('settingPath', $input) && array_key_exists('setting', $input)) {
         $path = explode('/', $input['settingPath']);
         if ($dataStore->setVar($path[0], $path[1], $input['setting'])) {
             $functions->sendBackOk('Setting Saved');
/**
 * 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"
        rel="stylesheet" type="text/css"/>
  <link rel="icon" href="../../favicon.ico" type="image/x-icon"/>
Ejemplo n.º 5
0
echo $templates->botCommandButton('reloadplaylist', 'Reload "playlist.txt"');
?>
      </div>
      <hr/>
      <h4 class="collapsible-master">Player Settings</h4>

      <div class="collapsible-content">
        <div class="row">
          <div class="col-sm-4">
            <?php 
echo $templates->botCommandForm('musicplayer limit', 'Request Limit per viewer', '[amount]', array_key_exists('song_limit', $botSettings) ? $botSettings['song_limit'] : '', 'Limit');
?>
          </div>
          <div class="col-sm-4">
            <?php 
echo $templates->botCommandForm('pricecom addsong', '!addsong price', '[amount]', $functions->getIniValueByKey('pricecom', 'addsong'), 'Set');
?>
          </div>
        </div>
      </div>
      <hr/>
      <div class="row">
        <div class="col-sm-4">
          <?php 
echo $templates->botCommandForm('addsong', 'Add song to the queue', '[youtube url]', null, 'Add');
?>
        </div>
        <div class="col-sm-4">
          <?php 
echo $templates->botCommandForm('delsong', 'Remove song from queue', '[youtube url]', null, 'Del');
?>
$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;
$NOSubscribers = -1;
$partsList = $functions->getPartsList();
$renderedMenu = '';
foreach ($partsList as $parentName => $subItems) {
    $parentId = 'menu-parent-' . $parentName;
    $renderedMenu .= '<li class="dropdown" id="' . $parentId . '"><a nohref class="dropdown-toggle" role="button">' . ucwords($parentName) . '</a><ul class="dropdown-menu" role="menu">';
    $icon = 'fa-cog';
    switch ($parentName) {
        case 'games':
            $icon = 'fa-gamepad';
            break;
        case 'extras':
Ejemplo n.º 7
0
 * 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">
          <?php 
echo $templates->botCommandButton('title', 'Announce Current Title');
?>
          <?php