Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Porsche032

Pioneers
  • Posts

    83
  • Joined

  • Last visited

Posts posted by Porsche032

  1. i put osc_ into includes/database_tables.php and admin/includes/database_tables.php

    define('TABLE_CATEGORIES_DESCRIPTION', DB_TABLE_PREFIX . 'osc_categories_description');

     

    but nothing happened, i get the same error. I also added

    define('TABLE_CATEGORIES_DESCRIPTION', 'osc_categories_description');

    at the end but that didnt work either. All the other tables in there dont have the osc_ in front of them either.

    do you think i may have to edit a file that came with the contribution with an osc_ in front of it?

     

    Ok i got it, i had to add osc_ in front of all categories_description in header_tags_fill_tags.php.

    Thanks Jack :D

  2. he database entries are correct. However, the error you first mentioned sayswhich is true. Your table is osc_categories_description, not categories_description. So you should look in your includes/database_tables.php and admin/includes/database_tables.php files to be sure you have an entry like[/code]define('TABLE_CATEGORIES_DESCRIPTION', 'osc_categories_description');

     

    Jack

     

    i put osc_ into includes/database_tables.php and admin/includes/database_tables.php

    define('TABLE_CATEGORIES_DESCRIPTION', DB_TABLE_PREFIX . 'osc_categories_description');

     

    but nothing happened, i get the same error. I also added

    define('TABLE_CATEGORIES_DESCRIPTION', 'osc_categories_description');

    at the end but that didnt work either. All the other tables in there dont have the osc_ in front of them either.

    do you think i may have to edit a file that came with the contribution with an osc_ in front of it?

  3. Header Tags uses the standard tables so as liong as they are defined properly in your database_tables.php file, it should work. You should go into phpmyadmin and make sure you have the header tags fields added properly.

     

    Jack

     

    i checked my db from phpmyadmin but i dont know what im suppose to be looking for. I attached a pic

    of my db with table osc_categories_description. can you check it please =) Thanks alot.

     

    mydb.jpg

  4. It looks like your database changes didn't all take for some reason. There is a file named Update_header_categories_description.sql in the contribution. You shouldn't have to run it on a new install but it won't hurt if you do and it may fix the problem.

     

    Jack

     

    Hi Jack, thanks for the quick response. I ran the update_header_categories_description.sql and it said error duplicate entry. I think the problem is that my database is setup with a osc_ in front of all my tables, my host did that and it always gives me problems. So whenever i add a contribution to the database i have to add an osc_ in front of them. So my header.sql looks like this and this is how i added it into the database.

    ALTER TABLE osc_products_description ADD products_head_title_tag VARCHAR(80) NULL;

    ALTER TABLE osc_products_description ADD products_head_desc_tag LONGTEXT NULL;

    ALTER TABLE osc_products_description ADD products_head_keywords_tag LONGTEXT NULL;

     

    ALTER TABLE osc_categories_description ADD categories_htc_title_tag VARCHAR(80) NULL;

    ALTER TABLE osc_categories_description ADD categories_htc_desc_tag LONGTEXT NULL;

    ALTER TABLE osc_categories_description ADD categories_htc_keywords_tag LONGTEXT NULL;

    ALTER TABLE osc_categories_description ADD categories_htc_description LONGTEXT NULL;

     

    I think im suppose to add an osc_ in front of categories_description somewhere so it could work, but im not sure where. Do you think thats the problem? Thanks again for your help

  5. hey guys i just installed headertags v 2.5.6 everything seems to be working fine except when i go to

    Fill tags from the admin area and click on Fill all tags i get

    1146 - Table 'mysite.categories_description' doesn't exist

     

    select categories_name, categories_id, categories_htc_title_tag, categories_htc_desc_tag, categories_htc_keywords_tag, language_id from categories_description where language_id = '1'

     

    [TEP STOP]

     

    please someone tell me what file i have to edit or what i have to do to fix this. Thank you

  6. I?m having the same probem...

    Where should I insert:

    ----------------------------------

    //inserted by JH to remove download problems

    $download = $HTTP_GET_VARS('download');

    $dltype = $HTTP_GET_VARS('dltype');

    ----------------------------------

     

    To make it work???

     

    Thanks

    Rama

     

    Good job, Im also confused about this problem. I guess its not only us, Im not sure why nobody

    is helping us though. Can you also tell me where you inserted that code. Thank you

  7. i just installed easy populate 2.79 and

    when i go to catalog Utility import/export. When i click on a file to download it doesnt do anything. It just refreshes the page.

    Download .txt file with TAB delimited to edit ( Complete )

    Download .txt file with TAB delimited to edit ( Model / Price / Quantity )

    Download .txt file with TAB delimited to edit ( Model / Category )

    Download .txt file with TAB delimited to edit ( Model / Attributes )

    Download .txt file with TAB delimited to edit ( Products extra fields )

    Download .txt file with TAB delimited to edit ( Froogle )

     

    even creat text file doesnt do anything. I have tried everything and cant figure out while the hell its doing this.

    I reinstalled 2 times with same problem. I have tried 3 different browsers thinking its the browser

    but that didnt work either. In the manual I think it mentions this issue

     

    Windows users:

    If you have trouble downloading and opening the file, try downloading the file.

    If you encounter errors here trying to dl the file,

    try using the "Create txt in temp dir" link. This

    will create a file in the /catalog/temp directory,

    which you can get to via the Tools/Files in the

    admin area, and download it there.

    If you still have problems at that point, well,

    there's always ftp. I've beaten my head against this wall too much,

    and danged if I'm going to spend more time fussing with a busted browser on a

    busted 'operating system'. Bill Gates has stolen enough of my life as it is. Get Mozilla.

    It works.

    It's possible this problem is related to sites that have their admin on the https side.

    ----------------------------------

     

    ive tried this and it didnt work, what does he mean by ftp?

  8. when i go to catalog Utility import/export. When i click on a file to download it doesnt do anything. It just refreshes the page.

    Download .txt file with TAB delimited to edit ( Complete )

    Download .txt file with TAB delimited to edit ( Model / Price / Quantity )

    Download .txt file with TAB delimited to edit ( Model / Category )

    Download .txt file with TAB delimited to edit ( Model / Attributes )

    Download .txt file with TAB delimited to edit ( Products extra fields )

    Download .txt file with TAB delimited to edit ( Froogle )

     

    these are the files. Please someone tell me what could be causing this. Thank you

     

    can someone help???????? what is the log file i can check for error messages? its weird because

    it just refreshes the page without giving errors. Thanks

  9. when i go to catalog Utility import/export. When i click on a file to download it doesnt do anything. It just refreshes the page.

    Download .txt file with TAB delimited to edit ( Complete )

    Download .txt file with TAB delimited to edit ( Model / Price / Quantity )

    Download .txt file with TAB delimited to edit ( Model / Category )

    Download .txt file with TAB delimited to edit ( Model / Attributes )

    Download .txt file with TAB delimited to edit ( Products extra fields )

    Download .txt file with TAB delimited to edit ( Froogle )

     

    these are the files. Please someone tell me what could be causing this. Thank you

  10. guys i just installed this contribution 2.79 and i cant download the text file from admin.

    when i click on any of the download files below

    Download .txt file with TAB delimited to edit ( Complete )

    Download .txt file with TAB delimited to edit ( Model / Price / Quantity )

    Download .txt file with TAB delimited to edit ( Model / Category )

    Download .txt file with TAB delimited to edit ( Model / Attributes )

    Download .txt file with TAB delimited to edit ( Products extra fields )

    Download .txt file with TAB delimited to edit ( Froogle )

     

    nothing happens it just refreshed the page. Can someone tell me why its doing this please.

    Thank you

  11. Okay, going crazy here searching these boards trying to get this contribution to work.

    It seems everyone else has it working, so I must be missing something.

     

    I installed the "Ultimate SEO URLs 2.1d" version. When I click on a product link, I get an "Object Not Found!" error.

     

    My .htaccess is set properly to the correct directory /store/ I went through the process precisely. So what am I missing that is bringing this error instead of the product page itself?

     

    Page can be found here: Client's Site.

     

    Please advise. Assistance is greatly appreciated.

     

    Thanks,

    Elizabeth

     

    i had that problem too, its gotta be your .htaccess. Plus make sure your not on a shared ssl that will give you problems too.

  12. Help! - Having a Paypal problem after installing Ultimate SEO 2-2.1d

     

    I accept Paypal on my OSc store, and ever since installing Ultimate SEO 2-2.1d a few days ago, I have been noticing that whenever someone places an order, I receive the correct payment amount, but there is no "order" created in my database. I am able to see the new "customer", but have no idea what they are paying me for. When I email my new customer to inquire, it seems as though they did their part and followed through with the order creation. I also accept credit cards, but don't seem to have the same problem there. I had the same problem a few months ago, but another member advised me as to the correct settings on the Paypal side. It worked fine from that point up until I installed the SEO contribution. Here are the settings as I currently have them set:

    go to profile

     

    website payment preferences and select auto return to on

     

    https://st63.startlogic.com/~specopst/shop/...out_process.php

     

    the next buttons are set this way:

     

    off

    off

    on

    off

    Question: Does the SEO contribution change how I need to configure my auto return URL in Paypal?

    Thanks in advance.

     

    I'm Having same problem except mine happend with a credit card transaction (authorize.net). I got a merchant email receipt sent to my email address when i opened it everything was blank. The name field, billing address, shipping address even email. It only said that payment was sent for this amount. When i go into admin it says i have 2 orders before i click on the order link. But when i click it I only see 1. When i check the customers link i dont have any new customers in there. I have no idea who paid me or an address or email to contact them. Is there anywhere in oscommerce i can check to see who placed the order? which file does oscommerce store customer info and order info in? Thank you

  13. sent, Thanks alot.

     

    Thanks alot Jack for taking a look at my file. It worked. I have another problem can you guys help me fix please.

    When i click on clear all tags and hit update i get this.

    1146 - Table 'mysite.categories_description' doesn't exist

     

    select categories_name, categories_id, categories_htc_title_tag, categories_htc_desc_tag, categories_htc_keywords_tag, language_id from categories_description where language_id = '1'.

     

    I think i know why its doing this but i dont know how to fix it. When i made changes to the database like the contribution asked. I had to change the line to this

    ALTER TABLE osc_categories_description ADD categories_htc_title_tag VARCHAR(80) NULL;

    I had to add osc_ in front of it because thats how my oscommerce is setup. So now i think i have to edit a file so that it acutally looks into osc_categories_description, but i cant find that file. Do you know which file it is? Thanks again

  14. That error means there is an extra/missing control character which is causing the end of the file to be reached before it should. Most likely, you missed copying/erasing a } while installing. Try downloading WinMerge so you can compare the two files. It should be easy to find with it. Or, start over with that file and install the changes again.

     

    Jack

     

    ive done that, i cant find the problem. I used beyond compare to compare the 2 files. If i send you the file can you check for me? can i have your email to send to you please?

  15. I installed header tags v2.5.6 and im having a hard time trying to get it to work. I installed the catalog side fine I believe. Its the problem with the admin side that I'm having. After I installed the admin section I couldnt access my catalog anymore through admin. It gives me an error

    Parse error: syntax error, unexpected $end in /home/u4/mysite/html/osc/admin/categories.php on line 1420. I opened up categories.php in front page and I dont see anything on line 1420 it acutally ends at 1419. And the installation says nothing about editing any text around line 1420 or anywhere near it. I didnt touch any text around that section. When I replace categories.php with my backup categories.php the catalog page works. I will post the categories.php file here. Please someone help I really want to use this contribution. Thanks guys

     

    <?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

    By Raphael Muscarelle

     

    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'] : '');

     

    // Ultimate SEO URLs v2.1

    // If the action will affect the cache entries

    if ( eregi("(insert|update|setflag)", $action) ) include_once('includes/reset_seo_cache.php');

     

     

    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_db_prepare_input($categories_htc_title_array[$language_id]),

    'categories_htc_desc_tag' => tep_db_prepare_input($categories_htc_desc_array[$language_id]),

    'categories_htc_keywords_tag' => tep_db_prepare_input($categories_htc_keywords_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

    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_subimage1'] != '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_db_prepare_input($HTTP_POST_VARS['products_head_title_tag'][$language_id]),

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

    'products_head_keywords_tag' => tep_db_prepare_input($HTTP_POST_VARS['products_head_keywords_tag'][$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_NOT_EXIST, 'error');

    }

    ?>

    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html <?php echo HTML_PARAMS; ?>>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

    <title><?php echo TITLE; ?></title>

    <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

    <script language="javascript" src="includes/general.js"></script>

    </head>

    <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">

    <div id="spiffycalendar" class="text"></div>

    <!-- header //-->

    <?php require(DIR_WS_INCLUDES . 'header.php'); ?>

    <!-- header_eof //-->

     

    <!-- body //-->

    <table border="0" width="100%" cellspacing="2" cellpadding="2">

    <tr>

    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

    <!-- left_navigation //-->

    <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

    <!-- left_navigation_eof //-->

    </table></td>

    <!-- body_text //-->

    <td width="100%" valign="top">

    <?php

    if ($action == 'new_product') {

    $parameters = array('products_name' => '',

    'products_description' => '',

    'products_url' => '',

    'products_id' => '',

    'products_quantity' => '',

    'products_model' => '',

    'products_image' => '',

    // BOF: More Pics 6

    'products_subimage1' => '',

    'products_subimage2' => '',

    'products_subimage3' => '',

    'products_subimage4' => '',

    'products_subimage5' => '',

    'products_subimage6' => '',

    // EOF: More Pics 6

    'products_price' => '',

    'products_weight' => '',

    'products_date_added' => '',

    'products_last_modified' => '',

    'products_date_available' => '',

    'products_status' => '',

    'products_tax_class_id' => '',

    'manufacturers_id' => '');

     

    $pInfo = new objectInfo($parameters);

     

    if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {

    //HTC BOC

    if (isset ($HTTP_GET_VARS['pID']) && (!$HTTP_POST_VARS) ) {

    $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_id, p.products_quantity, p.products_model, 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_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

    $product = tep_db_fetch_array($product_query);

    //HTC EOC

     

    $pInfo->objectInfo($product);

    } elseif (tep_not_null($HTTP_POST_VARS)) {

    $pInfo->objectInfo($HTTP_POST_VARS);

    $products_name = $HTTP_POST_VARS['products_name'];

    $products_description = $HTTP_POST_VARS['products_description'];

    $products_url = $HTTP_POST_VARS['products_url'];

    }

     

    $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));

    $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");

    while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {

    $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],

    'text' => $manufacturers['manufacturers_name']);

    }

     

    $tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));

    $tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");

    while ($tax_class = tep_db_fetch_array($tax_class_query)) {

    $tax_class_array[] = array('id' => $tax_class['tax_class_id'],

    'text' => $tax_class['tax_class_title']);

    }

     

    $languages = tep_get_languages();

     

    if (!isset($pInfo->products_status)) $pInfo->products_status = '1';

    switch ($pInfo->products_status) {

    case '0': $in_status = false; $out_status = true; break;

    case '1':

    default: $in_status = true; $out_status = false;

    }

    ?>

    <link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">

    <script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>

    <script language="javascript"><!--

    var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);

    //--></script>

    <script language="javascript"><!--

    var tax_rates = new Array();

    <?php

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

    if ($tax_class_array[$i]['id'] > 0) {

    echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . tep_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n";

    }

    }

    ?>

     

    function doRound(x, places) {

    return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);

    }

     

    function getTaxRate() {

    var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex;

    var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value;

     

    if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {

    return tax_rates[parameterVal];

    } else {

    return 0;

    }

    }

     

    function updateGross() {

    var taxRate = getTaxRate();

    var grossValue = document.forms["new_product"].products_price.value;

     

    if (taxRate > 0) {

    grossValue = grossValue * ((taxRate / 100) + 1);

    }

     

    document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);

    }

     

    function updateNet() {

    var taxRate = getTaxRate();

    var netValue = document.forms["new_product"].products_price_gross.value;

     

    if (taxRate > 0) {

    netValue = netValue / ((taxRate / 100) + 1);

    }

     

    document.forms["new_product"].products_price.value = doRound(netValue, 4);

    }

    //--></script>

    <?php echo tep_draw_form('new_product', FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=new_product_preview', 'post', 'enctype="multipart/form-data"'); ?>

    <table border="0" width="100%" cellspacing="0" cellpadding="2">

    <tr>

    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

    <tr>

    <td class="pageHeading"><?php echo sprintf(TEXT_NEW_PRODUCT, tep_output_generated_category_path($current_category_id)); ?></td>

    <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

    </tr>

    </table></td>

    </tr>

    <tr>

    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <tr>

    <td><table border="0" cellspacing="0" cellpadding="2">

    <tr>

    <td class="main"><?php echo TEXT_PRODUCTS_STATUS; ?></td>

    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_radio_field('products_status', '1', $in_status) . ' ' . TEXT_PRODUCT_AVAILABLE . ' ' . tep_draw_radio_field('products_status', '0', $out_status) . ' ' . TEXT_PRODUCT_NOT_AVAILABLE; ?></td>

    </tr>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <tr>

    <td class="main"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br><small>(YYYY-MM-DD)</small></td>

    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' '; ?><script language="javascript">dateAvailable.writeControl(); dateAvailable.dateFormat="yyyy-MM-dd";</script></td>

    </tr>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <tr>

    <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>

    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td>

    </tr>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <?php

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

    ?>

    <tr>

    <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?></td>

    <td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? $products_name[$languages[$i]['id']] : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?></td>

    </tr>

    <?php

    }

    ?>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <tr bgcolor="#ebebff">

    <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>

    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td>

    </tr>

    <tr bgcolor="#ebebff">

    <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>

    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td>

    </tr>

    <tr bgcolor="#ebebff">

    <td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>

    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp="updateNet()"'); ?></td>

    </tr>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <script language="javascript"><!--

    updateGross();

    //--></script>

    <!-- HTC BOC //-->

    <?php

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

    ?>

    <tr>

    <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>

    <td><table border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

    <td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? $products_description[$languages[$i]['id']] : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

     

    </tr>

    </table></td>

    </tr>

    <?php

    }

    ?>

    <tr>

    <td colspan="2" class="main"><hr><?php echo TEXT_PRODUCT_METTA_INFO; ?></td>

    </tr>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <?php

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

    ?>

    <tr>

    <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_PAGE_TITLE; ?></td>

    <td><table border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

    <td class="main"><?php echo tep_draw_textarea_field('products_head_title_tag[' . $languages[$i]['id'] . ']', 'soft', '70', '5', (isset($products_head_title_tag[$languages[$i]['id']]) ? $products_head_title_tag[$languages[$i]['id']] : tep_get_products_head_title_tag($pInfo->products_id, $languages[$i]['id']))); ?></td>

    </tr>

    </table></td>

    </tr>

    <?php

    }

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

    ?>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <tr>

    <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_HEADER_DESCRIPTION; ?></td>

    <td><table border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

    <td class="main"><?php echo tep_draw_textarea_field('products_head_desc_tag[' . $languages[$i]['id'] . ']', 'soft', '70', '5', (isset($products_head_desc_tag[$languages[$i]['id']]) ? $products_head_desc_tag[$languages[$i]['id']] : tep_get_products_head_desc_tag($pInfo->products_id, $languages[$i]['id']))); ?></td>

    </tr>

    </table></td>

    </tr>

    <?php

    }

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

    ?>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

  16. sorry i posted the wrong catagories.php file. This is the correct one from admin directory.

    <?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

    By Raphael Muscarelle

     

    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'] : '');

     

    // Ultimate SEO URLs v2.1

    // If the action will affect the cache entries

    if ( eregi("(insert|update|setflag)", $action) ) include_once('includes/reset_seo_cache.php');

     

     

    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_db_prepare_input($categories_htc_title_array[$language_id]),

    'categories_htc_desc_tag' => tep_db_prepare_input($categories_htc_desc_array[$language_id]),

    'categories_htc_keywords_tag' => tep_db_prepare_input($categories_htc_keywords_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

    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_subimage1'] != '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_db_prepare_input($HTTP_POST_VARS['products_head_title_tag'][$language_id]),

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

    'products_head_keywords_tag' => tep_db_prepare_input($HTTP_POST_VARS['products_head_keywords_tag'][$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_NOT_EXIST, 'error');

    }

    ?>

    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html <?php echo HTML_PARAMS; ?>>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

    <title><?php echo TITLE; ?></title>

    <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

    <script language="javascript" src="includes/general.js"></script>

    </head>

    <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">

    <div id="spiffycalendar" class="text"></div>

    <!-- header //-->

    <?php require(DIR_WS_INCLUDES . 'header.php'); ?>

    <!-- header_eof //-->

     

    <!-- body //-->

    <table border="0" width="100%" cellspacing="2" cellpadding="2">

    <tr>

    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

    <!-- left_navigation //-->

    <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

    <!-- left_navigation_eof //-->

    </table></td>

    <!-- body_text //-->

    <td width="100%" valign="top">

    <?php

    if ($action == 'new_product') {

    $parameters = array('products_name' => '',

    'products_description' => '',

    'products_url' => '',

    'products_id' => '',

    'products_quantity' => '',

    'products_model' => '',

    'products_image' => '',

    // BOF: More Pics 6

    'products_subimage1' => '',

    'products_subimage2' => '',

    'products_subimage3' => '',

    'products_subimage4' => '',

    'products_subimage5' => '',

    'products_subimage6' => '',

    // EOF: More Pics 6

    'products_price' => '',

    'products_weight' => '',

    'products_date_added' => '',

    'products_last_modified' => '',

    'products_date_available' => '',

    'products_status' => '',

    'products_tax_class_id' => '',

    'manufacturers_id' => '');

     

    $pInfo = new objectInfo($parameters);

     

    //HTC BOC

    if (isset ($HTTP_GET_VARS['pID']) && (!$HTTP_POST_VARS) ) {

    $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

    $product = tep_db_fetch_array($product_query);

    //HTC EOC

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

    $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, 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_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

    // EOF: More Pics 6

    $product = tep_db_fetch_array($product_query);

     

    $pInfo->objectInfo($product);

    } elseif (tep_not_null($HTTP_POST_VARS)) {

    $pInfo->objectInfo($HTTP_POST_VARS);

    $products_name = $HTTP_POST_VARS['products_name'];

    $products_description = $HTTP_POST_VARS['products_description'];

    $products_url = $HTTP_POST_VARS['products_url'];

    }

     

    $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));

    $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");

    while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {

    $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],

    'text' => $manufacturers['manufacturers_name']);

    }

     

    $tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));

    $tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");

    while ($tax_class = tep_db_fetch_array($tax_class_query)) {

    $tax_class_array[] = array('id' => $tax_class['tax_class_id'],

    'text' => $tax_class['tax_class_title']);

    }

     

    $languages = tep_get_languages();

     

    if (!isset($pInfo->products_status)) $pInfo->products_status = '1';

    switch ($pInfo->products_status) {

    case '0': $in_status = false; $out_status = true; break;

    case '1':

    default: $in_status = true; $out_status = false;

    }

    ?>

    <link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">

    <script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>

    <script language="javascript"><!--

    var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);

    //--></script>

    <script language="javascript"><!--

    var tax_rates = new Array();

    <?php

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

    if ($tax_class_array[$i]['id'] > 0) {

    echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . tep_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n";

    }

    }

    ?>

     

    function doRound(x, places) {

    return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);

    }

     

    function getTaxRate() {

    var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex;

    var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value;

     

    if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {

    return tax_rates[parameterVal];

    } else {

    return 0;

    }

    }

     

    function updateGross() {

    var taxRate = getTaxRate();

    var grossValue = document.forms["new_product"].products_price.value;

     

    if (taxRate > 0) {

    grossValue = grossValue * ((taxRate / 100) + 1);

    }

     

    document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);

    }

     

    function updateNet() {

    var taxRate = getTaxRate();

    var netValue = document.forms["new_product"].products_price_gross.value;

     

    if (taxRate > 0) {

    netValue = netValue / ((taxRate / 100) + 1);

    }

     

    document.forms["new_product"].products_price.value = doRound(netValue, 4);

    }

    //--></script>

    <?php echo tep_draw_form('new_product', FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=new_product_preview', 'post', 'enctype="multipart/form-data"'); ?>

    <table border="0" width="100%" cellspacing="0" cellpadding="2">

    <tr>

    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

    <tr>

    <td class="pageHeading"><?php echo sprintf(TEXT_NEW_PRODUCT, tep_output_generated_category_path($current_category_id)); ?></td>

    <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

    </tr>

    </table></td>

    </tr>

    <tr>

    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <tr>

    <td><table border="0" cellspacing="0" cellpadding="2">

    <tr>

    <td class="main"><?php echo TEXT_PRODUCTS_STATUS; ?></td>

    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_radio_field('products_status', '1', $in_status) . ' ' . TEXT_PRODUCT_AVAILABLE . ' ' . tep_draw_radio_field('products_status', '0', $out_status) . ' ' . TEXT_PRODUCT_NOT_AVAILABLE; ?></td>

    </tr>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <tr>

    <td class="main"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br><small>(YYYY-MM-DD)</small></td>

    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' '; ?><script language="javascript">dateAvailable.writeControl(); dateAvailable.dateFormat="yyyy-MM-dd";</script></td>

    </tr>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <tr>

    <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>

    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td>

    </tr>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <?php

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

    ?>

    <tr>

    <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?></td>

    <td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? $products_name[$languages[$i]['id']] : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?></td>

    </tr>

    <?php

    }

    ?>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <tr bgcolor="#ebebff">

    <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>

    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td>

    </tr>

    <tr bgcolor="#ebebff">

    <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>

    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td>

    </tr>

    <tr bgcolor="#ebebff">

    <td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>

    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp="updateNet()"'); ?></td>

    </tr>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <script language="javascript"><!--

    updateGross();

    //--></script>

    <!-- HTC BOC //-->

    <?php

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

    ?>

    <tr>

    <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>

    <td><table border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

    <td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? $products_description[$languages[$i]['id']] : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

     

    </tr>

    </table></td>

    </tr>

    <?php

    }

    ?>

    <tr>

    <td colspan="2" class="main"><hr><?php echo TEXT_PRODUCT_METTA_INFO; ?></td>

    </tr>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <?php

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

    ?>

    <tr>

    <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_PAGE_TITLE; ?></td>

    <td><table border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

    <td class="main"><?php echo tep_draw_textarea_field('products_head_title_tag[' . $languages[$i]['id'] . ']', 'soft', '70', '5', (isset($products_head_title_tag[$languages[$i]['id']]) ? $products_head_title_tag[$languages[$i]['id']] : tep_get_products_head_title_tag($pInfo->products_id, $languages[$i]['id']))); ?></td>

    </tr>

    </table></td>

    </tr>

    <?php

    }

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

    ?>

    <tr>

    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

    </tr>

    <tr>

    <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_HEADER_DESCRIPTION; ?></td>

    <td><table border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>

    <td class="main"><?php echo tep_draw_textarea_field('products_head_desc_tag[' . $languages[$i]['id'] . ']', 'soft', '70', '5', (isset($products_head_desc_tag[$languages[$i]['id']]) ? $products_head_desc_tag[$languages[$i]['id']] : tep_get_products_head_desc_tag($pInfo->products_id, $languages[$i]['id']))); ?></td>

    </tr>

    </table></td>

    </tr>

    <?php

    }

    for ($i=0, $n=sizeof($

  17. Hello, I just installed HeaderTags_V_2.5.6. I followed the instructions and did everything correctly i believe. But when i go to admin and click on catalog I get a blank page. Nothing loads the page is just blank. I dont know if I misplaced code or what I did wrong. Can someone please look at the code and tell me if anything is misplaced please. I also see Header Tag Controller in admin so i think that was installed correctly. Heres the code to my admin/catagories.php

     

    <?php
    /*
     $Id: categories.php,v 1.26 2003/07/11 14:40:28 hpdl Exp $
    
     osCommerce, Open Source E-Commerce Solutions
     http://www.oscommerce.com
    
     Copyright (c) 2002 osCommerce
    
     Released under the GNU General Public License
    */
    
    define('HEADING_TITLE', 'Categories / Products');
    define('HEADING_TITLE_SEARCH', 'Search:');
    define('HEADING_TITLE_GOTO', 'Go To:');
    
    define('TABLE_HEADING_ID', 'ID');
    define('TABLE_HEADING_CATEGORIES_PRODUCTS', 'Categories / Products');
    define('TABLE_HEADING_ACTION', 'Action');
    define('TABLE_HEADING_STATUS', 'Status');
    
    define('TEXT_NEW_PRODUCT', 'New Product in "%s"');
    define('TEXT_CATEGORIES', 'Categories:');
    define('TEXT_SUBCATEGORIES', 'Subcategories:');
    define('TEXT_PRODUCTS', 'Products:');
    define('TEXT_PRODUCTS_PRICE_INFO', 'Price:');
    define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
    define('TEXT_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
    define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantity:');
    define('TEXT_DATE_ADDED', 'Date Added:');
    define('TEXT_DATE_AVAILABLE', 'Date Available:');
    define('TEXT_LAST_MODIFIED', 'Last Modified:');
    define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
    define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Please insert a new category or product in this level.');
    define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
    define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
    define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
    
    define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
    define('TEXT_EDIT_CATEGORIES_ID', 'Category ID:');
    define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
    define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
    define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
    
    define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
    define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
    
    define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
    define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Edit Category');
    define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Delete Category');
    define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Move Category');
    define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Delete Product');
    define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Move Product');
    define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
    
    define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
    define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
    
    define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
    define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
    
    define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
    define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
    define('TEXT_MOVE', 'Move <b>%s</b> to:');
    
    define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
    define('TEXT_CATEGORIES_NAME', 'Category Name:');
    define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
    define('TEXT_SORT_ORDER', 'Sort Order:');
    
    define('TEXT_PRODUCTS_STATUS', 'Products Status:');
    define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
    define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
    define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
    define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
    define('TEXT_PRODUCTS_NAME', 'Products Name:');
    define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
    define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
    define('TEXT_PRODUCTS_MODEL', 'Products Model:');
    define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
    // BOF: More Pics 6
    define('TEXT_PRODUCTS_SUBIMAGE1', 'Products Image1:');
    define('TEXT_PRODUCTS_SUBIMAGE2', 'Products Image2:');
    define('TEXT_PRODUCTS_SUBIMAGE3', 'Products Image3:');
    define('TEXT_PRODUCTS_SUBIMAGE4', 'Products Image4:');
    define('TEXT_PRODUCTS_SUBIMAGE5', 'Products Image5:');
    define('TEXT_PRODUCTS_SUBIMAGE6', 'Products Image6:');
    define('TEXT_DELETE_IMAGE', 'Remove Image');
    // EOF: More Pics 6
    define('TEXT_PRODUCTS_URL', 'Products URL:');
    define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
    define('TEXT_PRODUCTS_PRICE_NET', 'Products Price (Net):');
    define('TEXT_PRODUCTS_PRICE_GROSS', 'Products Price (Gross):');
    define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
    
    define('EMPTY_CATEGORY', 'Empty Category');
    
    define('TEXT_HOW_TO_COPY', 'Copy Method:');
    define('TEXT_COPY_AS_LINK', 'Link product');
    define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
    
    define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
    define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
    define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
    define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
    
    define('TEXT_PRODUCT_METTA_INFO', '<b>Meta Tag Information</b>');
    define('TEXT_PRODUCTS_PAGE_TITLE', 'Products Page Title:');
    define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'Page Header Description:');
    define('TEXT_PRODUCTS_KEYWORDS', 'Product Keywords:');
    ?>

  18. Hey guys i just installed USEO and when i go to checkout I get this error.

    Forbidden

    You don't have permission to access /carcustomz/osc/checkout_shipping.php on this server.

     

    You may need to create an index.html page or enable the directory browsing by creating an .htaccess file containing "Options +Indexes".

     

    Apache/1.3.34 Server at pro22.abac.com Port 443

     

    I cant figure out why its doing that.

    Here is how my .htaccess file looks

     

    If anyone knows, plesae help. THank you

     

    # $Id: .htaccess,v 1.1.1.1.12.2 2005/12/12 15:13:56 andrei Exp $
    #
    # This is used with Apache WebServers
    #
    # For this to work, you must include the parameter 'Options' to
    # the AllowOverride configuration
    #
    # Example:
    #
    # <Directory "/usr/local/apache/htdocs">
    # AllowOverride Options
    # </Directory>
    #
    # 'All' with also work. (This configuration is in the
    # apache/conf/httpd.conf file)
    
    # The following makes adjustments to the SSL protocol for Internet
    # Explorer browsers
    
    <IfModule mod_setenvif.c>
    <IfDefine SSL>
    SetEnvIf User-Agent ".*MSIE.*" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
    </IfDefine>
    </IfModule>
    
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /osc/
    
    RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}
    
    # If Search Engine Friendly URLs do not work, try enabling the
    # following Apache configuration parameter
    #
    # AcceptPathInfo On
    
    # Fix certain PHP values
    # (commented out by default to prevent errors occuring on certain
    # servers)
    #
    #<IfModule mod_php4.c>
    # php_value session.use_trans_sid 0
    # php_value register_globals 0
    #</IfModule>

     

    Ive tried adding Options +Indexes in the .htaccess but that doesnt help. I've also tried putting a empty

    index.html in the directory. But that didnt help either. Ive tried changing the permissions on the checkout_shipping.php with no luck either. So I dont know what else to try. If anyone has ideas please let me know. Thanks

  19. Hey guys i just installed USEO and when i go to checkout I get this error.

    Forbidden

    You don't have permission to access /carcustomz/osc/checkout_shipping.php on this server.

     

    You may need to create an index.html page or enable the directory browsing by creating an .htaccess file containing "Options +Indexes".

     

    Apache/1.3.34 Server at pro22.abac.com Port 443

     

    I cant figure out why its doing that.

    Here is how my .htaccess file looks

     

    If anyone knows, plesae help. THank you

     

    # $Id: .htaccess,v 1.1.1.1.12.2 2005/12/12 15:13:56 andrei Exp $
    #
    # This is used with Apache WebServers
    #
    # For this to work, you must include the parameter 'Options' to
    # the AllowOverride configuration
    #
    # Example:
    #
    # <Directory "/usr/local/apache/htdocs">
    # AllowOverride Options
    # </Directory>
    #
    # 'All' with also work. (This configuration is in the
    # apache/conf/httpd.conf file)
    
    # The following makes adjustments to the SSL protocol for Internet
    # Explorer browsers
    
    <IfModule mod_setenvif.c>
    <IfDefine SSL>
    SetEnvIf User-Agent ".*MSIE.*" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
    </IfDefine>
    </IfModule>
    
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /osc/
    
    RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
    RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}
    
    # If Search Engine Friendly URLs do not work, try enabling the
    # following Apache configuration parameter
    #
    # AcceptPathInfo On
    
    # Fix certain PHP values
    # (commented out by default to prevent errors occuring on certain
    # servers)
    #
    #<IfModule mod_php4.c>
    # php_value session.use_trans_sid 0
    # php_value register_globals 0
    #</IfModule>

×
×
  • Create New...