Exemple #1
0
        $frageObj->Frage = $frage;
        $frageObj->{'Antwort A'} = $rAntwort;
        $frageObj->{'Antwort B'} = $bAntwort;
        $frageObj->{'Antwort C'} = $cAntwort;
        $frageObj->{'Antwort D'} = $dAntwort;
        $frageObj->Schwierigkeit = $schwer;
        $frageObj->Quelle = "Portal";
        $frageObj->Überprüft = "Nein";
        $frageObj->{'Richtige Antwort'} = $rAntwort;
        $frageObj->Ersteller = $email;
        $frageObj->{'Antwort Buchstabe'} = "A";
        array_push($json->questions, $frageObj);
        $datei = fopen('questions/' . $dateiname . '.json', 'w+');
        $string = json_encode($json, JSON_PRETTY_PRINT);
        $string = preg_replace_callback('/\\\\u([0-9a-fA-F]{4})/', function ($match) {
            return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UTF-16BE');
        }, $string);
        fwrite($datei, $string);
        fclose($datei);
        return $app['templating']->render('success.html.php', array());
    } else {
        $array = loadTopics();
        return $app['templating']->render('service.html.php', array("files" => $array, "error" => false, "neuFalse" => false));
    }
});
$app->match('//', function (Request $request) use($app) {
    return $app['templating']->render('game.html.php', array());
});
$app->match('/game/', function (Request $request) use($app) {
    return $app['templating']->render('game.html.php', array());
});
Exemple #2
0
     if (isset($_REQUEST['last'])) {
         $last = $_REQUEST['last'];
     }
     $orderby = 0;
     if (isset($_REQUEST['orderby'])) {
         $orderby = $_REQUEST['orderby'];
     }
     $start = 0;
     if (isset($_REQUEST['start'])) {
         $start = $_REQUEST['start'];
     }
     $limit = 0;
     if (isset($_REQUEST['limit'])) {
         $limit = $_REQUEST['limit'];
     }
     loadTopics($publisher, $categoryid, $start, $limit, $last, $orderby, $query);
     break;
 case "load_topic_categories":
     $threadid = "";
     if (isset($_REQUEST['threadid'])) {
         $threadid = $_REQUEST['threadid'];
     }
     loadTopicCategories($threadid);
     break;
 case "tag_thread_category":
     $threadid = "";
     if (isset($_REQUEST['threadid'])) {
         $threadid = $_REQUEST['threadid'];
     }
     $categoryid = "";
     if (isset($_REQUEST['categoryid'])) {