@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | |
20 | 20 | if(!isUserVoter() && !isUserAdmin()) |
21 | 21 | { |
22 | - error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php'); |
|
23 | - $response = array("message" => $_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php',"success" => false); |
|
22 | + error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php'); |
|
23 | + $response = array("message" => $_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php', "success" => false); |
|
24 | 24 | echo json_encode($response); |
25 | 25 | die(); |
26 | 26 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
113 | - if (isset($captcha)) |
|
113 | + if(isset($captcha)) |
|
114 | 114 | { |
115 | 115 | $response = array("success" => $success, "message" => $message, "captcha" => $captcha, "deviceUid" => $deviceUid); |
116 | 116 | } |
@@ -5,14 +5,14 @@ discard block |
||
5 | 5 | |
6 | 6 | if(isset($_GET['pw'])) |
7 | 7 | { |
8 | - setcookie('JodelAdminPassword', $_GET['pw'], time()+60*60*24*365*10); |
|
8 | + setcookie('JodelAdminPassword', $_GET['pw'], time() + 60 * 60 * 24 * 365 * 10); |
|
9 | 9 | error_log('admin password saved for [' . $_SERVER ['HTTP_USER_AGENT'] . ']'); |
10 | 10 | header('Location: ' . $baseUrl . 'admin.php'); |
11 | 11 | exit; |
12 | 12 | } |
13 | 13 | else if(isset($_GET['voterPw'])) |
14 | 14 | { |
15 | - setcookie('JodelVoterPassword', $_GET['voterPw'], time()+60*60*24*365*10); |
|
15 | + setcookie('JodelVoterPassword', $_GET['voterPw'], time() + 60 * 60 * 24 * 365 * 10); |
|
16 | 16 | error_log('voter password saved for [' . $_SERVER ['HTTP_USER_AGENT'] . ']'); |
17 | 17 | header('Location: ' . $baseUrl . 'admin.php'); |
18 | 18 | exit; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | else |
32 | 32 | { |
33 | - error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong voterPw / pw on admin.php'); |
|
33 | + error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong voterPw / pw on admin.php'); |
|
34 | 34 | die(); |
35 | 35 | } |
36 | 36 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | . "','" . $db->escape_string($_POST['device_uid']) |
51 | 51 | . "','" . $db->escape_string($_POST['rights']) . "')"); |
52 | 52 | |
53 | - if($result === false){ |
|
53 | + if($result === false) { |
|
54 | 54 | $error = db_error(); |
55 | 55 | error_log($error); |
56 | 56 | error_log("Adding Voter failed: (" . $result->errno . ") " . $result->error); |
@@ -98,42 +98,42 @@ discard block |
||
98 | 98 | <meta name="keywords" content="jodelblue, jodel, blue, webclient, web, client"> |
99 | 99 | |
100 | 100 | <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"> |
101 | - <link rel="stylesheet" href="<?php echo $baseUrl;?>css/font-awesome.min.css"> |
|
102 | - <link rel="stylesheet" href="<?php echo $baseUrl;?>style.css" type="text/css"> |
|
101 | + <link rel="stylesheet" href="<?php echo $baseUrl; ?>css/font-awesome.min.css"> |
|
102 | + <link rel="stylesheet" href="<?php echo $baseUrl; ?>style.css" type="text/css"> |
|
103 | 103 | |
104 | - <link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico"> |
|
105 | - <link rel="icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico"> |
|
106 | - <link rel="icon" type="image/gif" href="<?php echo $baseUrl;?>img/favicon/favicon.gif"> |
|
107 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon.png"> |
|
108 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon.png"> |
|
109 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57"> |
|
110 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60"> |
|
111 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72"> |
|
112 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76"> |
|
113 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114"> |
|
114 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120"> |
|
115 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128"> |
|
116 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144"> |
|
117 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152"> |
|
118 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180"> |
|
119 | - <link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-precomposed.png"> |
|
120 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-16x16.png" sizes="16x16"> |
|
121 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-32x32.png" sizes="32x32"> |
|
122 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-96x96.png" sizes="96x96"> |
|
123 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-160x160.png" sizes="160x160"> |
|
124 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-192x192.png" sizes="192x192"> |
|
125 | - <link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-196x196.png" sizes="196x196"> |
|
126 | - <meta name="msapplication-TileImage" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> |
|
104 | + <link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico"> |
|
105 | + <link rel="icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico"> |
|
106 | + <link rel="icon" type="image/gif" href="<?php echo $baseUrl; ?>img/favicon/favicon.gif"> |
|
107 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon.png"> |
|
108 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon.png"> |
|
109 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57"> |
|
110 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60"> |
|
111 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72"> |
|
112 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76"> |
|
113 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114"> |
|
114 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120"> |
|
115 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128"> |
|
116 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144"> |
|
117 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152"> |
|
118 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180"> |
|
119 | + <link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-precomposed.png"> |
|
120 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-16x16.png" sizes="16x16"> |
|
121 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-32x32.png" sizes="32x32"> |
|
122 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-96x96.png" sizes="96x96"> |
|
123 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-160x160.png" sizes="160x160"> |
|
124 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-192x192.png" sizes="192x192"> |
|
125 | + <link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-196x196.png" sizes="196x196"> |
|
126 | + <meta name="msapplication-TileImage" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> |
|
127 | 127 | <meta name="msapplication-TileColor" content="#5682a3"> |
128 | 128 | <meta name="msapplication-navbutton-color" content="#5682a3"> |
129 | 129 | <meta name="application-name" content="JodelBlue"/> |
130 | 130 | <meta name="msapplication-tooltip" content="JodelBlue"/> |
131 | 131 | <meta name="apple-mobile-web-app-title" content="JodelBlue"/> |
132 | - <meta name="msapplication-square70x70logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-70x70.png"> |
|
133 | - <meta name="msapplication-square144x144logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> |
|
134 | - <meta name="msapplication-square150x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-150x150.png"> |
|
135 | - <meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x150.png"> |
|
136 | - <meta name="msapplication-square310x310logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x310.png"> |
|
132 | + <meta name="msapplication-square70x70logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-70x70.png"> |
|
133 | + <meta name="msapplication-square144x144logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> |
|
134 | + <meta name="msapplication-square150x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-150x150.png"> |
|
135 | + <meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x150.png"> |
|
136 | + <meta name="msapplication-square310x310logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x310.png"> |
|
137 | 137 | </head> |
138 | 138 | |
139 | 139 | <body> |
@@ -184,9 +184,9 @@ discard block |
||
184 | 184 | <h2>Voting</h2> |
185 | 185 | <form> |
186 | 186 | <input placeholder="quantity" id="quantityDelay" type="number" name="quantity"><br> |
187 | - <input placeholder="min interval" id="minDelay" value="<?php echo $config['minInterval'];?>" type="text" name="min"><br> |
|
188 | - <input placeholder="max interval" id="maxDelay" value="<?php echo $config['maxInterval'];?>" type="text" name="max"><br> |
|
189 | - <input placeholder="postId" id="postIdDelay" value="<?php if(isset($_GET['postId'])) echo $_GET['postId'];?>" type="text" name="postId"><br> |
|
187 | + <input placeholder="min interval" id="minDelay" value="<?php echo $config['minInterval']; ?>" type="text" name="min"><br> |
|
188 | + <input placeholder="max interval" id="maxDelay" value="<?php echo $config['maxInterval']; ?>" type="text" name="max"><br> |
|
189 | + <input placeholder="postId" id="postIdDelay" value="<?php if(isset($_GET['postId'])) echo $_GET['postId']; ?>" type="text" name="postId"><br> |
|
190 | 190 | <button type="button" name="vote" value="up" class="half" onclick="voteWithAjax('up');">Upvote</button> |
191 | 191 | <button type="button" name="vote" value="down" class="half" onclick="voteWithAjax('down');">Downvote</button><br> |
192 | 192 | </form> |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | { |
248 | 248 | $.ajax({ |
249 | 249 | type: "POST", |
250 | - url: "<?php echo $baseUrl;?>vote-ajax.php", |
|
250 | + url: "<?php echo $baseUrl; ?>vote-ajax.php", |
|
251 | 251 | data: {"vote" : data["vote"], |
252 | 252 | "postId" : data["id"]}, |
253 | 253 | success: function(result){ |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | console.log(solution); |
302 | 302 | $.ajax({ |
303 | 303 | type: "POST", |
304 | - url: "<?php echo $baseUrl;?>vote-ajax.php?solution=" + solution + "&key="+key, |
|
304 | + url: "<?php echo $baseUrl; ?>vote-ajax.php?solution=" + solution + "&key="+key, |
|
305 | 305 | data: {"deviceUid" : deviceUid}, |
306 | 306 | success: function(result){ |
307 | 307 | var response = JSON.parse(result); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | function user_log($msg) |
51 | 51 | { |
52 | - $log = $msg . PHP_EOL; |
|
52 | + $log = $msg . PHP_EOL; |
|
53 | 53 | file_put_contents(realpath(__DIR__ . '/..') . '/logs/user_log-' . date("j.n.Y") . '.txt', $log, FILE_APPEND); |
54 | 54 | } |
55 | 55 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | preg_match('/bot|spider|google|twitter/i', $_SERVER['HTTP_USER_AGENT'], $matches); |
59 | 59 | |
60 | - return (isset($matches[0])) ? true : false; |
|
60 | + return (isset($matches[0]))?true : false; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | function configPropertyExists($config, $property) |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | function isUserAdmin() |
99 | 99 | { |
100 | 100 | global $config; |
101 | - if (isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword']) |
|
101 | + if(isset($_COOKIE['JodelAdminPassword']) && configPropertyExists($config, 'pw') && $config['pw'] == $_COOKIE['JodelAdminPassword']) |
|
102 | 102 | { |
103 | 103 | return TRUE; |
104 | 104 | } |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | function isDeviceUidInDatabase($deviceUid) |
112 | 112 | { |
113 | 113 | $db = new DatabaseConnect(); |
114 | - $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'"); |
|
114 | + $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $deviceUid . "'"); |
|
115 | 115 | |
116 | - if ($result->num_rows > 0) |
|
116 | + if($result->num_rows > 0) |
|
117 | 117 | { |
118 | 118 | return TRUE; |
119 | 119 | } |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | if(!isset($_COOKIE['JodelDeviceId']) || !isDeviceUidInDatabase($_COOKIE['JodelDeviceId'])) |
136 | 136 | { |
137 | 137 | $jodelAccountForView = new JodelAccount(); |
138 | - setcookie('JodelDeviceId', $jodelAccountForView->deviceUid, time()+60*60*24*365*10); |
|
139 | - user_log('Created account with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']'); |
|
138 | + setcookie('JodelDeviceId', $jodelAccountForView->deviceUid, time() + 60 * 60 * 24 * 365 * 10); |
|
139 | + user_log('Created account with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' for [' . $_SERVER ['HTTP_USER_AGENT'] . ']'); |
|
140 | 140 | |
141 | 141 | } |
142 | 142 | else |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | if(isset($_GET['search'])) |
166 | 166 | { |
167 | 167 | |
168 | - user_log('User with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] searched for ' . $_GET['search']); |
|
168 | + user_log('User with JodelDeviceId:' . $jodelAccountForView->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] searched for ' . $_GET['search']); |
|
169 | 169 | |
170 | 170 | if(substr($_GET['search'], 0, 1) === "#") |
171 | 171 | { |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | |
221 | 221 | if(isset($_GET['view'])) |
222 | 222 | { |
223 | - switch ($_GET['view']) { |
|
223 | + switch($_GET['view']) { |
|
224 | 224 | case 'discussed': |
225 | 225 | $view = 'discussed'; |
226 | 226 | break; |
@@ -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; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | case 502: |
117 | 117 | error_log('Error 502 - ' . print_r($result, true)); |
118 | 118 | $result = json_decode($result->body, true); |
119 | - header('location:'.$_SERVER['PHP_SELF']); |
|
119 | + header('location:' . $_SERVER['PHP_SELF']); |
|
120 | 120 | break; |
121 | 121 | case 503: |
122 | 122 | error_log('Error 503 - ' . print_r($result, true)); |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | |
125 | 125 | if(array_key_exists('error', $result) && $result['error'] == 'Service Unavailable') |
126 | 126 | { |
127 | - header('location:'.$_SERVER['PHP_SELF']); |
|
127 | + header('location:' . $_SERVER['PHP_SELF']); |
|
128 | 128 | } |
129 | 129 | break; |
130 | 130 | default: |
131 | - error_log('Error '.$result->status_code.' - unknown error'); |
|
131 | + error_log('Error ' . $result->status_code . ' - unknown error'); |
|
132 | 132 | $result = json_decode($result->body, true); |
133 | 133 | } |
134 | 134 |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | { |
18 | 18 | error_log('ER_TOO_MANY_USER_CONNECTIONS'); |
19 | 19 | sleep(1); |
20 | - header('location: '.$_SERVER['PHP_SELF']); |
|
20 | + header('location: ' . $_SERVER['PHP_SELF']); |
|
21 | 21 | } |
22 | 22 | |
23 | -if ($db->connect_errno) { |
|
23 | +if($db->connect_errno) { |
|
24 | 24 | echo 'Sorry, die Verbindung zu unserem |
25 | 25 | Server ist hops gegangen. Wegen '. $db -> connect_error; |
26 | 26 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | PRIMARY KEY (`id`) |
55 | 55 | ) DEFAULT CHARSET=utf8"; |
56 | 56 | |
57 | -$query3 = "CREATE TABLE IF NOT EXISTS `users` ( |
|
57 | +$query3 = "CREATE TABLE IF NOT EXISTS `users` ( |
|
58 | 58 | `id` int(11) unsigned NOT NULL auto_increment, |
59 | 59 | `device_uid` varchar(255) NOT NULL, |
60 | 60 | `rights` varchar(255) NOT NULL, |
@@ -63,25 +63,25 @@ discard block |
||
63 | 63 | $timediff_inDays = (string)$timediff->format('%d'); |
64 | 64 | $timediff_inMonth = (string)$timediff->format('%m'); |
65 | 65 | |
66 | - if($timediff_inMonth!=0) |
|
66 | + if($timediff_inMonth != 0) |
|
67 | 67 | { |
68 | 68 | $timediff = $timediff_inMonth . "m"; |
69 | 69 | } |
70 | 70 | else |
71 | 71 | { |
72 | - if($timediff_inDays!=0) |
|
72 | + if($timediff_inDays != 0) |
|
73 | 73 | { |
74 | 74 | $timediff = $timediff_inDays . "d"; |
75 | 75 | } |
76 | 76 | else |
77 | 77 | { |
78 | - if($timediff_inHours!=0) |
|
78 | + if($timediff_inHours != 0) |
|
79 | 79 | { |
80 | 80 | $timediff = $timediff_inHours . "h"; |
81 | 81 | } |
82 | 82 | else |
83 | 83 | { |
84 | - if($timediff_inMinutes!=0) |
|
84 | + if($timediff_inMinutes != 0) |
|
85 | 85 | { |
86 | 86 | $timediff = $timediff_inMinutes . "m"; |
87 | 87 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | |
97 | 97 | ?> |
98 | - <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color'];?>;"> |
|
98 | + <article id ="postId-<?php echo $post['post_id']; ?>" class="jodel" style="background-color: #<?php echo $post['color']; ?>;"> |
|
99 | 99 | <content> |
100 | 100 | <?php |
101 | 101 | if(isset($post['image_url'])) |
@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | ?> |
111 | 111 | </content> |
112 | 112 | <aside> |
113 | - <button onclick="vote('<?php echo $post['post_id'];?>', 'up', this)"> |
|
113 | + <button onclick="vote('<?php echo $post['post_id']; ?>', 'up', this)"> |
|
114 | 114 | <i class="fa fa-angle-up fa-3x"></i> |
115 | 115 | </button> |
116 | - <br><span><?php echo $post["vote_count"];?></span><br> |
|
116 | + <br><span><?php echo $post["vote_count"]; ?></span><br> |
|
117 | 117 | |
118 | - <button onclick="vote('<?php echo $post['post_id'];?>', 'down', this)"> |
|
118 | + <button onclick="vote('<?php echo $post['post_id']; ?>', 'down', this)"> |
|
119 | 119 | <i class="fa fa-angle-down fa-3x"></i> |
120 | 120 | </button> |
121 | 121 | </aside> |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | <span class="time"> |
127 | 127 | <span class="tip" data-tooltip="Time"> |
128 | 128 | <i class="fa fa-clock-o"></i> |
129 | - <?php echo $timediff;?> |
|
130 | - <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s');?></span> |
|
129 | + <?php echo $timediff; ?> |
|
130 | + <span class="tiptext"><?php echo $d->format('Y-m-d H:i:s'); ?></span> |
|
131 | 131 | </span> |
132 | 132 | </span> |
133 | 133 | <?php if(!$this->isDetailedView) {?> |
134 | 134 | <span class="comments"> |
135 | 135 | <span data-tooltip="Comments"> |
136 | - <a href="<?php echo $this->changePostId($post['post_id'])->toUrl();?>"> |
|
136 | + <a href="<?php echo $this->changePostId($post['post_id'])->toUrl(); ?>"> |
|
137 | 137 | <i class="fa fa-commenting-o"></i> |
138 | 138 | <?php if(array_key_exists("child_count", $post)) |
139 | 139 | { |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | { |
177 | 177 | ?> |
178 | 178 | <span data-tooltip="Author"> |
179 | - <i class="fa fa-user-o"></i> #<?php echo $post['user_handle'];?> | |
|
179 | + <i class="fa fa-user-o"></i> #<?php echo $post['user_handle']; ?> | |
|
180 | 180 | </span> |
181 | 181 | <?php |
182 | 182 | } |
@@ -186,8 +186,8 @@ discard block |
||
186 | 186 | |
187 | 187 | <span class="tip" data-tooltip="Distance"> |
188 | 188 | <i class="fa fa-map-marker"></i> |
189 | - <?php echo $post['distance'];?> km |
|
190 | - <span class="tiptext"><?php echo $post['location']['name'];?></span> |
|
189 | + <?php echo $post['distance']; ?> km |
|
190 | + <span class="tiptext"><?php echo $post['location']['name']; ?></span> |
|
191 | 191 | </span> |
192 | 192 | </span> |
193 | 193 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | |
227 | 227 | if($post != '' && array_key_exists('message', $post) && $post['message'] != '' && $this->isDetailedView) |
228 | 228 | { |
229 | - $description = 'On JodelBlue in ' . htmlspecialchars($this->city) . ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130); |
|
229 | + $description = 'On JodelBlue in ' . htmlspecialchars($this->city) . ' with ' . htmlspecialchars($post['vote_count']) . ' Upvotes: ' . substr(htmlspecialchars($post['message']), 0, 130); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | return $description; |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | { |
329 | 329 | return $data['recent']; |
330 | 330 | } |
331 | - else if(array_key_exists('posts', $data)&& array_key_exists(0, $data['posts'])) |
|
331 | + else if(array_key_exists('posts', $data) && array_key_exists(0, $data['posts'])) |
|
332 | 332 | { |
333 | 333 | return $data['posts']; |
334 | 334 | } |