From 288980ceb35d5ace51284cfdf176e9acb5f7bb39 Mon Sep 17 00:00:00 2001 From: valentineus Date: Wed, 14 Sep 2016 01:30:05 +0400 Subject: Alpha version --- test/components/communication.php | 17 ++++++++++ test/components/engine.php | 66 +++++++++++++++++++++++++++++++++++++++ test/components/footer.php | 9 ++++++ test/components/navbar.php | 36 +++++++++++++++++++++ test/components/results.php | 20 ++++++++++++ test/components/settings.php | 24 ++++++++++++++ 6 files changed, 172 insertions(+) create mode 100644 test/components/communication.php create mode 100644 test/components/engine.php create mode 100644 test/components/footer.php create mode 100644 test/components/navbar.php create mode 100644 test/components/results.php create mode 100644 test/components/settings.php (limited to 'test/components') diff --git a/test/components/communication.php b/test/components/communication.php new file mode 100644 index 0000000..3f00204 --- /dev/null +++ b/test/components/communication.php @@ -0,0 +1,17 @@ + +
+
+ +
+ +
+ +
+ + + +
+
+
+
+ diff --git a/test/components/engine.php b/test/components/engine.php new file mode 100644 index 0000000..bc89d8e --- /dev/null +++ b/test/components/engine.php @@ -0,0 +1,66 @@ +"); + echo("".$cookie['type'].""); + echo("".$cookie['textarea'].""); + echo("".date("H:i:s", $cookie['time']).""); + echo(""); + } + return 0; +} + + if (isset($_COOKIE['BOT_TOKEN'])) { + $BOT_TOKEN = $_COOKIE['BOT_TOKEN']; + } + + if (isset($_POST['BOT_TOKEN'])) { + unset($_COOKIE); // Clear the session + SetCookie("BOT_TOKEN", htmlspecialchars($_POST['BOT_TOKEN'])); + $BOT_TOKEN = htmlspecialchars($_POST['BOT_TOKEN']); + } + + if (isset($BOT_TOKEN)) { + define('BOT_TOKEN', $BOT_TOKEN); + $bot = new Bot(BOT_TOKEN); + if (isset($_COOKIE['BOT_SESSION'])) { + $session = $bot->session($_COOKIE['BOT_SESSION']); + } else { + $session = $bot->session(); + SetCookie("BOT_SESSION", $session); + } + if (!isset($session)) { ?> +
+ +
+ 'user', + 'textarea' => $textarea, + 'time' => time() + ); + SetCookie("TALK".$current_id, json_encode($cookie)); + + $current_id = $current_id+1; + SetCookie('CURRENT_ID', $current_id+1); + $cookie = array( + 'type' => 'bot', + 'textarea' => $bot->say($textarea), + 'time' => time() + ); + SetCookie("TALK".$current_id, json_encode($cookie)); + } +?> diff --git a/test/components/footer.php b/test/components/footer.php new file mode 100644 index 0000000..fa5a161 --- /dev/null +++ b/test/components/footer.php @@ -0,0 +1,9 @@ + + + diff --git a/test/components/navbar.php b/test/components/navbar.php new file mode 100644 index 0000000..ed858b5 --- /dev/null +++ b/test/components/navbar.php @@ -0,0 +1,36 @@ + + + diff --git a/test/components/results.php b/test/components/results.php new file mode 100644 index 0000000..def09b1 --- /dev/null +++ b/test/components/results.php @@ -0,0 +1,20 @@ +
+
+ + + + + + + +
#TextDate
+
+
diff --git a/test/components/settings.php b/test/components/settings.php new file mode 100644 index 0000000..fe8e5ff --- /dev/null +++ b/test/components/settings.php @@ -0,0 +1,24 @@ + + + -- cgit v1.2.3