<?php
    $_id = isset($_GET['i']) ? intval($_GET['i']) : '';

    $community_messages = mysqli_query_logged("SELECT community_messages.message_user_id, community_messages_bodies.message_body FROM community_messages, community_messages_bodies WHERE community_messages.message_id = " . sq($_id) . " AND community_messages.message_id = community_messages_bodies.message_id");
    if ($community_messages_row = mysqli_fetch_assoc($community_messages))
    {
        $message = "[quote][b]Originally Posted By " . htmlentities(get_username($community_messages_row['message_user_id'])) . "[/b]\r\n" . htmlentities($community_messages_row['message_body'])."\r\n[/quote]\r\n";
        $str = addslashes(str_replace("\r\n", '##NEWLINE##', $message));
        echo "document.getElementById('reply_playarea').innerHTML = rep(\"" . $str . "\", '##NEWLINE##', \"\\r\\n\");";
    }
?>