// Add a new album
            $action_result = add_album($_POST['name'], $_POST['description'], $_POST['parent_collection']);
            break;
    }
    if (!empty($action_result['errors'])) {
        // If there are any errors from the actions above, display the errors for the user
        $output .= "\n\t" . '<p class="errors">' . $action_result['errors'] . '</p>' . "\n";
    } elseif (!empty($action_result['output'])) {
        // Else if no errors, display the successful output
        $output .= "\n\t" . '<p class="success">' . $action_result['output'] . '</p>' . "\n";
    }
}
if (!isset($edit_page)) {
    // Display the gallery statistics on the main page
    if ($level == 'collections') {
        $output .= "\n\t" . '<p class="stats"><strong>' . plog_tr('Gallery Stats:') . '</strong> ' . plog_tr('You have') . ' <strong>' . count_collections() . '</strong> ' . plog_tr('collections, which contain') . ' <strong>' . count_albums() . '</strong> ' . plog_tr('albums and') . ' <strong>' . count_pictures() . '</strong> ' . plog_tr('images. Users have posted') . ' <strong>' . count_comments() . '</strong> ' . plog_tr('comments to your gallery.') . '</p>' . "\n";
    }
    // Here we will generate an 'add collection/album' header form
    if ($level == 'collections') {
        $output .= plog_add_collection_form();
    } else {
        if ($level == 'albums') {
            $output .= plog_add_album_form($id);
        }
    }
    // Let's iterate through all the content and build a table
    // Set the default level if nothing is specified
    // Handle pagination
    // Let's determine the limit filter based on current page and number of results per page
    if (isset($_REQUEST['entries_per_page'])) {
        $_SESSION['entries_per_page'] = $_REQUEST['entries_per_page'];
				<h3 style="text-indent: 10px; margin-bottom: 15px;">' . plog_tr('-- OR --') . '</h3>
				<div>
					<input tabindex="60" onclick="var k=document.getElementsByName(\'new_album_name\');k[0].focus();" type="radio" name="destination_radio" accesskey="b" value="new" />
					<label for="new_album_name" style="display: inline;">' . plog_tr('Create a New Al<em>b</em>um') . '</label>
					<label class="no-margin-bottom" for="new_album_name" style="font-weight: normal;">' . plog_tr('New Album Name') . ':</label>
					<input class="no-margin-top" tabindex="70" style="width: 79%;" onclick="var k=document.getElementsByName(\'destination_radio\');k[1].checked=true;" type="text" id="new_album_name" name="new_album_name" />
					<label class="no-margin-bottom" for="collections_menu" style="font-weight: normal;">' . plog_tr('In Collection') . ':</label>
					' . generate_collections_menu() . '
				</div>
				<p class="align-left no-margin-top no-margin-bottom" style="text-indent: 5px;"><input class="submit" type="submit" name="upload" value="' . plog_tr('Upload') . '" /></p>
			</td>
		</tr>
	</table>
	</form>' . "\n";
$output_error = "\n\t" . '<h1>' . plog_tr('Upload Images') . '</h1>

	<p class="actions">' . sprintf(plog_tr('Before you can begin uploading images to your gallery, you must create at least <strong>one collection</strong> AND <strong>one album</strong> within that collection. Move over to the <a href="%s">Manage</a> tab to begin creating your gallery structure.'), 'plog-manage.php') . '</p>';
require_once PLOGGER_DIR . 'plog-admin/includes/install-functions.php';
if (gd_missing()) {
    $output_error = "\n\t" . '<h1>' . plog_tr('Upload Images') . '</h1>

	<p class="errors">' . plog_tr('PHP GD extension is not installed, it is required to upload images.') . '</p>';
    display($output_error, 'upload');
} else {
    $num_albums = count_albums();
    if ($num_albums > 0) {
        display($output, 'upload');
    } else {
        display($output_error, 'upload');
    }
}