| @@ 43-48 (lines=6) @@ | ||
| 40 | $accessToken = isTokenFreshByAccessToken($location, $accessToken); |
|
| 41 | ||
| 42 | ||
| 43 | if($_POST['vote'] == "up") { |
|
| 44 | $accountCreator = new Upvote(); |
|
| 45 | } |
|
| 46 | else if($_POST['vote'] == "down") { |
|
| 47 | $accountCreator = new Downvote(); |
|
| 48 | } |
|
| 49 | ||
| 50 | $accountCreator->setAccessToken($accessToken); |
|
| 51 | $accountCreator->postId = $_POST['postId']; |
|
| @@ 103-108 (lines=6) @@ | ||
| 100 | ||
| 101 | //Vote |
|
| 102 | if(isset($_GET['vote']) && isset($_GET['postID'])) { |
|
| 103 | if($_GET['vote'] == "up") { |
|
| 104 | $accountCreator = new Upvote(); |
|
| 105 | } |
|
| 106 | else if($_GET['vote'] == "down") { |
|
| 107 | $accountCreator = new Downvote(); |
|
| 108 | } |
|
| 109 | $accountCreator->setAccessToken($accessToken_forId1); |
|
| 110 | $accountCreator->postId = $_GET['postID']; |
|
| 111 | $data = $accountCreator->execute(); |
|