@@ -16,14 +16,14 @@ discard block |
||
| 16 | 16 | return $result; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - function build_message($message){ |
|
| 19 | + function build_message($message) { |
|
| 20 | 20 | $result = ""; |
| 21 | 21 | $result = $result . "<div class='message'>"; |
| 22 | 22 | $result = $result . "<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'>"; |
| 23 | 23 | if ($message['file'] != "") { |
| 24 | - if(substr($message['file'], -4) == "webm" || substr($message['file'], -3) == "mp4"){ |
|
| 24 | + if (substr($message['file'], -4) == "webm" || substr($message['file'], -3) == "mp4") { |
|
| 25 | 25 | $result = $result . '<div><video width="600" controls loop><source src="images/' . $message['file'] . '" type="video/mp4"></video></div><br />'; |
| 26 | - }else{ |
|
| 26 | + }else { |
|
| 27 | 27 | $result = $result . "<div><a href='images/" . $message['file'] . "'><img src = 'images/" . $message['file'] . "' class='message-image'/></a></div>"; |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -31,21 +31,21 @@ discard block |
||
| 31 | 31 | return $result; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - function check_empty($msgs){ |
|
| 34 | + function check_empty($msgs) { |
|
| 35 | 35 | if (isset($msgs) && $msgs != "") { |
| 36 | 36 | $msg = $msgs; |
| 37 | - } else { |
|
| 37 | + }else { |
|
| 38 | 38 | $msg = "something's wrong, this nerve is either empty or our brain doesn't have access to this nerve's messages..."; |
| 39 | 39 | } |
| 40 | 40 | return $msg; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - function build_result($msg, $last_msg, $action){ |
|
| 43 | + function build_result($msg, $last_msg, $action) { |
|
| 44 | 44 | if ($action == "messages") { |
| 45 | 45 | $result = $msg; |
| 46 | - } else if ($action == "last_msg") { |
|
| 46 | + }else if ($action == "last_msg") { |
|
| 47 | 47 | $result = $last_msg; |
| 48 | - } else { |
|
| 48 | + }else { |
|
| 49 | 49 | $result = "show_messages: parameters <b>must</b> be \$messages and either 'messages' or 'last_msg'"; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | if ($message['file'] != "") { |
| 24 | 24 | if(substr($message['file'], -4) == "webm" || substr($message['file'], -3) == "mp4"){ |
| 25 | 25 | $result = $result . '<div><video width="600" controls loop><source src="images/' . $message['file'] . '" type="video/mp4"></video></div><br />'; |
| 26 | - }else{ |
|
| 26 | + } else{ |
|
| 27 | 27 | $result = $result . "<div><a href='images/" . $message['file'] . "'><img src = 'images/" . $message['file'] . "' class='message-image'/></a></div>"; |
| 28 | 28 | } |
| 29 | 29 | } |