Ejemplo n.º 1
0
    if (isset($HTTP_GET_VARS['num_newimages']) || isset($HTTP_POST_VARS['num_newimages'])) {
        $num_newimages = isset($HTTP_GET_VARS['num_newimages']) ? intval($HTTP_GET_VARS['num_newimages']) : intval($HTTP_POST_VARS['num_newimages']);
    } else {
        $num_newimages = 1;
    }
    if ($msg != "") {
        printf("<b>%s</b>\n", $msg);
    }
    printf("<p>%s</p>\n", $lang['upload_note']);
    show_form_header("images.php", "saveimages", "form", 1);
    show_table_header($lang['nav_images_add'], 2);
    show_num_select_row("&nbsp;", "num_newimages", $lang['num_addnewimages_desc']);
    for ($i = 1; $i <= $num_newimages; $i++) {
        show_table_separator($lang['image'] . " " . $i, 2);
        show_upload_row($lang['image'], "file_" . $i, "<br /><span class=smalltext>" . $lang['allowed_mediatypes_desc'] . str_replace(",", ", ", $config['allowed_mediatypes']) . "</span>");
        show_upload_row($lang['thumb'], "thumb_file_" . $i, "<br /><span class=smalltext>" . $lang['allowed_mediatypes_desc'] . " jpg, gif, png</span>");
        show_input_row($lang['field_download_url'] . $lang['download_url_desc'], "image_download_url_" . $i, "", $textinput_size);
        show_input_row($lang['field_image_name'], "image_name_" . $i, "", $textinput_size);
        show_textarea_row($lang['field_description_ext'], "image_description_" . $i, "", $textarea_size);
        show_textarea_row($lang['field_keywords_ext'], "image_keywords_" . $i, "", $textarea_size);
        show_cat_select_row($lang['field_category'], 0, 3, $i);
        show_user_select_row($lang['user'], $user_info['user_id'], $i);
        show_radio_row($lang['field_free'], "image_active_" . $i, 1);
        show_radio_row($lang['field_allow_comments'], "image_allow_comments_" . $i, 1);
        show_additional_fields("image", array(), IMAGES_TABLE, $i);
    }
    show_hidden_input("num_newimages", $num_newimages);
    show_form_footer($lang['add'], $lang['reset'], 2, "", " onClick='showProgress()'");
}
if ($action == "modifyimages") {
    show_form_header("images.php", "findimages", "form");
Ejemplo n.º 2
0
    show_hidden_input("old_file_name", $image_row['image_media_file']);
    show_hidden_input("old_thumb_file_name", $image_row['image_thumb_file']);
    show_table_header($lang['nav_images_edit'] . ": " . format_text($image_row['image_name'], 2), 2);
    $file_src = get_file_path($image_row['image_media_file'], "media", 0, 1);
    show_image_row($lang['image'] . "<br /><span class=\"smalltext\">(" . $image_row['image_media_file'] . ")</span>", $file_src, 1);
    $value = is_remote($image_row['image_media_file']) || is_local_file($image_row['image_media_file']) ? $image_row['image_media_file'] : "";
    show_upload_row($lang['image_file'], "file", "<br /><span class=\"smalltext\">" . $lang['allowed_mediatypes_desc'] . str_replace(",", ", ", $config['allowed_mediatypes']) . "</span>", $value);
    if (!empty($image_row['image_thumb_file'])) {
        $thumb_src = get_file_path($image_row['image_thumb_file'], "thumb", 0, 1);
        show_image_row($lang['thumb'] . "<br /><span class=\"smalltext\">(" . $image_row['image_thumb_file'] . ")</span>", $thumb_src, 1, "delete_thumb_file");
    } else {
        $file_type = get_file_extension($image_row['image_media_file']);
        show_image_row($lang['thumb'] . "<br /><span class=smalltext>(" . $lang['no_thumb_found'] . ")</span>", ICON_PATH . "/" . $file_type . ".gif", 1);
    }
    $value = is_remote($image_row['image_thumb_file']) || is_local_file($image_row['image_thumb_file']) ? $image_row['image_thumb_file'] : "";
    show_upload_row($lang['thumb_file'], "thumb_file", "<br /><span class=\"smalltext\">" . $lang['allowed_mediatypes_desc'] . " jpg, gif, png</span>", $value);
    show_input_row($lang['field_download_url'] . $lang['download_url_desc'], "image_download_url", "", $textinput_size);
    show_input_row($lang['field_image_name'], "image_name", $image_row['image_name'], $textinput_size);
    show_textarea_row($lang['field_description_ext'], "image_description", $image_row['image_description'], $textarea_size);
    show_textarea_row($lang['field_keywords_ext'], "image_keywords", $image_row['image_keywords'], $textarea_size);
    show_cat_select_row($lang['field_category'], $image_row['cat_id'], 3);
    show_user_select_row($lang['user'], $image_row['user_id']);
    show_input_row($lang['field_date'] . $lang['date_desc'], "image_date", $image_row['image_date'], $textinput_size);
    show_additional_fields("image", $image_row, IMAGES_TEMP_TABLE);
    show_form_footer($lang['save_changes'], $lang['reset'], 2, "", " onClick='showProgress()'");
}
if ($action == "saveimages") {
    $image_list = isset($HTTP_POST_VARS['image_list']) ? $HTTP_POST_VARS['image_list'] : "";
    if (!empty($image_list)) {
        $image_id_sql = "";
        foreach ($image_list as $key => $val) {