Jump to content
surfalot

[Contribution] More_pics_6 v1.1 For osC 2.2 MS2

Recommended Posts

Hello,

 

I have a problem with More Pics and Header Tags Controller. These 2 contributions can work together, however I think i've made a mistake some how in the categories.php in the admin. The problem is now More Pics has 2 descritopn boxes and no name box when adding a new product in the admin section...other than this all seems fine.

 

Please could somebody take a look at my categories.php and tell me I get this problem? :blush:

 

<?php

/*

$Id: categories.php,v 1.146 2003/07/11 14:40:27 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright (c) 2003 osCommerce

 

More_pics_6 mod

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

 

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 

if (tep_not_null($action)) {

switch ($action) {

case 'setflag':

if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {

if (isset($HTTP_GET_VARS['pID'])) {

tep_set_product_status($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['flag']);

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID']));

break;

case 'insert_category':

case 'update_category':

if (isset($HTTP_POST_VARS['categories_id'])) $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

$sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);

 

$sql_data_array = array('sort_order' => $sort_order);

 

if ($action == 'insert_category') {

$insert_sql_data = array('parent_id' => $current_category_id,

'date_added' => 'now()');

 

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

 

tep_db_perform(TABLE_CATEGORIES, $sql_data_array);

 

$categories_id = tep_db_insert_id();

} elseif ($action == 'update_category') {

$update_sql_data = array('last_modified' => 'now()');

 

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

 

tep_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "'");

}

 

$languages = tep_get_languages();

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

$categories_name_array = $HTTP_POST_VARS['categories_name'];

//HTC BOC

$categories_htc_title_array = $HTTP_POST_VARS['categories_htc_title_tag'];

$categories_htc_desc_array = $HTTP_POST_VARS['categories_htc_desc_tag'];

$categories_htc_keywords_array = $HTTP_POST_VARS['categories_htc_keywords_tag'];

$categories_htc_description_array = $HTTP_POST_VARS['categories_htc_description'];

//HTC EOC

 

$language_id = $languages[$i]['id'];

 

//HTC BOC

$sql_data_array = array('categories_name' => tep_db_prepare_input($categories_name_array[$language_id]),

'categories_htc_title_tag' => (tep_not_null($categories_htc_title_array[$language_id]) ? tep_db_prepare_input($categories_htc_title_array[$language_id]) : tep_db_prepare_input($categories_name_array[$language_id])),

'categories_htc_desc_tag' => (tep_not_null($categories_htc_desc_array[$language_id]) ? tep_db_prepare_input($categories_htc_desc_array[$language_id]) : tep_db_prepare_input($categories_name_array[$language_id])),

'categories_htc_keywords_tag' => (tep_not_null($categories_htc_keywords_array[$language_id]) ? tep_db_prepare_input($categories_htc_keywords_array[$language_id]) : tep_db_prepare_input($categories_name_array[$language_id])),

'categories_htc_description' => tep_db_prepare_input($categories_htc_description_array[$language_id]));

//HTC EOC

 

if ($action == 'insert_category') {

$insert_sql_data = array('categories_id' => $categories_id,

'language_id' => $languages[$i]['id']);

 

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

 

tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);

} elseif ($action == 'update_category') {

tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'");

}

}

 

if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {

tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));

break;

case 'delete_category_confirm':

if (isset($HTTP_POST_VARS['categories_id'])) {

$categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

 

$categories = tep_get_category_tree($categories_id, '', '0', '', true);

$products = array();

$products_delete = array();

 

for ($i=0, $n=sizeof($categories); $i<$n; $i++) {

$product_ids_query = tep_db_query("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$categories[$i]['id'] . "'");

 

while ($product_ids = tep_db_fetch_array($product_ids_query)) {

$products[$product_ids['products_id']]['categories'][] = $categories[$i]['id'];

}

}

 

reset($products);

while (list($key, $value) = each($products)) {

$category_ids = '';

 

for ($i=0, $n=sizeof($value['categories']); $i<$n; $i++) {

$category_ids .= "'" . (int)$value['categories'][$i] . "', ";

}

$category_ids = substr($category_ids, 0, -2);

 

$check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$key . "' and categories_id not in (" . $category_ids . ")");

$check = tep_db_fetch_array($check_query);

if ($check['total'] < '1') {

$products_delete[$key] = $key;

}

}

 

// removing categories can be a lengthy process

tep_set_time_limit(0);

for ($i=0, $n=sizeof($categories); $i<$n; $i++) {

tep_remove_category($categories[$i]['id']);

}

 

reset($products_delete);

while (list($key) = each($products_delete)) {

tep_remove_product($key);

}

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

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

break;

case 'delete_product_confirm':

if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['product_categories']) && is_array($HTTP_POST_VARS['product_categories'])) {

$product_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

$product_categories = $HTTP_POST_VARS['product_categories'];

 

for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {

tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "' and categories_id = '" . (int)$product_categories[$i] . "'");

}

 

$product_categories_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "'");

$product_categories = tep_db_fetch_array($product_categories_query);

 

if ($product_categories['total'] == '0') {

tep_remove_product($product_id);

}

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

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

break;

case 'move_category_confirm':

if (isset($HTTP_POST_VARS['categories_id']) && ($HTTP_POST_VARS['categories_id'] != $HTTP_POST_VARS['move_to_category_id'])) {

$categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

$new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']);

 

$path = explode('_', tep_get_generated_category_path_ids($new_parent_id));

 

if (in_array($categories_id, $path)) {

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

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));

} else {

tep_db_query("update " . TABLE_CATEGORIES . " set parent_id = '" . (int)$new_parent_id . "', last_modified = now() where categories_id = '" . (int)$categories_id . "'");

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id . '&cID=' . $categories_id));

}

}

 

break;

case 'move_product_confirm':

$products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

$new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']);

 

$duplicate_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$new_parent_id . "'");

$duplicate_check = tep_db_fetch_array($duplicate_check_query);

if ($duplicate_check['total'] < 1) tep_db_query("update " . TABLE_PRODUCTS_TO_CATEGORIES . " set categories_id = '" . (int)$new_parent_id . "' where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$current_category_id . "'");

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

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

break;

case 'insert_product':

case 'update_product':

if (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) {

$action = 'new_product';

} else {

if (isset($HTTP_GET_VARS['pID'])) $products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);

$products_date_available = tep_db_prepare_input($HTTP_POST_VARS['products_date_available']);

 

$products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';

 

$sql_data_array = array('products_quantity' => tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),

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

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

'products_date_available' => $products_date_available,

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

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

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

'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));

 

if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {

$sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['products_image']);

}

// BOF: More Pics 6

//add delete image function

if ($HTTP_POST_VARS['delete_image_1'] == 'yes') {

unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_image']);

$sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['none']);

}

//end delete image function

if (isset($HTTP_POST_VARS['products_subimage1']) && tep_not_null($HTTP_POST_VARS['products_subimage1']) && ($HTTP_POST_VARS['products_subimage1'] != 'none')) {

$sql_data_array['products_subimage1'] = tep_db_prepare_input($HTTP_POST_VARS['products_subimage1']);

}

//add delete image function

if ($HTTP_POST_VARS['delete_image_3'] == 'yes') {

unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_subimage1']);

$sql_data_array['products_subimage1'] = tep_db_prepare_input($HTTP_POST_VARS['none']);

}

//end delete image function

if (isset($HTTP_POST_VARS['products_subimage2']) && tep_not_null($HTTP_POST_VARS['products_subimage2']) && ($HTTP_POST_VARS['products_subimage2'] != 'none')) {

$sql_data_array['products_subimage2'] = tep_db_prepare_input($HTTP_POST_VARS['products_subimage2']);

}

//add delete image function

if ($HTTP_POST_VARS['delete_image_5'] == 'yes') {

unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_subimage2']);

$sql_data_array['products_subimage2'] = tep_db_prepare_input($HTTP_POST_VARS['none']);

}

//end delete image function

if (isset($HTTP_POST_VARS['products_subimage3']) && tep_not_null($HTTP_POST_VARS['products_subimage3']) && ($HTTP_POST_VARS['products_subimage3'] != 'none')) {

$sql_data_array['products_subimage3'] = tep_db_prepare_input($HTTP_POST_VARS['products_subimage3']);

}

//add delete image function

if ($HTTP_POST_VARS['delete_image_7'] == 'yes') {

unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_subimage3']);

$sql_data_array['products_subimage3'] = tep_db_prepare_input($HTTP_POST_VARS['none']);

}

//end delete image function

if (isset($HTTP_POST_VARS['products_subimage4']) && tep_not_null($HTTP_POST_VARS['products_subimage4']) && ($HTTP_POST_VARS['products_subimage4'] != 'none')) {

$sql_data_array['products_subimage4'] = tep_db_prepare_input($HTTP_POST_VARS['products_subimage4']);

}

//add delete image function

if ($HTTP_POST_VARS['delete_image_9'] == 'yes') {

unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_subimage4']);

$sql_data_array['products_subimage4'] = tep_db_prepare_input($HTTP_POST_VARS['none']);

}

//end delete image function

if (isset($HTTP_POST_VARS['products_subimage5']) && tep_not_null($HTTP_POST_VARS['products_subimage5']) && ($HTTP_POST_VARS['products_subimage5'] != 'none')) {

$sql_data_array['products_subimage5'] = tep_db_prepare_input($HTTP_POST_VARS['products_subimage5']);

}

//add delete image function

if ($HTTP_POST_VARS['delete_image_11'] == 'yes') {

unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_subimage5']);

$sql_data_array['products_subimage5'] = tep_db_prepare_input($HTTP_POST_VARS['none']);

}

//end delete image function

if (isset($HTTP_POST_VARS['products_subimage6']) && tep_not_null($HTTP_POST_VARS['products_subimage6']) && ($HTTP_POST_VARS['products_subimage6'] != 'none')) {

$sql_data_array['products_subimage6'] = tep_db_prepare_input($HTTP_POST_VARS['products_subimage6']);

}

//add delete image function

if ($HTTP_POST_VARS['delete_image_13'] == 'yes') {

unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_subimage6']);

$sql_data_array['products_subimage6'] = tep_db_prepare_input($HTTP_POST_VARS['none']);

}

//end delete image function

// EOF: More Pics 6

if ($action == 'insert_product') {

$insert_sql_data = array('products_date_added' => 'now()');

 

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

 

tep_db_perform(TABLE_PRODUCTS, $sql_data_array);

$products_id = tep_db_insert_id();

 

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$current_category_id . "')");

} elseif ($action == 'update_product') {

$update_sql_data = array('products_last_modified' => 'now()');

 

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

 

tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'");

}

 

$languages = tep_get_languages();

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

$language_id = $languages[$i]['id'];

 

//HTC BOC

$sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]),

'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]),

'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]),

'products_head_title_tag' => ((tep_not_null($HTTP_POST_VARS['products_head_title_tag'][$language_id])) ? tep_db_prepare_input($HTTP_POST_VARS['products_head_title_tag'][$language_id]) : tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id])),

'products_head_desc_tag' => ((tep_not_null($HTTP_POST_VARS['products_head_desc_tag'][$language_id])) ? tep_db_prepare_input($HTTP_POST_VARS['products_head_desc_tag'][$language_id]) : tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id])),

'products_head_keywords_tag' => ((tep_not_null($HTTP_POST_VARS['products_head_keywords_tag'][$language_id])) ? tep_db_prepare_input($HTTP_POST_VARS['products_head_keywords_tag'][$language_id]) : tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id])));

//HTC EOC

 

if ($action == 'insert_product') {

$insert_sql_data = array('products_id' => $products_id,

'language_id' => $language_id);

 

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

 

tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);

} elseif ($action == 'update_product') {

tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");

}

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

 

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

}

break;

case 'copy_to_confirm':

if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['categories_id'])) {

$products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

$categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

 

if ($HTTP_POST_VARS['copy_as'] == 'link') {

if ($categories_id != $current_category_id) {

$check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$categories_id . "'");

$check = tep_db_fetch_array($check_query);

if ($check['total'] < '1') {

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$categories_id . "')");

}

} else {

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

}

} elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {

// BOF: More Pics 6 Added: , products_subimage1, products_subimage2, products_subimage3, products_subimage4, products_subimage5, products_subimage6

$product_query = tep_db_query("select products_quantity, products_model, products_image, products_subimage1, products_subimage2, products_subimage3, products_subimage4, products_subimage5, products_subimage6, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

// EOF: More Pics 6

$product = tep_db_fetch_array($product_query);

 

// BOF: More Pics 6 Added: , products_subimage1, products_subimage2, products_subimage3, products_subimage4, products_subimage5, products_subimage6 -AND- , '" . tep_db_input($product['products_subimage1']) . "', '" . tep_db_input($product['products_subimage2']) . "', '" . tep_db_input($product['products_subimage3']) . "', '" . tep_db_input($product['products_subimage4']) . "', '" . tep_db_input($product['products_subimage5']) . "', '" . tep_db_input($product['products_subimage6']) . "'

tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_image, products_subimage1, products_subimage2, products_subimage3, products_subimage4, products_subimage5, products_subimage6, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_subimage1']) . "', '" . tep_db_input($product['products_subimage2']) . "', '" . tep_db_input($product['products_subimage3']) . "', '" . tep_db_input($product['products_subimage4']) . "', '" . tep_db_input($product['products_subimage5']) . "', '" . tep_db_input($product['products_subimage6']) . "', '" . tep_db_input($product['products_price']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");

// EOF: More Pics 6

$dup_products_id = tep_db_insert_id();

 

//HTC BOC

$description_query = tep_db_query("select language_id, products_name, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");

while ($description = tep_db_fetch_array($description_query)) {

tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_head_title_tag']) . "', '" . tep_db_input($description['products_head_desc_tag']) . "', '" . tep_db_input($description['products_head_keywords_tag']) . "', '" . tep_db_input($description['products_url']) . "', '0')");

}

//HTC EOC

 

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");

$products_id = $dup_products_id;

}

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

}

 

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

break;

case 'new_product_preview':

// BOF: More Pics 6

// copy image only if modified

/* $products_image = new upload('products_image');

$products_image->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image->parse() && $products_image->save()) {

$products_image_name = $products_image->filename;

} else {

$products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');

}

*/

