}
    }
    // ! Add the page to MySQL.
    $new_page_name ? $new_page_name : ($new_page_name = 'Untitled');
    $blog_post = htmLawed($blog_post);
    $transcript = htmLawed($transcript);
    $data = array('sort_order' => $sort_order, 'title' => $new_page_name, 'book_id' => $book_id, 'tone_id' => $start_tone_id, 'blog_title' => $blog_headline, 'blog_post' => $blog_post, 'transcript' => $transcript, 'date_modified' => $db->NOW(), 'date_publish' => $db->NOW());
    $new_page_id = $db->insert('book_page', $data);
    if ($new_page_id) {
        reset_page_order($book_id, $db);
    }
} elseif ($_POST) {
    $alert_output .= $message->alert_dialog('Huh, I didn’t find any images. Did you select some pics from your computer?');
}
if ($_FILES['file_change'] && $new_page_id) {
    $fileops->up_set_destination_folder('../' . DIR_COMICS_IMG);
    $success = $fileops->up_process('file_change');
    if ($success && $new_page_id) {
        foreach ($success as $filename) {
            // Figure the real file name to make an alt attribute.
            $alt = explode('/', $filename);
            // Break into parts
            $alt = end($alt);
            // Get the last part (should be the file name)
            $alt = explode('.', $alt);
            // Break into parts
            array_pop($alt);
            // Remove the last part (should be the extension)
            $alt = implode('.', $alt);
            // Put it back together
            // Create the image DB record.