Example #1
0
require dirname(__FILE__) . "/incl/_header.php";
$json = file_get_contents("http://tvhackday.mixd.tv/sources/?api_key=" . apikey . "");
print_r($json);
$json_array = json_decode($json, true);
foreach ($json_array as $k => $v_array) {
    if (is_array($v_array)) {
        foreach ($v_array as $kk) {
            // query("INSERT IGNORE INTO sources (source,entityid) VALUES (".escapesql($kk["name"]).",".escapesql($kk["entityId"]).")");
        }
    }
}
$getsources = query("SELECT * FROM sources WHERE use_yes=1 AND `ignore`=0 LIMIT 10");
foreach ($getsources as $k => $row_array) {
    //$row_array["entityid"]='dca4e533-6bf5-58e1-972c-ad7f1651ddb7';
    $url = "http://tvhackday.mixd.tv/video-list/" . $row_array["entityid"] . "/?api_key=" . apikey . "&format=json";
    $json = loadf("geturldata", $url);
    $json_array = json_decode($json, true);
    $json_array = $json_array["msg"]["data"];
    // print_r($json_array);exit;
    if (!is_array($json_array)) {
        echo 'error:' . $row_array["source"];
    } else {
        query("UPDATE sources SET use_yes=1 WHERE sources_id=" . $row_array["sources_id"]);
        foreach ($json_array as $k => $v_array) {
            if (is_array($v_array)) {
                $epgData = '[]';
                foreach ($v_array as $v => $kk) {
                    if (!is_array($kk)) {
                        ${$v} = utf8_decode($kk);
                    } else {
                        ${$v} = utf8_decode(json_encode($kk));
Example #2
0
<?php

require dirname(__FILE__) . "/session.php";
if (!isset($_SESSION['loggedin']) || empty($_SESSION['loggedin'])) {
    if (loadf("autologin") != 1) {
        header('Location: ' . URL . 'login.php');
        exit;
    } else {
        define("session_yes", true);
    }
} else {
    define("session_yes", true);
}
Example #3
0
<?php

require dirname(__FILE__) . "/incl/init.php";
$msg = '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if (empty($_POST['username']) || empty($_POST['password'])) {
        header('Location: ' . URL);
        exit;
    }
    require dirname(__FILE__) . "/incl/session.php";
    $login_username = $_POST['username'];
    $login_password = $_POST['password'];
    $login = loadf("autologin", $_POST['username'], $_POST['password']);
    if ($login == 1) {
        header('Location: ' . URL . 'index.php');
        exit;
    } else {
        if ($login == -2) {
            $msg = "Dieses Benutzerkonto ist nicht für dieses Profil konfiguriert. Bitte überprüfen Sie die Berechtigung für die Region.";
        } else {
            $msg = "Bitte prüfen Sie Benutzername und Passwort";
        }
    }
}
require dirname(__FILE__) . "/incl/_header.php";
?>
<div class="container">
	<div class="row">
		<div class="col-sm-6 col-md-4 col-md-offset-4">
			<h1 class="text-center login-title"><?php 
echo calltext("LOGIN_TITLE");