@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | crossorigin="anonymous"></script> |
| 6 | 6 | <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script> |
| 7 | 7 | <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script> |
| 8 | - <script src="<?php echo $baseUrl;?>js/jQueryEmoji.js"></script> |
|
| 8 | + <script src="<?php echo $baseUrl; ?>js/jQueryEmoji.js"></script> |
|
| 9 | 9 | <script src="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.1.1/ekko-lightbox.min.js" integrity="sha256-1odJPEl+KoMUaA1T7QNMGSSU/r5LCKCRC6SL8P0r2gY=" crossorigin="anonymous"></script> |
| 10 | 10 | |
| 11 | 11 | <script> |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | console.log(solution); |
| 38 | 38 | $.ajax({ |
| 39 | 39 | type: "POST", |
| 40 | - url: "<?php echo $baseUrl;?>vote-ajax.php?solution=" + solution + "&key="+key, |
|
| 40 | + url: "<?php echo $baseUrl; ?>vote-ajax.php?solution=" + solution + "&key="+key, |
|
| 41 | 41 | data: {"deviceUid" : deviceUid}, |
| 42 | 42 | success: function(result){ |
| 43 | 43 | var response = JSON.parse(result); |
@@ -61,12 +61,12 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | window.history.back(); |
| 63 | 63 | } |
| 64 | - <?php if(isset($includeEmojiAndAjax)){ ?> |
|
| 64 | + <?php if(isset($includeEmojiAndAjax)) { ?> |
|
| 65 | 65 | |
| 66 | 66 | function vote(postId, vote, obj) |
| 67 | 67 | { |
| 68 | 68 | $.ajax({ |
| 69 | - url: '<?php echo $baseUrl;?>vote-ajax.php?postId=' + postId + '&vote=' + vote, |
|
| 69 | + url: '<?php echo $baseUrl; ?>vote-ajax.php?postId=' + postId + '&vote=' + vote, |
|
| 70 | 70 | dataType: 'json', |
| 71 | 71 | async: true, |
| 72 | 72 | success: function(json) |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | <?php if(isset($errorMsg)) { ?> |
| 95 | 95 | //Error Msg |
| 96 | - if('<?php echo $errorMsg;?>' != '') |
|
| 96 | + if('<?php echo $errorMsg; ?>' != '') |
|
| 97 | 97 | { |
| 98 | - alert('<?php echo $errorMsg;?>'); |
|
| 98 | + alert('<?php echo $errorMsg; ?>'); |
|
| 99 | 99 | } |
| 100 | 100 | <?php } ?> |
| 101 | 101 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | function getMorePosts(lastPostId, view, hashtag, old_lastPostId) |
| 129 | 129 | { |
| 130 | 130 | $.ajax({ |
| 131 | - url: '<?php echo $baseUrl;?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view + '&hashtag=' + encodeURIComponent(hashtag), |
|
| 131 | + url: '<?php echo $baseUrl; ?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view + '&hashtag=' + encodeURIComponent(hashtag), |
|
| 132 | 132 | dataType: 'html', |
| 133 | 133 | async: false, |
| 134 | 134 | success: function(html) { |
@@ -61,7 +61,9 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | window.history.back(); |
| 63 | 63 | } |
| 64 | - <?php if(isset($includeEmojiAndAjax)){ ?> |
|
| 64 | + <?php if(isset($includeEmojiAndAjax)) |
|
| 65 | +{ |
|
| 66 | +?> |
|
| 65 | 67 | |
| 66 | 68 | function vote(postId, vote, obj) |
| 67 | 69 | { |
@@ -91,7 +93,9 @@ discard block |
||
| 91 | 93 | |
| 92 | 94 | $(document).ready(function() |
| 93 | 95 | { |
| 94 | - <?php if(isset($errorMsg)) { ?> |
|
| 96 | + <?php if(isset($errorMsg)) |
|
| 97 | +{ |
|
| 98 | +?> |
|
| 95 | 99 | //Error Msg |
| 96 | 100 | if('<?php echo $errorMsg;?>' != '') |
| 97 | 101 | { |
@@ -155,7 +159,9 @@ discard block |
||
| 155 | 159 | return {"lastPostId":lastPostId, "old_lastPostId":old_lastPostId}; |
| 156 | 160 | } |
| 157 | 161 | |
| 158 | - <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?> |
|
| 162 | + <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) |
|
| 163 | +{ |
|
| 164 | +?> |
|
| 159 | 165 | |
| 160 | 166 | if(window.location.hash) |
| 161 | 167 | { |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $header = $this->getSignHeaders(); |
| 30 | 30 | $url = $this->getFullUrl(); |
| 31 | 31 | |
| 32 | - if ($this->getAccessToken()) { |
|
| 32 | + if($this->getAccessToken()) { |
|
| 33 | 33 | $header['Authorization'] = "Bearer " . $this->getAccessToken(); |
| 34 | 34 | } |
| 35 | 35 | //Comment out to debug the Request: |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | 'proxy' => '186.103.169.165:8080', |
| 53 | 53 | );*/ |
| 54 | 54 | |
| 55 | - switch ($this->getMethod()) { |
|
| 55 | + switch($this->getMethod()) { |
|
| 56 | 56 | case 'POST': |
| 57 | 57 | $result = Requests::post($url, $header, $this->payLoad); |
| 58 | 58 | break; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | http_response_code($result->status_code); |
| 75 | 75 | |
| 76 | - switch ($result->status_code) { |
|
| 76 | + switch($result->status_code) { |
|
| 77 | 77 | case 200: |
| 78 | 78 | $result = json_decode($result->body, true); |
| 79 | 79 | break; |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | if(array_key_exists('error', $result) && $result['error'] == 'Service Unavailable') |
| 125 | 125 | { |
| 126 | - header('location:'.$_SERVER['PHP_SELF']); |
|
| 126 | + header('location:' . $_SERVER['PHP_SELF']); |
|
| 127 | 127 | } |
| 128 | 128 | break; |
| 129 | 129 | default: |
| 130 | - error_log('Error '.$result->status_code.' - unknown error'); |
|
| 130 | + error_log('Error ' . $result->status_code . ' - unknown error'); |
|
| 131 | 131 | $result = json_decode($result->body, true); |
| 132 | 132 | } |
| 133 | 133 | |
@@ -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 = 'SDydTnTdqqaiAMfneLkqXYxamvNuUYOmkqpdiZTu'; |
@@ -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; |
@@ -73,7 +76,8 @@ discard block |
||
| 73 | 76 | |
| 74 | 77 | http_response_code($result->status_code); |
| 75 | 78 | |
| 76 | - switch ($result->status_code) { |
|
| 79 | + switch ($result->status_code) |
|
| 80 | + { |
|
| 77 | 81 | case 200: |
| 78 | 82 | $result = json_decode($result->body, true); |
| 79 | 83 | break; |
@@ -150,10 +154,12 @@ discard block |
||
| 150 | 154 | */ |
| 151 | 155 | private function getSignHeaders() |
| 152 | 156 | { |
| 153 | - if($this->getAccessToken() == null) { |
|
| 157 | + if($this->getAccessToken() == null) |
|
| 158 | + { |
|
| 154 | 159 | $payload_accessToken = ""; |
| 155 | 160 | } |
| 156 | - else { |
|
| 161 | + else |
|
| 162 | + { |
|
| 157 | 163 | $payload_accessToken = $this->getAccessToken(); |
| 158 | 164 | } |
| 159 | 165 | |