@@ -114,7 +114,7 @@ |
||
| 114 | 114 | { |
| 115 | 115 | $response = array("success" => $success, "message" => $message, "captcha" => $captcha, "deviceUid" => $deviceUid); |
| 116 | 116 | } |
| 117 | - else |
|
| 117 | + else |
|
| 118 | 118 | { |
| 119 | 119 | $response = array("success" => $success, "message" => $message); |
| 120 | 120 | } |
@@ -50,7 +50,8 @@ 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 | 55 | $error = db_error(); |
| 55 | 56 | error_log($error); |
| 56 | 57 | error_log("Adding Voter failed: (" . $result->errno . ") " . $result->error); |
@@ -154,7 +155,9 @@ discard block |
||
| 154 | 155 | <article class="topContent col-sm-8"> |
| 155 | 156 | |
| 156 | 157 | <content id="posts" class="adminpanel"> |
| 157 | - <?php if($userIsAdmin) { ?> |
|
| 158 | + <?php if($userIsAdmin) |
|
| 159 | +{ |
|
| 160 | +?> |
|
| 158 | 161 | <h2>account management</h2> |
| 159 | 162 | <form method="post"> |
| 160 | 163 | <div> |
@@ -179,14 +182,19 @@ discard block |
||
| 179 | 182 | <?php |
| 180 | 183 | } |
| 181 | 184 | |
| 182 | - if($userIsVoter) { |
|
| 185 | + if($userIsVoter) |
|
| 186 | + { |
|
| 183 | 187 | ?> |
| 184 | 188 | <h2>Voting</h2> |
| 185 | 189 | <form> |
| 186 | 190 | <input placeholder="quantity" id="quantityDelay" type="number" name="quantity"><br> |
| 187 | 191 | <input placeholder="min interval" id="minDelay" value="<?php echo $config['minInterval'];?>" type="text" name="min"><br> |
| 188 | 192 | <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> |
|
| 193 | + <input placeholder="postId" id="postIdDelay" value="<?php if(isset($_GET['postId'])) |
|
| 194 | +{ |
|
| 195 | + echo $_GET['postId']; |
|
| 196 | +} |
|
| 197 | +?>" type="text" name="postId"><br> |
|
| 190 | 198 | <button type="button" name="vote" value="up" class="half" onclick="voteWithAjax('up');">Upvote</button> |
| 191 | 199 | <button type="button" name="vote" value="down" class="half" onclick="voteWithAjax('down');">Downvote</button><br> |
| 192 | 200 | </form> |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | function isUserVoter() |
| 76 | 76 | { |
| 77 | 77 | if(isset($_COOKIE['JodelVoterPassword'])) |
| 78 | - { |
|
| 78 | + { |
|
| 79 | 79 | $db = new DatabaseConnect(); |
| 80 | 80 | $result = $db->query("SELECT id FROM users WHERE user_token = '" . $_COOKIE['JodelVoterPassword'] . "'"); |
| 81 | 81 | if($result->num_rows == 0) |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if(configPropertyExists($config, 'karmaDeviceUid')) |
| 150 | - { |
|
| 150 | + { |
|
| 151 | 151 | $jodelAccountForKarma = new JodelAccount($config['karmaDeviceUid']); |
| 152 | 152 | } |
| 153 | 153 | else |
@@ -220,7 +220,8 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | if(isset($_GET['view'])) |
| 222 | 222 | { |
| 223 | - switch ($_GET['view']) { |
|
| 223 | + switch ($_GET['view']) |
|
| 224 | + { |
|
| 224 | 225 | case 'discussed': |
| 225 | 226 | $view = 'discussed'; |
| 226 | 227 | break; |