summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCflip <36554078+cflip@users.noreply.github.com>2021-01-28 11:15:59 -0700
committerCflip <36554078+cflip@users.noreply.github.com>2021-01-28 11:15:59 -0700
commit64ee5ff9c43b46e6d76f97af4fa2789cd9ea43b3 (patch)
treefd54c365751da54cad818dd2a970541e0f92b3eb
parente5c06f81e065aad0c711ca3baf578b3c0a4fd8d8 (diff)
Fixes and style changes
-rw-r--r--styles/style.css5
-rw-r--r--thread.php6
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;
diff --git a/thread.php b/thread.php
index 7eb0e88..d6d01f8 100644
--- a/thread.php
+++ b/thread.php
@@ -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>';