@@ -1,12 +1,24 @@ |
||
| 1 | 1 | <div id="sortJodelBy" class="row"> |
| 2 | 2 | <div class="col-3"> |
| 3 | - <a <?php if($view->view == 'combo')echo 'class="active"';?> href="<?php echo $view->changeView('combo')->back()->toUrl();?>"><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 3 | + <a <?php if($view->view == 'combo') |
|
| 4 | +{ |
|
| 5 | + echo 'class="active"'; |
|
| 6 | +} |
|
| 7 | +?> href="<?php echo $view->changeView('combo')->back()->toUrl();?>"><i class="fa fa-clock-o fa-3x"></i></a> |
|
| 4 | 8 | </div> |
| 5 | 9 | <div class="col-3"> |
| 6 | - <a <?php if($view->view == 'discussed') echo 'class="active"';?> href="<?php echo $view->changeView('discussed')->back()->toUrl();?>"><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 10 | + <a <?php if($view->view == 'discussed') |
|
| 11 | +{ |
|
| 12 | + echo 'class="active"'; |
|
| 13 | +} |
|
| 14 | +?> href="<?php echo $view->changeView('discussed')->back()->toUrl();?>"><i class="fa fa-commenting-o fa-3x"></i></a> |
|
| 7 | 15 | </div> |
| 8 | 16 | <div class="col-3"> |
| 9 | - <a <?php if($view->view == 'popular') echo 'class="active"';?> href="<?php echo $view->changeView('popular')->back()->toUrl();?>"><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 17 | + <a <?php if($view->view == 'popular') |
|
| 18 | +{ |
|
| 19 | + echo 'class="active"'; |
|
| 20 | +} |
|
| 21 | +?> href="<?php echo $view->changeView('popular')->back()->toUrl();?>"><i class="fa fa-angle-up fa-3x"></i></a> |
|
| 10 | 22 | </div> |
| 11 | 23 | <div class="col-3"> |
| 12 | 24 | <nav> |
@@ -74,7 +74,11 @@ |
||
| 74 | 74 | |
| 75 | 75 | <div id="location_mobile" class="hidden-sm-up"> |
| 76 | 76 | <form method="get"> |
| 77 | - <input type="text" id="city_mobile" name="search" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required> |
|
| 77 | + <input type="text" id="city_mobile" name="search" placeholder="<?php if(isset($newPositionStatus)) |
|
| 78 | +{ |
|
| 79 | + echo $newPositionStatus; |
|
| 80 | +} |
|
| 81 | +?>" required> |
|
| 78 | 82 | |
| 79 | 83 | <input type="submit" id="submit_mobile" class="fa" value="" /> |
| 80 | 84 | </form> |
@@ -55,7 +55,8 @@ discard block |
||
| 55 | 55 | return TRUE; |
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | -function isUserAdmin() { |
|
| 58 | +function isUserAdmin() |
|
| 59 | +{ |
|
| 59 | 60 | global $config; |
| 60 | 61 | if (isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword']) |
| 61 | 62 | { |
@@ -106,7 +107,7 @@ discard block |
||
| 106 | 107 | } |
| 107 | 108 | |
| 108 | 109 | if(configPropertyExists($config, 'karmaDeviceUid')) |
| 109 | - { |
|
| 110 | + { |
|
| 110 | 111 | $jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']); |
| 111 | 112 | } |
| 112 | 113 | else |
@@ -176,7 +177,8 @@ discard block |
||
| 176 | 177 | |
| 177 | 178 | if(isset($_GET['view'])) |
| 178 | 179 | { |
| 179 | - switch ($_GET['view']) { |
|
| 180 | + switch ($_GET['view']) |
|
| 181 | + { |
|
| 180 | 182 | case 'discussed': |
| 181 | 183 | $view = 'discussed'; |
| 182 | 184 | break; |
@@ -223,7 +225,7 @@ discard block |
||
| 223 | 225 | { |
| 224 | 226 | $jodelAccountForKarma->votePostId($_GET['postId'], $_GET['vote']); |
| 225 | 227 | if(isset($_GET['getPostDetails']) && isset($_GET['getPostDetails'])) |
| 226 | - { |
|
| 228 | + { |
|
| 227 | 229 | header('Location: index.php?getPostDetails=true&postId=' . htmlspecialchars($_GET['postId_parent']) . '#postId-' . htmlspecialchars($_GET['postId'])); |
| 228 | 230 | } |
| 229 | 231 | else |
@@ -34,7 +34,8 @@ discard block |
||
| 34 | 34 | * Compute HTML Code |
| 35 | 35 | */ |
| 36 | 36 | function jodelToHtml($post) |
| 37 | - { //ToDO |
|
| 37 | + { |
|
| 38 | +//ToDO |
|
| 38 | 39 | //Replace # with link |
| 39 | 40 | //preg_replace('~(\#)([^\s!,. /()"\'?]+)~', '<a href="tag/$2">#$2</a>', $text); |
| 40 | 41 | |
@@ -90,7 +91,8 @@ discard block |
||
| 90 | 91 | |
| 91 | 92 | echo '<img src="' . $post['image_url'] . '" alt="' . htmlspecialchars(preg_replace($regexRest, '', $post['message'])) . '">'; |
| 92 | 93 | } |
| 93 | - else { |
|
| 94 | + else |
|
| 95 | + { |
|
| 94 | 96 | echo str_replace(' ', ' ', nl2br(htmlspecialchars($post['message']))); |
| 95 | 97 | } |
| 96 | 98 | ?> |
@@ -98,11 +100,13 @@ discard block |
||
| 98 | 100 | <aside> |
| 99 | 101 | <?php |
| 100 | 102 | if($this->isDetailedView) |
| 101 | - {?> |
|
| 103 | + { |
|
| 104 | +?> |
|
| 102 | 105 | <a href="index.php?vote=up&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow"> |
| 103 | 106 | <?php } |
| 104 | - else |
|
| 105 | - {?> |
|
| 107 | +else |
|
| 108 | + { |
|
| 109 | +?> |
|
| 106 | 110 | <a href="index.php?vote=up&postId=<?php echo $post['post_id'];?>" rel="nofollow"> |
| 107 | 111 | <?php } ?> |
| 108 | 112 | <i class="fa fa-angle-up fa-3x"></i> |
@@ -111,11 +115,13 @@ discard block |
||
| 111 | 115 | <?php echo $post["vote_count"];?><br /> |
| 112 | 116 | <?php |
| 113 | 117 | if($this->isDetailedView) |
| 114 | - {?> |
|
| 118 | + { |
|
| 119 | +?> |
|
| 115 | 120 | <a href="index.php?vote=down&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow"> |
| 116 | 121 | <?php } |
| 117 | - else |
|
| 118 | - {?> |
|
| 122 | +else |
|
| 123 | + { |
|
| 124 | +?> |
|
| 119 | 125 | <a href="index.php?vote=down&postId=<?php echo $post['post_id'];?>" rel="nofollow"> |
| 120 | 126 | <?php } ?> |
| 121 | 127 | <i class="fa fa-angle-down fa-3x"></i> |
@@ -132,14 +138,20 @@ discard block |
||
| 132 | 138 | <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span> |
| 133 | 139 | </span> |
| 134 | 140 | </span> |
| 135 | - <?php if(!$this->isDetailedView) {?> |
|
| 141 | + <?php if(!$this->isDetailedView) |
|
| 142 | +{ |
|
| 143 | +?> |
|
| 136 | 144 | <span class="comments"> |
| 137 | 145 | <span data-tooltip="Comments"> |
| 138 | 146 | <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>"> |
| 139 | 147 | <i class="fa fa-commenting-o"></i> |
| 140 | - <?php if(array_key_exists("child_count", $post)) { |
|
| 148 | + <?php if(array_key_exists("child_count", $post)) |
|
| 149 | +{ |
|
| 141 | 150 | echo $post["child_count"]; |
| 142 | - } else echo "0"; |
|
| 151 | + } |
|
| 152 | + else { |
|
| 153 | + echo "0"; |
|
| 154 | + } |
|
| 143 | 155 | ?> |
| 144 | 156 | </a> |
| 145 | 157 | </span> |
@@ -355,7 +367,7 @@ discard block |
||
| 355 | 367 | $data = $accountCreator->execute(); |
| 356 | 368 | } |
| 357 | 369 | if(array_key_exists('recent', $data)) |
| 358 | - { |
|
| 370 | + { |
|
| 359 | 371 | return $data['recent']; |
| 360 | 372 | } |
| 361 | 373 | else if(array_key_exists('posts', $data)) |
@@ -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; |
@@ -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; |
@@ -127,10 +131,12 @@ discard block |
||
| 127 | 131 | */ |
| 128 | 132 | private function getSignHeaders() |
| 129 | 133 | { |
| 130 | - if($this->getAccessToken() == null) { |
|
| 134 | + if($this->getAccessToken() == null) |
|
| 135 | + { |
|
| 131 | 136 | $payload_accessToken = ""; |
| 132 | 137 | } |
| 133 | - else { |
|
| 138 | + else |
|
| 139 | + { |
|
| 134 | 140 | $payload_accessToken = $this->getAccessToken(); |
| 135 | 141 | } |
| 136 | 142 | |
@@ -20,7 +20,8 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | $posts[0] = $data; |
| 22 | 22 | |
| 23 | - if(array_key_exists('children', $data)) { |
|
| 23 | + if(array_key_exists('children', $data)) |
|
| 24 | + { |
|
| 24 | 25 | foreach($data['children'] as $key => $child) |
| 25 | 26 | { |
| 26 | 27 | |
@@ -83,7 +84,9 @@ discard block |
||
| 83 | 84 | } ?> |
| 84 | 85 | </content> |
| 85 | 86 | |
| 86 | - <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?> |
|
| 87 | + <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) |
|
| 88 | +{ |
|
| 89 | +?> |
|
| 87 | 90 | <p id="loading"> |
| 88 | 91 | Loading… |
| 89 | 92 | </p> |
@@ -91,12 +94,20 @@ discard block |
||
| 91 | 94 | </article> |
| 92 | 95 | |
| 93 | 96 | <aside class="topSidebar col-sm-4 sidebar-outer"> |
| 94 | - <div class="fixed<?php if(!$view->isDetailedView) echo(' hide-mobile');?>"> |
|
| 97 | + <div class="fixed<?php if(!$view->isDetailedView) |
|
| 98 | +{ |
|
| 99 | + echo(' hide-mobile'); |
|
| 100 | +} |
|
| 101 | +?>"> |
|
| 95 | 102 | <article> |
| 96 | 103 | <div> |
| 97 | 104 | <h2>Position / Hashtag</h2> |
| 98 | 105 | <form method="get"> |
| 99 | - <input type="text" id="city" name="search" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required> |
|
| 106 | + <input type="text" id="city" name="search" placeholder="<?php if(isset($newPositionStatus)) |
|
| 107 | +{ |
|
| 108 | + echo $newPositionStatus; |
|
| 109 | +} |
|
| 110 | +?>" required> |
|
| 100 | 111 | <label>try: #jhj</label><br> |
| 101 | 112 | <input type="submit" value="Set Location" /> |
| 102 | 113 | </form> |
@@ -112,7 +123,9 @@ discard block |
||
| 112 | 123 | |
| 113 | 124 | <article> |
| 114 | 125 | <div> |
| 115 | - <?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?> |
|
| 126 | + <?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) |
|
| 127 | +{ |
|
| 128 | +?> |
|
| 116 | 129 | <h2>Comment on Jodel</h2> |
| 117 | 130 | <form method="POST"> |
| 118 | 131 | <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" /> |
@@ -120,7 +133,10 @@ discard block |
||
| 120 | 133 | <br /> |
| 121 | 134 | <input type="submit" value="SEND" /> |
| 122 | 135 | </form> |
| 123 | - <?php } else { ?> |
|
| 136 | + <?php } |
|
| 137 | +else |
|
| 138 | +{ |
|
| 139 | +?> |
|
| 124 | 140 | <h2>New Jodel</h2> |
| 125 | 141 | <form method="POST"> |
| 126 | 142 | <textarea id="message" name="message" placeholder="Send a Jodel to all students within 10km" required></textarea> |
@@ -13,7 +13,9 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | window.history.back(); |
| 15 | 15 | } |
| 16 | - <?php if(isset($includeEmojiAndAjax)){ ?> |
|
| 16 | + <?php if(isset($includeEmojiAndAjax)) |
|
| 17 | +{ |
|
| 18 | +?> |
|
| 17 | 19 | $(document).ready(function() |
| 18 | 20 | { |
| 19 | 21 | //Transform UTF-8 Emoji to img |
@@ -72,7 +74,9 @@ discard block |
||
| 72 | 74 | return {"lastPostId":lastPostId, "old_lastPostId":old_lastPostId}; |
| 73 | 75 | } |
| 74 | 76 | |
| 75 | - <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?> |
|
| 77 | + <?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) |
|
| 78 | +{ |
|
| 79 | +?> |
|
| 76 | 80 | |
| 77 | 81 | if(window.location.hash) |
| 78 | 82 | { |
@@ -12,7 +12,8 @@ |
||
| 12 | 12 | |
| 13 | 13 | } |
| 14 | 14 | $db = new DatabaseConnect(); |
| 15 | -if ($db->connect_errno) { |
|
| 15 | +if ($db->connect_errno) |
|
| 16 | +{ |
|
| 16 | 17 | echo 'Sorry, die Verbindung zu unserem |
| 17 | 18 | Server ist hops gegangen. Wegen '.$db -> connect_error; |
| 18 | 19 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | public $varsToDump; |
| 14 | 14 | |
| 15 | 15 | function __construct($msg = 'not Set', $varsToDump = 'not Set', $view = 'not Set', $actions = 'not Set', $accountId = 'not Set', $isVerified = 'not Set', $isTokenFresh = 'not Set', $page = 'not Set', $referrer = 'not Set') |
| 16 | - { |
|
| 16 | + { |
|
| 17 | 17 | $this->view = $view; |
| 18 | 18 | $this->actions = $actions; |
| 19 | 19 | $this->accountId = $accountId; |