$query = $db->query("SELECT message, subject FROM ".TABLE_PREFIX."posts WHERE tid = '{$mybb->input[tid]}' ORDER BY pid ASC LIMIT 1");