// EOF: More Pics 6

// copy image only if modified

$products_image = new upload('products_image');

$products_image->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image->parse() && $products_image->save()) {

$products_image_name = $products_image->filename;

} else {

$products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');

}

// BOF: More Pics 6

// copy subimage1 only if modified

$products_subimage1 = new upload('products_subimage1');

$products_subimage1->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_subimage1->parse() && $products_subimage1->save()) {

$products_subimage1_name = $products_subimage1->filename;

} else {

$products_subimage1_name = (isset($HTTP_POST_VARS['products_previous_subimage1']) ? $HTTP_POST_VARS['products_previous_subimage1'] : '');

}

// copy subimage2 only if modified

$products_subimage2 = new upload('products_subimage2');

$products_subimage2->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_subimage2->parse() && $products_subimage2->save()) {

$products_subimage2_name = $products_subimage2->filename;

} else {

$products_subimage2_name = (isset($HTTP_POST_VARS['products_previous_subimage2']) ? $HTTP_POST_VARS['products_previous_subimage2'] : '');

}

// copy subimage3 only if modified

$products_subimage3 = new upload('products_subimage3');

$products_subimage3->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_subimage3->parse() && $products_subimage3->save()) {

$products_subimage3_name = $products_subimage3->filename;

} else {

$products_subimage3_name = (isset($HTTP_POST_VARS['products_previous_subimage3']) ? $HTTP_POST_VARS['products_previous_subimage3'] : '');

}

