Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

why doesn't upload all images


Salvo

Recommended Posts

Posted

HI

can someone tell me where I am mistaking here?

Iam using additional images contributions. amended to upload 6 images (1 size)

 

 

case 'add_images':

$products_id = $HTTP_GET_VARS['pID'];

$add_images_error = true;

if ($medium_images = new upload('medium_images', DIR_FS_CATALOG_IMAGES_ADDITIONAL)) {

$add_images_error = false;

$sql_data_array = array('products_id' => tep_db_prepare_input($products_id),

'images_description' => tep_db_prepare_input($HTTP_POST_VARS['images_description']),

'medium_images' => tep_db_prepare_input($medium_images->filename));

if ($popup_images = new upload('popup_images', DIR_FS_CATALOG_IMAGES_ADDITIONAL_BIG)) {

$add_data_array = array('popup_images' => tep_db_prepare_input($popup_images->filename));

} else {

$add_data_array = array('popup_images' => tep_db_prepare_input($medium_images->filename));

}

$sql_data_array = array_merge($sql_data_array, $add_data_array);

}

 

if ($add_images_error == false) {

tep_db_perform(TABLE_ADDITIONAL_IMAGES, $sql_data_array);

} else {

$messageStack->add_session(ERROR_ADDITIONAL_IMAGE_IS_EMPTY, 'error');

}

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));

break;

 

*********************

 

case 'new_images':

$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_IMAGES . '</b>');

 

$contents = array('form' => tep_draw_form('new_images', FILENAME_CATEGORIES, 'action=add_images&cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID'], 'post', 'enctype="multipart/form-data"'));

$contents[] = array('text' => TEXT_NEW_IMAGES_INTRO);

 

 

 

$contents[] = array('text' => '<br>' . TEXT_PRODUCTS_IMAGES_DESC . '<br>' . tep_draw_textarea_field('images_description', 'soft', '60', '2'));

 

 

 

$file_upload = '';

for ($i=1; $i<6; $i++) $file_upload .= tep_draw_file_field('medium_images' . $i) . '<br>';

$contents[] = array('text' => '<br>' . $file_upload);

 

 

$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');

break;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...