Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] More_pics_6 v1.1 For osC 2.2 MS2


surfalot

Recommended Posts

  • The "empty" function. What I have read is that its purpose is to indicate if variable is empty. Does the "!" alter the meaning? I dont understand the logic
  • I see how you have built up "manufacturer_info_1.php" in the "echo" statement. I have registered the filename "manufacturer_info_1.php" etc in filenames.php but when the code is executed I am getting "You don't have permission to access the requested object. It is either read-protected or not readable by the server." As I am using a development copy on the local machine and it is not protected etc, what silly thing have I forgotten do you think?

Thankyou and Respect

The "!" means NOT. and the empty() function returns true if the var it is working on is NULL, and empty string, or zero, so !empty($something) returns true if $something is anything but nothing. hope that helps. you can look up any php function on the php quickref page

 

I have registered the filename "manufacturer_info_1.php" etc in filenames.php

don't register those names in filenames.php, just create the actual files named as described with the html help or information you want the client to see. a file named "manufacturer_info_1.php" in your catalog/shop root directory with the info for your Manufacturer ID of 1.

 

you need to view the html from your browser while you are looking at the page with this popup link. look for the popup link code. make sure the actual file name in the link is pointing to "manufacturer_info_1.php". If you have this file (manufacturer_info_1.php) in the same folder as your product_info.php file, all should be good. If you want just plain HTML for your popup help, use .htm for the extension in the code that builds the filename.

 

hope that helps.

Link to comment
Share on other sites

  • Replies 1.6k
  • Created
  • Last Reply

Top Posters In This Topic

1. the image sizes in product_info.php (the page where you view the product and the thumbnails show) are huge! the main image is now 597x448 and the extra images i uploaded are also massive

 

the img settings in admin/configuration seem fine (and havent been changed) so i'm not sure what the problem is

if you have this setting: "Use SMALL_IMAGE_ Restrictions" set to true in your Admin -> Configuration -> More Pics, and you have a number in the Admin -> Configuration -> Images -> Small Image Width. those imags should be exactly "Small Image Width" pixels wide. Hope that helps.

Link to comment
Share on other sites

Hi

 

I am new here. For the first time i installed a contribuion, it was morepics6. It is almost what i need but i need help.

 

You can check first at my store to see my problem:

 

This is a test product: http://www.lizardsports.net/shop/product_i...?products_id=35

 

The main picture is too big and is over the text description of the product. I need the main picture have the small size (like the others) and at the same time don't be strecht.

The other pictures i don't want them to appear at product info. That pictures only should appear when client select to maximize picture and then can select forward in the pop-up menu.

 

Thats all I need.

I'm sorry because my English is very rusty, if there are some dificulty to understand please mail me.

Rui Ganga

Link to comment
Share on other sites

The "!" means NOT. and................. code that builds the filename.

 

hope that helps.

 

 

Thank you surfalot

 

I got there eventually! Your logic was entirely accurate, unfortunatly I dont seem to be able to create multiple java popups at the moment - something else to look at. When I substituted the java code and went back to one window - everything works!

 

Thank you for the help and advice - I have learnt a lot

 

Nossum

Link to comment
Share on other sites

The main picture is too big and is over the text description of the product. I need the main picture have the small size (like the others) and at the same time don't be strecht.

The other pictures i don't want them to appear at product info. That pictures only should appear when client select to maximize picture and then can select forward in the pop-up menu.

 

have you seen the options in your admin? Aministration -> Configuration -> More Pics

you should set the "Restrict parent image size" to true. should make the main image the same size as the others.

 

Your images won't be stretched if you set your image width and not the image height. Aministration -> Configuration -> Images. The other way to avoid stretch is to make ALL your images with the same width and height. Then you set the small image width and height in the admin settings so that ratio is correct.

 

Since you want the default image the same size as the others, you can use the Group with parent option and display all your imges in one block down the side of the description.

Link to comment
Share on other sites

I dont seem to be able to create multiple java popups at the moment

That is in the popup javascript in the head of that page. everytime the script is called for a popup, the hard coded window name forces them all to use that same window. If you want different windows, you have to copy the function (in the head) with a new name and rewrite it to pass the window name in when it is called.

 

then use the new function name in your popup link. If you just change the original function, you might mess up other places in the page that use it.

