diff options
-rw-r--r-- | thread.php | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -19,7 +19,9 @@ function add_quote($dbc, $thread_id, $matches) { return '<blockquote>Invalid quote!</blockquote>'; } - return '<blockquote><a href="#' . $id + 1 .'">Quote from ' . $reply['user_name'] . '</a><br>' . $reply['post_content'] . '</blockquote>'; + $id = $id + 1; + + return '<blockquote><a href="#' . $id .'">Quote from ' . $reply['user_name'] . '</a><br>' . $reply['post_content'] . '</blockquote>'; } } @@ -72,9 +74,9 @@ if (mysqli_num_rows($result) == 0) { "/\s*[a-zA-Z\/\/:\.]*youtu(be.com\/watch\?v=|.be\/)([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i", '<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('@\b(http(s)?://)([^\s]*?(?:\.[a-z\d?=/_-]+)+(?:\.jpg|\.png|\.gif))(?![^<]*?(?:</\w+>|/?>))@i', '<img class="image-embed" src="http$2://$3" alt="http$2://$3" />', $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); + $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>'; |