Ejemplo n.º 1
0
 * 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];
        switch ($key) {
            case 'lastAnnounce':
                $lastAnnouncement = date('D dS M Y @ h:i a', $value / 1000);