diff options
-rw-r--r-- | styles/style.css | 5 | ||||
-rw-r--r-- | thread.php | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/styles/style.css b/styles/style.css index f83a9b6..0455b46 100644 --- a/styles/style.css +++ b/styles/style.css @@ -128,12 +128,17 @@ th a:hover { .youtube-embed { width: 480px; height: 270px; + border: none; } .image-embed { width: 480px; } +.greentext { + color: darkolivegreen; +} + h1, h4 { margin-top: 2px; margin-bottom: 10px; @@ -15,6 +15,10 @@ function add_quote($dbc, $thread_id, $matches) { $reply = mysqli_fetch_assoc($result); + if (empty($reply)) { + return '<blockquote>Invalid quote!</blockquote>'; + } + return '<blockquote><a href="#' . $id + 1 .'">Quote from ' . $reply['user_name'] . '</a><br>' . $reply['post_content'] . '</blockquote>'; } } @@ -69,7 +73,7 @@ if (mysqli_num_rows($result) == 0) { '<br><iframe class="youtube-embed" src="//www.youtube.com/embed/$2" allowfullscreen></iframe>', $post_content); $post_content = preg_replace('/(https?:\/\/[^ ]+?(?:\.jpg|\.png|\.gif))/', '<img class="image-embed" src="$1" alt="$1" />', $post_content); - + //$post_content = preg_replace('/^>/', '<span class="greentext">garb</span>', $post_content); $post_content = preg_replace('@\b(http(s)?://)?([^\s]*?(?:\.[a-z\d?=/_-]+)+)(?![^<]*?(?:</\w+>|/?>))@i', '<a href="http$2://$3">$0</a>', $post_content); echo '<td class="post-content">' . $post_content . '</td></tr>'; |