Link to comment
Share on other sites

Thanks Surfalot for the quick help.

 

However my solution was keep the product_info.php file as the original so the ony picture that will show in product info will be the first. If client want to sea more will click in "large picture" which text I will change to "more pics" and all the other pictures will be shown in the popup window. :)

 

Otherwise i can't solve the stretched situations. I can't follow your tip because i didn't understand: "Your images won't be stretched if you set your image width and not the image height"

 

Where can I set the main image width without setting the weight?

Rui Ganga

Link to comment
Share on other sites

I have my settings like so

Heading Image Width 57

Heading Image Height 40

Subcategory Image Width 100

Subcategory Image Height 57

Small Image Width 142

Small Image Height 189

All Products Image Width 100

All Products Image Height 80

Calculate Image Size true

Image Required true

 

 

Show All MorePics on Product Info page false

Group parent image with sub-images false

Use SMALL_IMAGE_ Restrictions false

Restrict parent image size true

Table Alignment center

Table Location below

Number of Columns 3

Number of Rows 2

 

My problem is that when you click the click to enlarge link to view the other pictures, the pop up window resizes very nicely to the actual picture and no one can see the arrows(in my case,text) below the image so they do not know that they can view more of the same pic.

 

Any suggestions?

Wendy

Link to comment
Share on other sites

My problem is that when you click the click to enlarge link to view the other pictures, the pop up window resizes very nicely to the actual picture and no one can see the arrows(in my case,text) below the image so they do not know that they can view more of the same pic.

see this post

Link to comment
Share on other sites

Hi Surfalot;

I just installed More Pic 6 version 1.3 today and am

having a problem. When I test from my Contents

section on a particular product to see if the additional

pictures show up on the products page, I get this error :

 

Fatal error: Call to undefined function tep_output_generated_category_path_fs() in /home/ladykd54/public_html/cart/admin/categories.php on line 403

 

Here is the snippet of code from lines 403 - 406 :

 

$products_subimage1->set_destination(DIR_FS_CATALOG_IMAGES . tep_output_generated_category_path_fs($categories_id));

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

$products_subimage1_name = $products_subimage1->filename;

} else {

 

Could you help this newbie please?

 

Thanks,

Karen

Link to comment
Share on other sites

Thank you surfalot

 

I got there eventually! Your logic was entirely accurate,

 

Nossum

 

For anybody that follows up this thread the final version of the code is like this

 

<tr>
<td class="main">
<?php
$product_mnftr_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m where p.manufacturers_id = m.manufacturers_id and products_status = '1'  and products_help = '1' and products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
$mnftr_info = tep_db_fetch_array($product_mnftr_query);
$helpfilename = ('manufacturer_info'.$mnftr_info['manufacturers_id'].'.php');


if (!empty($mnftr_info['manufacturers_id'])){
// found active product, the manufacturer ID is: $mnftr_info['manufacturers_id'] and the manufacturer's name is: $mnftr_info['manufacturers_name'] and products_help is true (ie 1)

if (file_exists($helpfilename)) {

echo '<a href="java script:popupWindow(\'' . tep_href_link('manufacturer_info'.$mnftr_info['manufacturers_id'].'.php') . '\')"> <font color="#0000FF">Click here for advice on this product</font>.</a>';

} else {


echo '<a href="java script:popupWindow(\'' . tep_href_link('manufacturer_infotocome.php') . '\')"> <font color="#0000FF">Click here for advice on this product</font>.</a>';


}

}

?>

</td>
</tr>

 

I decided to insert a new field into to the table "PRODUCTS" which is a tinyint() and have it default to "0"

 

This means that I have to add the field into the data capture but it gives much more flexibility to decide it this help option should be used.

 

The code also checks if the help file exists and if not calls up a default.

 

Sorry surfalot/moderators if this has gone slightly off topic, but thanks again to surfalot for putting me right on the code

Link to comment
Share on other sites

Hy All!! I have a problem ... i installed the more_pics_6 v 1.1 and i had some errors that i found and fixed but i am stuck at a prticular error that i can't understand ........... it happends when i try to access the Categories/Products in Admin page "1054 - Unknown column 'p.products_subimage1' in 'field list'

 

select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from products p, products_description pd where p.products_status = '1' and p.products_id = '123' and pd.products_id = p.products_id and pd.language_id = '4' "

This is the exact error that I get

imagexq6.jpg

 

What can i do to fix it ... i use the v 1.146 Categories.php i will copy paste the code so u can see it; but it's the same with the one in the more_pics_6 archive

Pls help me :( thank you for your time

 

 

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

 

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

 

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

 

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

 

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

 

$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]));

 

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

