@@ -75,7 +75,11 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | <div id="location_mobile" class="hidden-sm-up"> |
| 77 | 77 | <form method="get"> |
| 78 | - <input type="text" id="city_mobile" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required> |
|
| 78 | + <input type="text" id="city_mobile" name="city" placeholder="<?php if(isset($newPositionStatus)) |
|
| 79 | +{ |
|
| 80 | + echo $newPositionStatus; |
|
| 81 | +} |
|
| 82 | +?>" required> |
|
| 79 | 83 | |
| 80 | 84 | <input type="submit" id="submit_mobile" class="fa" value="" /> |
| 81 | 85 | </form> |
@@ -102,7 +106,9 @@ discard block |
||
| 102 | 106 | |
| 103 | 107 | </content> |
| 104 | 108 | |
| 105 | - <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?> |
|
| 109 | + <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) |
|
| 110 | +{ |
|
| 111 | +?> |
|
| 106 | 112 | <p id="loading"> |
| 107 | 113 | Loading… |
| 108 | 114 | </p> |
@@ -115,7 +121,11 @@ discard block |
||
| 115 | 121 | <div> |
| 116 | 122 | <h2>Position / Hashtag</h2> |
| 117 | 123 | <form method="get"> |
| 118 | - <input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required> |
|
| 124 | + <input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus)) |
|
| 125 | +{ |
|
| 126 | + echo $newPositionStatus; |
|
| 127 | +} |
|
| 128 | +?>" required> |
|
| 119 | 129 | <label>try: #jhj</label><br> |
| 120 | 130 | <input type="submit" value="Set Location" /> |
| 121 | 131 | </form> |
@@ -131,7 +141,9 @@ discard block |
||
| 131 | 141 | |
| 132 | 142 | <article> |
| 133 | 143 | <div> |
| 134 | - <?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?> |
|
| 144 | + <?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) |
|
| 145 | +{ |
|
| 146 | +?> |
|
| 135 | 147 | <h2>Comment on Jodel</h2> |
| 136 | 148 | <form method="POST"> |
| 137 | 149 | <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" /> |
@@ -139,7 +151,10 @@ discard block |
||
| 139 | 151 | <br /> |
| 140 | 152 | <input type="submit" value="SEND" /> |
| 141 | 153 | </form> |
| 142 | - <?php } else { ?> |
|
| 154 | + <?php } |
|
| 155 | +else |
|
| 156 | +{ |
|
| 157 | +?> |
|
| 143 | 158 | <h2>New Jodel</h2> |
| 144 | 159 | <form method="POST"> |
| 145 | 160 | <textarea id="message" name="message" placeholder="Send a Jodel to all students within 10km" required></textarea> |
@@ -198,7 +213,9 @@ discard block |
||
| 198 | 213 | $('html,body').animate({scrollTop: aTag.offset().top-90},'slow'); |
| 199 | 214 | } |
| 200 | 215 | |
| 201 | - <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?> |
|
| 216 | + <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) |
|
| 217 | +{ |
|
| 218 | +?> |
|
| 202 | 219 | |
| 203 | 220 | |
| 204 | 221 | |
@@ -2,13 +2,25 @@ |
||
| 2 | 2 | <div class="col-xs-12"> |
| 3 | 3 | <div class="row"> |
| 4 | 4 | <div class="col-xs-3"> |
| 5 | - <a href="<?php echo $baseUrl;?>index.php" <?php if($view=='time') echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 5 | + <a href="<?php echo $baseUrl;?>index.php" <?php if($view=='time') |
|
| 6 | +{ |
|
| 7 | + echo 'class="active"'; |
|
| 8 | +} |
|
| 9 | +?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 6 | 10 | </div> |
| 7 | 11 | <div class="col-xs-3"> |
| 8 | - <a href="<?php echo $baseUrl;?>index.php?view=comment" <?php if($view=='comment') echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 12 | + <a href="<?php echo $baseUrl;?>index.php?view=comment" <?php if($view=='comment') |
|
| 13 | +{ |
|
| 14 | + echo 'class="active"'; |
|
| 15 | +} |
|
| 16 | +?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 9 | 17 | </div> |
| 10 | 18 | <div class="col-xs-3"> |
| 11 | - <a href="<?php echo $baseUrl;?>index.php?view=upVote" <?php if($view=='upVote') echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 19 | + <a href="<?php echo $baseUrl;?>index.php?view=upVote" <?php if($view=='upVote') |
|
| 20 | +{ |
|
| 21 | + echo 'class="active"'; |
|
| 22 | +} |
|
| 23 | +?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 12 | 24 | </div> |
| 13 | 25 | <div class="col-xs-3"> |
| 14 | 26 | <nav> |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | abstract class AbstractRequest |
| 4 | -{ |
|
| 4 | +{ |
|
| 5 | 5 | const CLIENTID = '81e8a76e-1e02-4d17-9ba0-8a7020261b26'; |
| 6 | 6 | const APIURL = 'https://api.go-tellm.com/api'; |
| 7 | 7 | const SECRET = 'LDWWpuUigOnKCbCLpoNMDHCqHCWbLKPzHbnIUKIf'; |
@@ -20,7 +20,8 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | $this->payLoad = $this->getPayload(); |
| 22 | 22 | $device_uid = ''; |
| 23 | - if(isset($this->payLoad['device_uid'])) { |
|
| 23 | + if(isset($this->payLoad['device_uid'])) |
|
| 24 | + { |
|
| 24 | 25 | $device_uid = $this->payLoad['device_uid']; |
| 25 | 26 | } |
| 26 | 27 | |
@@ -29,7 +30,8 @@ discard block |
||
| 29 | 30 | $header = $this->getSignHeaders(); |
| 30 | 31 | $url = $this->getFullUrl(); |
| 31 | 32 | |
| 32 | - if ($this->getAccessToken()) { |
|
| 33 | + if ($this->getAccessToken()) |
|
| 34 | + { |
|
| 33 | 35 | $header['Authorization'] = "Bearer " . $this->getAccessToken(); |
| 34 | 36 | } |
| 35 | 37 | //Comment out to debug the Request: |
@@ -52,7 +54,8 @@ discard block |
||
| 52 | 54 | 'proxy' => '186.103.169.165:8080', |
| 53 | 55 | );*/ |
| 54 | 56 | |
| 55 | - switch ($this->getMethod()) { |
|
| 57 | + switch ($this->getMethod()) |
|
| 58 | + { |
|
| 56 | 59 | case 'POST': |
| 57 | 60 | $result = Requests::post($url, $header, $this->payLoad); |
| 58 | 61 | break; |
@@ -70,7 +73,8 @@ discard block |
||
| 70 | 73 | $result = Requests::put($url, $header, $this->payLoad); |
| 71 | 74 | break; |
| 72 | 75 | } |
| 73 | - switch ($result->status_code) { |
|
| 76 | + switch ($result->status_code) |
|
| 77 | + { |
|
| 74 | 78 | case 200: |
| 75 | 79 | $result = json_decode($result->body, true); |
| 76 | 80 | break; |
@@ -125,10 +129,12 @@ discard block |
||
| 125 | 129 | */ |
| 126 | 130 | private function getSignHeaders() |
| 127 | 131 | { |
| 128 | - if($this->getAccessToken() == null) { |
|
| 132 | + if($this->getAccessToken() == null) |
|
| 133 | + { |
|
| 129 | 134 | $payload_accessToken = ""; |
| 130 | 135 | } |
| 131 | - else { |
|
| 136 | + else |
|
| 137 | + { |
|
| 132 | 138 | $payload_accessToken = $this->getAccessToken(); |
| 133 | 139 | } |
| 134 | 140 | |