Invalid quote!'; } $id = $id + 1; return '
Quote from ' . $reply['user_name'] . ''; } } function display_posts($dbc, $sql_result) { echo '
' . $reply['post_content'] . '
' . $post_index . ' | |
---|---|
Posted by ' . $row['user_name'] . ' ' . date('m/d/Y g:ia', strtotime($row['post_date'])) . ' | ';
$post_content = $row['post_content'];
$post_content = preg_replace_callback('/>#\d+/', function($matches) use($thread_id, $dbc) {
return add_quote($dbc, $thread_id, $matches);
}, $post_content);
// Replace YouTube URLs with embedded YouTube videos.
$post_content = preg_replace(
"/\s*[a-zA-Z\/\/:\.]*youtu(be.com\/watch\?v=|.be\/)([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i",
'' . $post_content . ' |