@@ -7,9 +7,9 @@ discard block |
||
| 7 | 7 | $display_messages = $display_messages . "<div class='title' id='" . $message['id'] . "'><span class='name'>Anonymous</span> " . $message['date'] . " id. <a href='#" . $message['id'] . "'>" . $message['id'] . "</a></div><div class = 'message-inside'>"; |
| 8 | 8 | |
| 9 | 9 | if ($message['file'] != "") { |
| 10 | - if(substr($message['file'], -4) == "webm" || substr($message['file'], -3) == "mp4"){ |
|
| 10 | + if (substr($message['file'], -4) == "webm" || substr($message['file'], -3) == "mp4") { |
|
| 11 | 11 | $display_messages = $display_messages . '<div><video width="600" controls loop><source src="/images/' . $message['file'] . '" type="video/mp4"></video></div><br />'; |
| 12 | - }else{ |
|
| 12 | + }else { |
|
| 13 | 13 | $display_messages = $display_messages . "<div><a href='images/" . $message['file'] . "'><img src = 'images/" . $message['file'] . "' class='message-image'/></a></div>"; |
| 14 | 14 | } |
| 15 | 15 | } |
@@ -19,15 +19,15 @@ discard block |
||
| 19 | 19 | } |
| 20 | 20 | if (isset($display_messages) && $display_messages != "") { |
| 21 | 21 | $msg = $display_messages; |
| 22 | - } else { |
|
| 22 | + }else { |
|
| 23 | 23 | $msg = "something's wrong, this nerve is either empty or our brain doesn't have access to this nerve's messages..."; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | if ($action == "messages") { |
| 27 | 27 | $result = $msg; |
| 28 | - } else if ($action == "last_msg") { |
|
| 28 | + }else if ($action == "last_msg") { |
|
| 29 | 29 | $result = $last_msg; |
| 30 | - } else { |
|
| 30 | + }else { |
|
| 31 | 31 | $result = "show_messages: parameters <b>must</b> be either 'messages' or 'last_msg'"; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -13,10 +13,10 @@ discard block |
||
| 13 | 13 | $uploadOk = 1; |
| 14 | 14 | $imageFileType = strtolower(pathinfo($target_file, PATHINFO_EXTENSION)); |
| 15 | 15 | $check = getimagesize($_FILES["file"]["tmp_name"]); |
| 16 | - if($imageFileType != "webm" && $imageFileType != "mp4"){ |
|
| 16 | + if ($imageFileType != "webm" && $imageFileType != "mp4") { |
|
| 17 | 17 | if ($check !== false) { |
| 18 | 18 | $uploadOk = 1; |
| 19 | - } else { |
|
| 19 | + }else { |
|
| 20 | 20 | echo "what are you doing anon? that file was not an image or a webm..."; |
| 21 | 21 | $uploadOk = 0; |
| 22 | 22 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | // Upload the file |
| 38 | 38 | if ($uploadOk == 0) { |
| 39 | 39 | echo "Sorry, your file was not uploaded."; |
| 40 | - } else { |
|
| 40 | + }else { |
|
| 41 | 41 | move_uploaded_file($_FILES["file"]["tmp_name"], $target_file); |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | array_push($messages["messages"], $new_message); |
| 61 | 61 | $jsondata = json_encode($messages, JSON_PRETTY_PRINT); |
| 62 | 62 | file_put_contents($file, $jsondata); |
| 63 | - } else { |
|
| 63 | + }else { |
|
| 64 | 64 | echo "The message field is <b>required</b>."; |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - function greenText($msg){ |
|
| 68 | + function greenText($msg) { |
|
| 69 | 69 | preg_match_all('/(?<!>)>(?!>).*/', $msg, $matches, PREG_SET_ORDER, 0); |
| 70 | 70 | |
| 71 | 71 | foreach ($matches as $m) { |