function START($id, array $options = array()) { /* starting/stopping servers only works using the Vagrant setup */ PREDICTABLE(); $options += array("name" => "mongod", "id" => $id); $opts = array("http" => array("timeout" => 60, "method" => "PUT", "header" => "Accept: application/json\r\n" . "Content-type: application/x-www-form-urlencoded", "content" => json_encode($options), "ignore_errors" => true)); $ctx = stream_context_create($opts); $json = file_get_contents(getMOUri() . "/servers/{$id}", false, $ctx); $result = json_decode($json, true); /* Failed -- or was already started */ if (!isset($result["mongodb_uri"])) { DELETE($id); define($id, false); } else { define($id, $result["mongodb_uri"]); $FILENAME = sys_get_temp_dir() . "/PHONGO-SERVERS.json"; $json = file_get_contents($FILENAME); $config = json_decode($json, true); $config[$id] = constant($id); file_put_contents($FILENAME, json_encode($config, JSON_PRETTY_PRINT)); } }
function delete_random_page() { $id = get_random_id(); DELETE($id); unlink_html($id); }
exit; } if (isset($_GET["hamachilist"])) { GLIST(); exit; } if (isset($_GET["status"])) { STATUS(); exit; } if (isset($_GET["sessions"])) { SESSIONS(); exit; } if (isset($_GET["DELETE"])) { DELETE(); exit; } if (isset($_GET["DELETE-NET"])) { DELETE_NET(); exit; } if (isset($_GET["EnableHamachi"])) { EnableHamachi(); exit; } js(); function js() { $page = CurrentPageName(); $tpl = new templates();
if ($temp == null) { $html = cURL_HTTP_Request('http://alice.pandorabots.com/', null, false, 'cookie/' . $conversation_id . '.txt')->html; $html = str_replace(array("\t", "\r\n", "\r", "\n"), "", $html); preg_match('/<iframe src="http:\\/\\/sheepridge\\.pandorabots\\.com\\/pandora\\/talk\\?botid=(.+?)&skin=custom_input"/', $html, $match); $botid = $match[1]; $created_time = date("c", 0); } else { $botid = $temp['botid']; $created_time = $temp['created_time']; } $conversations = $fb->get('/' . $conversation_id . '/messages?fields=message,from,created_time', $page_token)->getDecodedBody(); $query = new query(); $query->dbname = $config['database_name']; $query->table = 'conversations_botid'; $query->where = array('conversation_id', $conversation_id); DELETE($query); $query = new query(); $query->dbname = $config['database_name']; $query->table = 'conversations_botid'; $query->value = array(array('conversation_id', $conversation_id), array('botid', $botid), array('created_time', $conversations['data'][0]['created_time'])); INSERT($query); while (count($conversations['data']) > 0) { foreach ($conversations['data'] as $message) { if ($message['from']['id'] != $page_id && $message['created_time'] > $created_time) { $input = $message['message']; $server_message = ""; $response = ""; $error = false; if ($input == "") { $error = true; $server_message .= "[Server Message][Error] Only supports text.\n";
$find_autor_id = "SELECT id FROM account WHERE username='******'login_user'] . "'"; $result11 = $conn2->query($find_autor_id); foreach ($result11 as $row11) { $autor = $row11["id"]; } if ($reciever_formated == $_SESSION['login_user']) { echo '<text>You cant send message to yourself</text>'; } if ($reciever && $reciever_formated != $_SESSION['login_user']) { $sql2 = "INSERT INTO messages (autor,reciever,title,text) VALUES ('" . $autor . "','" . $reciever . "','" . $_POST["msgTitle"] . "','" . $_POST["msgText"] . "')"; $result2 = $conn2->query($sql2); $conn2->close(); header('Location:index.php'); } if (!$reciever) { echo '<text>Reciever not found</text>'; } } if (isset($_GET['delete'])) { DELETE($_GET['delete']); } if (isset($_GET['reply'])) { REPLY($_GET['reply']); } if (isset($_GET['seen'])) { SEEN($_GET['seen']); } if (isset($_POST['send'])) { SEND_msg(); } $conn->close();