$_REQUEST['id'], "sect" => $_REQUEST['page'], "vote" => $_REQUEST['vote'], "ip" => $_SERVER['REMOTE_ADDR'], ]; if (($r = posttohost($master_url, $data)) === null || strpos($r,"failed to open socket to") !== false) { $response["success"] = false; $response["msg"] = "Could not process your request at this time. Please try again later..."; } else { $r = json_decode($r); if (isset($r->status, $r->votes) && $r->status) { $response["success"] = true; $response["update"] = (int)$r->votes; } elseif (isset($r->status, $r->message) && !$r->status) { $response["success"] = false; $response["msg"] = $r->message; } else { $response["success"] = false; $response["msg"] = "The server did not respond properly. Please try again later..."; } } } echo json_encode($response); exit; } if (!empty($_REQUEST['id']) && !empty($_REQUEST['page']) && ($N = manual_notes_load($_REQUEST['page'])) && array_key_exists($_REQUEST['id'], $N) && !empty($_REQUEST['vote']) && ($_REQUEST['vote'] === 'up' || $_REQUEST['vote'] === 'down')) { if (!empty($_POST['challenge']) && !empty($_POST['func']) || empty($_POST['arga']) || empty($_POST['argb'])) { if (!test_answer($_POST['func'], $_POST['arga'], $_POST['argb'], $_POST['challenge'])) { $error = "Incorrect answer! Please try again."; } else { if ($_REQUEST['vote'] === 'up') { $N[$_REQUEST['id']]->upvotes++; } elseif ($_REQUEST['vote'] === 'down') { $N[$_REQUEST['id']]->downvotes++; } $hash = substr(md5($_REQUEST['page']), 0, 16); $notes_file = $_SERVER['DOCUMENT_ROOT'] . "/backend/notes/" . substr($hash, 0, 2) . "/$hash"; if (file_exists($notes_file)) { $data = [ "noteid" => $_REQUEST['id'], "sect" => $_REQUEST['page'], "vote" => $_REQUEST['vote'], "ip" => $_SERVER['REMOTE_ADDR'], ]; if (($r = posttohost($master_url, $data)) !== null && strpos($r,"failed to open socket to") === false) { $r = json_decode($r); if (isset($r->status, $r->votes) && $r->status) { $thankyou = true; } else { $error = "Invalid request."; } } else { $error = "Invalid request."; } } else { $error = "Invalid request."; } } } else { $error = "You did not answer the spam challenge question."; } } else { $error = "Invalid request."; } } else { // Site header site_header("Vote On User Notes"); $headerset = true; if (!empty($_REQUEST['id']) && !empty($_REQUEST['page']) && ($N = manual_notes_load($_REQUEST['page'])) && array_key_exists($_REQUEST['id'], $N) && !empty($_REQUEST['vote']) && ($_REQUEST['vote'] === 'up' || $_REQUEST['vote'] === 'down')) { ?>

Voting

: ?
(Example: nine)

The Note You're Voting On

"><< Back to user notes page

There was an error with your request!

$error

EOL; if (!$headerset) { site_header("Error - Voting"); $headerset = true; } ?>

Voting

: ?
(Example: nine)

The Note You're Voting On

"><< Back to user notes page

Thanks for voting!

To go back to the user notes page click here.