$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

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();

 

$description_query = tep_db_query("select language_id, products_name, products_description, 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_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_url']) . "', '0')");

}

 

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)) {

// BOF: More Pics 6

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

<?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"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

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

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . tep_draw_input_field('products_quantity', $pInfo->products_quantity); ?></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_MODEL; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . tep_draw_input_field('products_model', $pInfo->products_model); ?></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_IMAGE; ?></td>

<?php // BOF: More Pics 6 ?>

<td class="main" ><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . tep_draw_file_field('products_image') . tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . $pInfo->products_image . tep_draw_hidden_field('products_previous_image', $pInfo->products_image); ?>

<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('delete_image_1', 'yes', false) . TEXT_DELETE_IMAGE; ?>

</td>

</tr>

<tr>

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

</tr>

<tr>

<td class="main" align="top"><?php echo TEXT_PRODUCTS_SUBIMAGE1; ?>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . tep_draw_file_field('products_subimage1') . tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . $pInfo->products_subimage1 . tep_draw_hidden_field('products_previous_subimage1', $pInfo->products_subimage1); ?>

<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('delete_image_3', 'yes', false) . TEXT_DELETE_IMAGE; ?>

</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_SUBIMAGE2; ?> </td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . tep_draw_file_field('products_subimage2') . tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . $pInfo->products_subimage2 . tep_draw_hidden_field('products_previous_subimage2', $pInfo->products_subimage2); ?>

<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('delete_image_5', 'yes', false) . TEXT_DELETE_IMAGE; ?></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_SUBIMAGE3; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . tep_draw_file_field('products_subimage3') . tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . $pInfo->products_subimage3 . tep_draw_hidden_field('products_previous_subimage3', $pInfo->products_subimage3); ?>

<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('delete_image_7', 'yes', false) . TEXT_DELETE_IMAGE; ?></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_SUBIMAGE4; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . tep_draw_file_field('products_subimage4') . tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . $pInfo->products_subimage4 . tep_draw_hidden_field('products_previous_subimage4', $pInfo->products_subimage4); ?>

<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('delete_image_9', 'yes', false) . TEXT_DELETE_IMAGE; ?></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_SUBIMAGE5; ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . tep_draw_file_field('products_subimage5') . tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . $pInfo->products_subimage5 . tep_draw_hidden_field('products_previous_subimage5', $pInfo->products_subimage5); ?>

<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('delete_image_11', 'yes', false) . TEXT_DELETE_IMAGE; ?></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_SUBIMAGE6 ?></td>

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . tep_draw_file_field('products_subimage6') . tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . $pInfo->products_subimage6 . tep_draw_hidden_field('products_previous_subimage6', $pInfo->products_subimage6); ?>

<?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('delete_image_13', 'yes', false) . TEXT_DELETE_IMAGE; ?></td>

<?php // BOF: More Pics 6 ?>

</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_URL . '<br><small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?></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_url[' . $languages[$i]['id'] . ']', (isset($products_url[$languages[$i]['id']]) ? $products_url[$languages[$i]['id']] : tep_get_products_url($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>

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

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

</tr>

</table></td>

</tr>

<tr>

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

</tr>

<tr>

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_date_added', (tep_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . '??<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>

</tr>

</table></form>

<?php

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

if (tep_not_null($HTTP_POST_VARS)) {

$pInfo = new 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'];

} else {

// BOF: More Pics 6

$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, 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, p.products_date_available, p.products_status, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");

// EOF: More Pics 6

$product = tep_db_fetch_array($product_query);

 

$pInfo = new objectInfo($product);

$products_image_name = $pInfo->products_image;

// BOF: More Pics 6

$products_subimage1_name = $pInfo->products_subimage1;

$products_subimage2_name = $pInfo->products_subimage2;

$products_subimage3_name = $pInfo->products_subimage3;

$products_subimage4_name = $pInfo->products_subimage4;

$products_subimage5_name = $pInfo->products_subimage5;

$products_subimage6_name = $pInfo->products_subimage6;

// EOF: More Pics 6

}

 

$form_action = (isset($HTTP_GET_VARS['pID'])) ? 'update_product' : 'insert_product';

 

echo tep_draw_form($form_ac

Link to comment
Share on other sites

Fatal error: Call to undefined function tep_output_generated_category_path_fs() in /home/ladykd54/public_html/cart/admin/categories.php on line 403

do you have the contribution Products Images Folder Tree installed?

if not, you should not have added the Other Contributions instructions, you need to take that back out.

Link to comment
Share on other sites

Hy All!! I have a problem ... i installed the more_pics_6 v 1.1 and i had some errors that i found and fixed but i am stuck at a prticular error that i can't understand ........... it happends when i try to access the Categories/Products in Admin page "1054 - Unknown column 'p.products_subimage1' in 'field list'

 

select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_subimage1, p.products_subimage2, p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from products p, products_description pd where p.products_status = '1' and p.products_id = '123' and pd.products_id = p.products_id and pd.language_id = '4' "

we don't get enough room to post the entire contents of file. Have you run the SQL script as directed?

Edited by surfalot
Link to comment
Share on other sites

we don't get enough room to post the entire contents of file. Have you run the SQL script as directed?

I'm not so good in english ............. i do not understand what do you meen. I copyed the files in more_pics and made some changes to work on my site other than that i did nothing i get this error and i don't know why at least give me some suggestion of what shoul i look for , or where to look in which *.php file must i make the chnages.

Link to comment
Share on other sites

the reason you are getting the errors is because you have not added the correct fields to your database for this contribution to work.

 

you need to complete step 1 from the readme file:

 

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

 

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

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

 

Your host should provide a SQL script tools like phpMyAdmin for you to do this with.

 

if not, you can click on "My Contributions" next to my forum name, install my "Run SQL Script from Admin" contribution. PLEASE DO make a backup of your database before using Run SQL, as directed on the script page.

 

to be safe, remove the run_sql.php file afterwards since it could be used by hackers if they were to get access to it.

 

hope this helps. This will be a part of many contributions that are available here.

Link to comment
Share on other sites

do you have the contribution Products Images Folder Tree installed?

if not, you should not have added the Other Contributions instructions, you need to take that back out.

 

Hi Suralot;

That solved the problem perfectly. Thank you !! I'm thinking about

installing the contrib http://www.oscommerce.com/community/contri...h,pop+up+images

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

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

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

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

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

 

Thanks again for your help and a great contrib :thumbsup:

 

Karen

Link to comment
Share on other sites

HI everyone i hope i will get some good ideas here, i have been using more pics for a while now succesfully then this evneing i came across another great contribution that zoom in and zoom out the pop up image once i installed this one i get all kinds of errors, if i replace the popup image file with the one in the other contribution it works fine but i only get my main image and loose all the other images,

 

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

 

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

 

 

thanks everyone in advance

 

www.eurodatagb.com

Link to comment
Share on other sites

I too am getting the error of

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

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

 

I get this when I click on the Catalog in admin panel.

I have ran the sql statements as directed.

 

Also when I look in the configuration there is no more pics part as quoted in the readme(english) file

Configure as needed in your osCommerce Admin. There will be a new

configuration group called "More Pics" after the SQL is added.

Find it in: Admin -> Configuration -> More Pics

 

If I run the sql as mentioned earlier will that only affect this contrib? or will have an affect on any thing else?

 

I have tried a manual update on my files and got the error (I have seo urls and discounts and price breaks installed) so I tried to just uplaod the files that come with the contrib and still get the error.

 

Does anyone have a fix for this?

Link to comment
Share on other sites

I too am getting the error of

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

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

is your MySQL version 5?

Link to comment
Share on other sites

is your MySQL version 5?

 

Hi my versions are

 

MySQL - 4.1.21-standard

 

phpMyAdmin - 2.8.0.2

 

Kind Regards

Link to comment
Share on other sites

This may of been mentioned before, but I did not see it when scanning throught the posts.

 

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

 

Also, is it a fairly easy contrib to add?

Edited by DeadDingo
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...