@@ -1,14 +1,14 @@ discard block |
||
1 | -<?php include 'php/jodel-web.php';?> |
|
1 | +<?php include 'php/jodel-web.php'; ?> |
|
2 | 2 | <!DOCTYPE html> |
3 | 3 | <html lang="en"> |
4 | 4 | <head> |
5 | - <title><?php echo $viewTest::getTitle($posts[0], $view, $isDetailedView);?></title> |
|
5 | + <title><?php echo $viewTest::getTitle($posts[0], $view, $isDetailedView); ?></title> |
|
6 | 6 | |
7 | 7 | <meta charset="utf-8"> |
8 | 8 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
9 | 9 | <meta http-equiv="x-ua-compatible" content="ie=edge"> |
10 | 10 | |
11 | - <meta name="description" content="<?php echo $viewTest::getMetaDescription($posts[0], $view, $isDetailedView);?>"> |
|
11 | + <meta name="description" content="<?php echo $viewTest::getMetaDescription($posts[0], $view, $isDetailedView); ?>"> |
|
12 | 12 | <meta name="keywords" content="jodelblue, jodel, blue, webclient, web, client, web-app, browser, app"> |
13 | 13 | |
14 | 14 | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" integrity="sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi" crossorigin="anonymous"> |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | <content id="posts"> |
92 | 92 | <?php |
93 | - for($i = 0; $i<$loops; $i++) |
|
93 | + for($i = 0; $i < $loops; $i++) |
|
94 | 94 | { |
95 | 95 | if(array_key_exists($i, $posts) && array_key_exists('post_id', $posts[$i]) && isset($posts[$i]['post_id'])) |
96 | 96 | { |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | <?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?> |
135 | 135 | <h2>Comment on Jodel</h2> |
136 | 136 | <form method="POST"> |
137 | - <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" /> |
|
137 | + <input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']); ?>" /> |
|
138 | 138 | <textarea id="message" name="message" placeholder="Send a comment on a Jodel to all students within 10km" required></textarea> |
139 | 139 | <br /> |
140 | 140 | <input type="submit" value="SEND" /> |
@@ -171,13 +171,13 @@ discard block |
||
171 | 171 | <div class="col-xs-12"> |
172 | 172 | <div class="row"> |
173 | 173 | <div class="col-xs-3"> |
174 | - <a href="index.php" <?php if($view=='time') echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
174 | + <a href="index.php" <?php if($view == 'time') echo 'class="active"'; ?>><i class="fa fa-clock-o fa-3x"></i></a> |
|
175 | 175 | </div> |
176 | 176 | <div class="col-xs-3"> |
177 | - <a href="index.php?view=comment" <?php if($view=='comment') echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
177 | + <a href="index.php?view=comment" <?php if($view == 'comment') echo 'class="active"'; ?>><i class="fa fa-commenting-o fa-3x"></i></a> |
|
178 | 178 | </div> |
179 | 179 | <div class="col-xs-3"> |
180 | - <a href="index.php?view=upVote" <?php if($view=='upVote') echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
180 | + <a href="index.php?view=upVote" <?php if($view == 'upVote') echo 'class="active"'; ?>><i class="fa fa-angle-up fa-3x"></i></a> |
|
181 | 181 | </div> |
182 | 182 | <div class="col-xs-3"> |
183 | 183 | <nav> |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | $this->refreshToken(); |
37 | 37 | } |
38 | - $this->accessToken = $this->getAccessToken(); |
|
38 | + $this->accessToken = $this->getAccessToken(); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | function isAccountVerified() |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | } |
95 | 95 | else |
96 | 96 | { |
97 | - error_log('User with JodelDeviceId:' . $this->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name); |
|
97 | + error_log('User with JodelDeviceId:' . $this->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | function getLocation() |
107 | 107 | { |
108 | 108 | $db = new DatabaseConnect(); |
109 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
109 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
110 | 110 | |
111 | 111 | $location = new Location(); |
112 | 112 | |
113 | - if ($result->num_rows > 0) |
|
113 | + if($result->num_rows > 0) |
|
114 | 114 | { |
115 | 115 | // output data of each row |
116 | 116 | while($row = $result->fetch_assoc()) |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | if(isset($_POST['color'])) |
212 | 212 | { |
213 | 213 | $color = $_POST['color']; |
214 | - switch ($color) { |
|
214 | + switch($color) { |
|
215 | 215 | case '8ABDB0': |
216 | 216 | $color = '8ABDB0'; |
217 | 217 | break; |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | |
268 | 268 | $access_token; |
269 | 269 | |
270 | - if ($result->num_rows > 0) |
|
270 | + if($result->num_rows > 0) |
|
271 | 271 | { |
272 | 272 | // output data of each row |
273 | 273 | while($row = $result->fetch_assoc()) { |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | expiration_date='" . $expiration_date . "' |
300 | 300 | WHERE device_uid='" . $device_uid . "'"); |
301 | 301 | |
302 | - if($result === false){ |
|
302 | + if($result === false) { |
|
303 | 303 | echo "Adding account failed: (" . $db->errno . ") " . $db->error; |
304 | 304 | } |
305 | 305 | } |
@@ -317,11 +317,11 @@ discard block |
||
317 | 317 | function getAccessToken() |
318 | 318 | { |
319 | 319 | $db = new DatabaseConnect(); |
320 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
320 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'"); |
|
321 | 321 | |
322 | 322 | $accessToken; |
323 | 323 | |
324 | - if ($result->num_rows > 0) |
|
324 | + if($result->num_rows > 0) |
|
325 | 325 | { |
326 | 326 | // output data of each row |
327 | 327 | while($row = $result->fetch_assoc()) |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | $result = $db->query("INSERT INTO votes (device_uid, postId, type) |
390 | 390 | VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')"); |
391 | 391 | |
392 | - if($result === false){ |
|
392 | + if($result === false) { |
|
393 | 393 | $error = db_error(); |
394 | 394 | echo $error; |
395 | 395 | echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
@@ -417,11 +417,11 @@ discard block |
||
417 | 417 | $result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type, |
418 | 418 | expires_in, expiration_date, distinct_id, device_uid, name, lat, lng) |
419 | 419 | VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type . |
420 | - "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id . |
|
420 | + "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id . |
|
421 | 421 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
422 | 422 | |
423 | 423 | $success = TRUE; |
424 | - if($result === false){ |
|
424 | + if($result === false) { |
|
425 | 425 | $error = db_error(); |
426 | 426 | echo $error; |
427 | 427 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |
@@ -24,25 +24,25 @@ discard block |
||
24 | 24 | $timediff_inDays = (string)$timediff->format('%d'); |
25 | 25 | $timediff_inMonth = (string)$timediff->format('%m'); |
26 | 26 | |
27 | - if($timediff_inMonth!=0) |
|
27 | + if($timediff_inMonth != 0) |
|
28 | 28 | { |
29 | 29 | $timediff = $timediff_inMonth . "m"; |
30 | 30 | } |
31 | 31 | else |
32 | 32 | { |
33 | - if($timediff_inDays!=0) |
|
33 | + if($timediff_inDays != 0) |
|
34 | 34 | { |
35 | 35 | $timediff = $timediff_inDays . "d"; |
36 | 36 | } |
37 | 37 | else |
38 | 38 | { |
39 | - if($timediff_inHours!=0) |
|
39 | + if($timediff_inHours != 0) |
|
40 | 40 | { |
41 | 41 | $timediff = $timediff_inHours . "h"; |
42 | 42 | } |
43 | 43 | else |
44 | 44 | { |
45 | - if($timediff_inMinutes!=0) |
|
45 | + if($timediff_inMinutes != 0) |
|
46 | 46 | { |
47 | 47 | $timediff = $timediff_inMinutes . "m"; |
48 | 48 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | |
58 | 58 | ?> |
59 | - <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color'];?>;"> |
|
59 | + <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color']; ?>;"> |
|
60 | 60 | <content> |
61 | 61 | <?php |
62 | 62 | if(isset($post['image_url'])) |
@@ -74,24 +74,24 @@ discard block |
||
74 | 74 | <?php |
75 | 75 | if($isDetailedView) |
76 | 76 | {?> |
77 | - <a href="index.php?vote=up&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow"> |
|
77 | + <a href="index.php?vote=up&getPostDetails=true&postId=<?php echo $post['post_id']; ?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']); ?>" rel="nofollow"> |
|
78 | 78 | <?php } |
79 | 79 | else |
80 | 80 | {?> |
81 | - <a href="index.php?vote=up&postId=<?php echo $post['post_id'];?>" rel="nofollow"> |
|
81 | + <a href="index.php?vote=up&postId=<?php echo $post['post_id']; ?>" rel="nofollow"> |
|
82 | 82 | <?php } ?> |
83 | 83 | <i class="fa fa-angle-up fa-3x"></i> |
84 | 84 | </a> |
85 | 85 | <br /> |
86 | - <?php echo $post["vote_count"];?><br /> |
|
86 | + <?php echo $post["vote_count"]; ?><br /> |
|
87 | 87 | <?php |
88 | 88 | if($isDetailedView) |
89 | 89 | {?> |
90 | - <a href="index.php?vote=down&getPostDetails=true&postId=<?php echo $post['post_id'];?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']);?>" rel="nofollow"> |
|
90 | + <a href="index.php?vote=down&getPostDetails=true&postId=<?php echo $post['post_id']; ?>&postId_parent=<?php echo htmlspecialchars($_GET['postId']); ?>" rel="nofollow"> |
|
91 | 91 | <?php } |
92 | 92 | else |
93 | 93 | {?> |
94 | - <a href="index.php?vote=down&postId=<?php echo $post['post_id'];?>" rel="nofollow"> |
|
94 | + <a href="index.php?vote=down&postId=<?php echo $post['post_id']; ?>" rel="nofollow"> |
|
95 | 95 | <?php } ?> |
96 | 96 | <i class="fa fa-angle-down fa-3x"></i> |
97 | 97 | </a> |
@@ -103,14 +103,14 @@ discard block |
||
103 | 103 | <td class="time"> |
104 | 104 | <span class="tip" data-tooltip="Time"> |
105 | 105 | <i class="fa fa-clock-o"></i> |
106 | - <?php echo $timediff;?> |
|
107 | - <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span> |
|
106 | + <?php echo $timediff; ?> |
|
107 | + <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s'); ?></span> |
|
108 | 108 | </span> |
109 | 109 | </td> |
110 | 110 | <td class="comments"> |
111 | 111 | <?php if(!$isDetailedView) {?> |
112 | 112 | <span data-tooltip="Comments"> |
113 | - <a href="index.php?getPostDetails=true&view=<?php echo $view;?>&postId=<?php echo $post["post_id"];?>"> |
|
113 | + <a href="index.php?getPostDetails=true&view=<?php echo $view; ?>&postId=<?php echo $post["post_id"]; ?>"> |
|
114 | 114 | <i class="fa fa-commenting-o"></i> |
115 | 115 | <?php if(array_key_exists("child_count", $post)) { |
116 | 116 | echo $post["child_count"]; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | { |
140 | 140 | ?> |
141 | 141 | <span data-tooltip="Author"> |
142 | - <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"];?> | |
|
142 | + <i class="fa fa-user-o"></i> #<?php echo $post["user_handle"]; ?> | |
|
143 | 143 | </span> |
144 | 144 | <?php |
145 | 145 | } |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | |
150 | 150 | <span class="tip" data-tooltip="Distance"> |
151 | 151 | <i class="fa fa-map-marker"></i> |
152 | - <?php echo $post['distance'];?> km |
|
153 | - <span class="tiptext"><?php echo $post['location']['name'];?></span> |
|
152 | + <?php echo $post['distance']; ?> km |
|
153 | + <span class="tiptext"><?php echo $post['location']['name']; ?></span> |
|
154 | 154 | </span> |
155 | 155 | </td> |
156 | 156 | </tr> |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | $config = parse_ini_file('config/config.ini.php'); |
4 | 4 | if(!isset($_GET['pw']) || $config['pw'] != $_GET['pw']) |
5 | 5 | { |
6 | - error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php'); |
|
7 | - $respone = array("message" => $_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php',"success" => false); |
|
6 | + error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php'); |
|
7 | + $respone = array("message" => $_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php', "success" => false); |
|
8 | 8 | echo json_encode($response); |
9 | 9 | |
10 | 10 | die(); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | -if (isset($captcha)) |
|
58 | +if(isset($captcha)) |
|
59 | 59 | { |
60 | 60 | $response = array("success" => $success, "message" => $message, "captcha" => $captcha, "deviceUid" => $deviceUid); |
61 | 61 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | if(!isset($_GET['pw']) || $config['pw'] != $_GET['pw']) |
6 | 6 | { |
7 | - error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on admin.php'); |
|
7 | + error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on admin.php'); |
|
8 | 8 | die(); |
9 | 9 | } |
10 | 10 |