// copy subimage4 only if modified

$products_subimage4 = new upload('products_subimage4');

$products_subimage4->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_subimage4->parse() && $products_subimage4->save()) {

$products_subimage4_name = $products_subimage4->filename;

} else {

$products_subimage4_name = (isset($HTTP_POST_VARS['products_previous_subimage4']) ? $HTTP_POST_VARS['products_previous_subimage4'] : '');

}

// copy subimage5 only if modified

$products_subimage5 = new upload('products_subimage5');

$products_subimage5->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_subimage5->parse() && $products_subimage5->save()) {

$products_subimage5_name = $products_subimage5->filename;

} else {

$products_subimage5_name = (isset($HTTP_POST_VARS['products_previous_subimage5']) ? $HTTP_POST_VARS['products_previous_subimage5'] : '');

}

// copy subimage6 only if modified

$products_subimage6 = new upload('products_subimage6');

$products_subimage6->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_subimage6->parse() && $products_subimage6->save()) {

$products_subimage6_name = $products_subimage6->filename;

} else {

$products_subimage6_name = (isset($HTTP_POST_VARS['products_previous_subimage6']) ? $HTTP_POST_VARS['products_previous_subimage6'] : '');

}

// EOF: More Pics 6

break;

}

}

 

// check if the catalog image directory exists

if (is_dir(DIR_FS_CATALOG_IMAGES)) {

if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');

} else {

$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NO

Share this post


Link to post
Share on other sites
Hello,

 

I have a problem with More Pics and Header Tags Controller. These 2 contributions can work together, however I think i've made a mistake some how in the categories.php in the admin. The problem is now More Pics has 2 descritopn boxes and no name box when adding a new product in the admin section...other than this all seems fine.

 

Please could somebody take a look at my categories.php and tell me I get this problem? :blush:

please don't cross-post your problems. One thread at a time please. In addition we are not given enough room to post an entire file contents in the forums. ;)

Share this post


Link to post
Share on other sites
please don't cross-post your problems. One thread at a time please. In addition we are not given enough room to post an entire file contents in the forums. ;)

 

Sorry it won't happen again :-"

Share this post


Link to post
Share on other sites
installing the contrib http://www.oscommerce.com/community/contri...h,pop+up+images

and possibly http://www.oscommerce.com/community/contri...h,pop+up+images

Are there any conflicts merging these contribs in with your program that you know of?

Also, when I was testing the new images with the "click to enlarge", I noticed that there is

an area for "previous" and "next" gifs (which I really like btw) but they are not showing.

Could you direct me to the location file for these so that I can upload a gif for this?

I'm sure you will have to integrate either of those carefully. the code they will look for will most likely have been changed with More Pics.

 

The next and previous images are included in the More Pics package. They should be uploaded in the same directory structure you find them in the package.

Share this post


Link to post
Share on other sites
is there a way to fiigure out what code needs to stay so both contributions work together. giving me the extra images of more pics and the ablity to zoom them in and out using the zoom in and out contribution found here

 

http://www.oscommerce.com/community/contri...arch,zoom+image

thanks everyone in advance

the best way to figure out what to include is to use a file compare utility such as WinDiff or Beyond Compare. Compare each package with the original file from osCommerce to see what is changed, then merge the two contributions.

Share this post


Link to post
Share on other sites
I dont know if the contirbuion can exactly like amazon does?

http://www.amazon.com/gp/product/B0007KQWG...5Fencoding=UTF8

I mean multiple images thumbnail on popup page

no, this contribution does not mimic Amazon's layout.

There was a contribution on the More Pics page that might help you:

New, small Update! - Tsimi - 27 Jun 2005

I was not integrated in my contribution since it changed a couple things most use.

Share this post


Link to post
Share on other sites
Hi my versions are

MySQL - 4.1.21-standard

phpMyAdmin - 2.8.0.2

If you ran the SQL script and it completed, you should not have that error.

Share this post


Link to post
Share on other sites
This may of been mentioned before, but I did not see it when scanning throught the posts.

 

I only want some of the products to have more than 1 pic, do the single pic products get affected by this contrib in any noticalbe way?

 

Also, is it a fairly easy contrib to add?

As contributions go, this one is a moderate complexity contribution. the toughest parts are the changes to /admin/categories.php.

In the default installation, all products will look the same as they did before the installation. Only those products that you add images to will change.

Share this post


Link to post
Share on other sites
Hello,

 

I have a problem with More Pics and Header Tags Controller. These 2 contributions can work together, however I think i've made a mistake some how in the categories.php in the admin. The problem is now More Pics has 2 descritopn boxes and no name box when adding a new product in the admin section...other than this all seems fine.

 

Please could somebody take a look at my categories.php and tell me I get this problem? :blush:

The best advice I can give is to restore the categories.php and try again. (you backed up before adding HTC, right?) Merge the changes for one then the other.

 

The two contributions should not conflict. You will be adding fields to the product editing area for both contributions. You need to make sure they go into the code separately. Are you using something like WinDiff or Beyond Compare to merge the files? they help quite a bit to see where you need to merge multiple contributions.

Share this post


Link to post
Share on other sites
The best advice I can give is to restore the categories.php and try again. (you backed up before adding HTC, right?) Merge the changes for one then the other.

 

The two contributions should not conflict. You will be adding fields to the product editing area for both contributions. You need to make sure they go into the code separately. Are you using something like WinDiff or Beyond Compare to merge the files? they help quite a bit to see where you need to merge multiple contributions.

 

Cheers Surf...I was copying and pasting the code in manually and when I did it with Beyond Compare it worked like a treat. More Pics and Header Tags Controller are 2 must haves. :thumbsup:

Share this post


Link to post
Share on other sites

Thank's a lot it worked .......but now i have a different error i made the upgrades to the more_pics_6 to the final version 1.2b and now i have an error that looks like this : i will post images so you can understand better what i mean since i can't explain in english

THIS is how my homepage looks like i made this one so you can see the errors

 

1qc0.jpg

 

This is how it looks like when i click on the details button

 

2ug8.jpg

 

It is making the popup_image ( the main image of the product bigger than the others ) and all the menu's and other bar's completly inacurate and missplacet

I added the table.popup ........ in the catalog/style.css and it looks the same ........ how can i fix this error ...

Share this post


Link to post
Share on other sites
THIS is how my homepage looks like i made this one so you can see the errors

It is making the popup_image ( the main image of the product bigger than the others ) and all the menu's and other bar's completly inacurate and missplacet

I added the table.popup ........ in the catalog/style.css and it looks the same ........ how can i fix this error ...

have you seen the More Pics configuration items in your admin? Admin -> Configuration -> More Pics

Configuration items there should fix that.

 

If you don't include a description with your product, you should use the group with parent option. There is a bug in internet browsers that displays tables with alignments overlapped.

Share this post


Link to post
Share on other sites
have you seen the More Pics configuration items in your admin? Admin -> Configuration -> More Pics

Configuration items there should fix that.

 

If you don't include a description with your product, you should use the group with parent option. There is a bug in internet browsers that displays tables with alignments overlapped.

 

i thought the pictures placement was a script error but i read the readme file and figure that it was a configuration in the admin and made the corrections ............. thanks .

 

is there any posibility to fix the way my description page looks like ? it changed this way when i added the contrib more_pics ....... if you don't have any solution i will try to restore the files and try again whith one of the compare file program that you mentioned maybe it will work

 

thank's for helping me !!!

Share this post


Link to post
Share on other sites
is there any posibility to fix the way my description page looks like ? it changed this way when i added the contrib more_pics ....... if you don't have any solution i will try to restore the files and try again whith one of the compare file program that you mentioned maybe it will work

I'm not seeing the description problem. do you have one and it is not showing?

If the More Pics setting don't help, then it's an error in your integration, restore and try again with a compare file program.

Share this post


Link to post
Share on other sites
I'm not seeing the description problem. do you have one and it is not showing?

If the More Pics setting don't help, then it's an error in your integration, restore and try again with a compare file program.

ok ... this is the problem that i am having ....... when i acces the main page al the menius look fine when i click the description button on a product it makes the page .................

try this link www.dezbracatu.ro and chose "detalii" on a product and see what happends ....... is there a way to fix that?? whitout the more_pics_6 if i clicked on the details button the page looked fine when i installed the more_pics_6 the description page look bad.......

Share this post


Link to post
Share on other sites
ok ... this is the problem that i am having ....... when i acces the main page al the menius look fine when i click the description button on a product it makes the page .................

try this link www.dezbracatu.ro and chose "detalii" on a product and see what happends ....... is there a way to fix that?? whitout the more_pics_6 if i clicked on the details button the page looked fine when i installed the more_pics_6 the description page look bad.......

if the only problem is your menu, then it doesn't have anything to do with More Pics. You are referencing 2 different stylesheets. On the home page, you are referencing "style.css", on your product_info.php page, you are refencing the standard "stylesheet.css" file. I wasn't looking at your menu before since this contribution doesn't affect that area of the page. The only code that should have been added to your page is clearly marked in the contribution files with comments that start like - BOF: More Pics - and ends with - EOF: More Pics.

Edited by surfalot

Share this post


Link to post
Share on other sites

First off, I'm very new to the OSC. I have STS2.2 Template installed. I use Core FTP. When I try to upload the files, I find myself uploading them one by one, which is why I probably keep messing up. Any suggestions on how to upload properly? Is everyone doing it one by one? Then when I read the install files, it says replace so and so line codes....is this already done when installed, or an extra step?

 

When I first tried to install MoPics, it gave me a syntax in my admin>categories section....which I didn't write down....I even backed up from a virgin osc install and I couldnt get it back when I clicked restore....So, I'm re-uploading my catalog file once again...lol, guys I need some major newbie help. I just finally fixed my .htaccess problem which took 3 days. Godaddy doesn't support with .htaccess......sucks

 

Suggestions? Flames?? :blink: ::loSt::

Share this post


Link to post
Share on other sites
if the only problem is your menu, then it doesn't have anything to do with More Pics. You are referencing 2 different stylesheets. On the home page, you are referencing "style.css", on your product_info.php page, you are refencing the standard "stylesheet.css" file. I wasn't looking at your menu before since this contribution doesn't affect that area of the page. The only code that should have been added to your page is clearly marked in the contribution files with comments that start like - BOF: More Pics - and ends with - EOF: More Pics.

 

ok you could be right but if i replace the more_pics product_info.php with the original from osc then the page displays properly if I use the product_info from the more_pics it displays like this ...... so i thought that the script from prod_inf is the problem and needed adjusments ..... but if you say it's not the contribution fault then i must have made something rong but i do not think so because i just copy paste the contrib and followed the readme file in making changes to the database ............... so............ there is no chance in fixing the prob :(

 

P.S : when you say stylesheet you are refering to the catalog/admin/includes/stylesheet.css ???? because that is the only stylesheet that i have in catalog ......... the other .css file is style that is located in the catalog folder.................

Edited by Ennzo

Share this post


Link to post
Share on other sites

Well, I re-installed MoPics....Here is my error in admin>categories

 

1054 - Unknown column 'p.products_subimage1' in 'field list'

 

select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from products p, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '0' order by pd.products_name

Share this post


Link to post
Share on other sites
Well, I re-installed MoPics....Here is my error in admin>categories

 

1054 - Unknown column 'p.products_subimage1' in 'field list'

 

select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from products p, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '0' order by pd.products_name

go to page 23 of this topic and you will se the answer to your question regarding the error

Edited by Ennzo

Share this post


Link to post
Share on other sites
ok you could be right but if i replace the more_pics product_info.php with the original from osc then the page displays properly if I use the product_info from the more_pics it displays like this ...... so i thought that the script from prod_inf is the problem and needed adjusments ..... but if you say it's not the contribution fault then i must have made something rong but i do not think so because i just copy paste the contrib and followed the readme file in making changes to the database ............... so............ there is no chance in fixing the prob :(

 

P.S : when you say stylesheet you are refering to the catalog/admin/includes/stylesheet.css ???? because that is the only stylesheet that i have in catalog ......... the other .css file is style that is located in the catalog folder.................

 

Well, I re-installed MoPics....Here is my error in admin>categories

 

1054 - Unknown column 'p.products_subimage1' in 'field list'

 

select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from products p, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '0' order by pd.products_name

 

OK, both of you need to read the directions more carefully.

 

In Ennzo case, you need to stop uploading the files in this contribution. If you do that, you will be replacing code that needs to stay where it is. Your shop uses a stylesheet called: styles.css (look at the HEAD of your pages). If you simply replace your shop file with the one in the More Pics package, then that page will use the standard stylesheet.css as your stylesheet, because that is the stylesheet of the default osCommerce store. As I said the last time you need to use a file compare program and compare the More Pics product_info.php with the same file in your store.

 

This is explained as Step # 2 if the directions. The ONLY time you can simply upload the More Pics files is if your shop is unchanged from the original that is downloaded from Harold's current osCommerce source. Ennzo, your files have clearly be changed, you must use the file compare program to simply merge the 4 areas that More Pics changes in product_info.php.

 

In the case of motex, you missed step #1. that is to add the proper fields to your database using the SQL script provided.

 

here are the first 2 steps from the readme(english) file....

 

 

**********

Step: 1

**********

 

Add Database SQL statements using a database manager such as phpMyAdmin.

 

In phpMyAdmin, click the little SQL image. Copy all the text from the

database_additions.txt file into the Run SQL query window, click go.

 

 

**********

Step: 2

**********

 

use a file compare program like Beyond Compare or WinDiff to compare

files or you can simply replace each file if you have not changed your

original osCommerce shop.

Share this post


Link to post
Share on other sites

I figured the problem last night i stayed up late and solved the problem ....... i have one little problme but i will solve it when i get the ideea of using the compare prog ........ anyway thank's a lot see you when i have another problem :) ....... till then .... be well !! :)

Share this post


Link to post
Share on other sites

Hi!

 

My instalation of morepics is working very fine. I decided to keep my original prduct_info.php so i can only see all the picures in the pop-up window, and this was always my first idea.

However I installed Ajax Pop-up, and that works to but the next and previous buttons are not there. you can see my site at www.lizardsports.net/shop (test site).

 

I just want that buttons to be shown so I can navigate through all the extra pictures (added with morepics6) in Ajax Popup....

 

I hope somebody can guide me.

 

Best regards.

 

Rui Ganga.


Rui Ganga

Share this post


Link to post
Share on other sites
I just want that buttons to be shown so I can navigate through all the extra pictures (added with morepics6) in Ajax Popup....

you will need to merge the two image_popup.php files. I don't know anything about the Ajax popup.

Share this post


Link to post
Share on other sites
As contributions go, this one is a moderate complexity contribution. the toughest parts are the changes to /admin/categories.php.

In the default installation, all products will look the same as they did before the installation. Only those products that you add images to will change.

 

Thanks

 

 

I will give it a go when I can get a chance

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×