Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Contrib Installer


rinon

Recommended Posts

  • Replies 430
  • Created
  • Last Reply

Top Posters In This Topic

Hello

i'm a newbie and i would really love to use your contrib but i have a question

i went through the forum and i didnt see an anser therefore i thought that i should ask you directly, thank you inadvance.

 

i already have a modified OSC, so can i still install your contrib. and use it to install new contributions??

what about conflict with other contributions when you install or modify a page will your contrib knows what line to keep and what line to change or add??

 

Best regards

SARMAD S.

Link to comment
Share on other sites

Hello

i'm a newbie and i would really love to use your contrib but i have a question

i went through the forum and i didnt see an anser therefore i thought that i should ask you directly, thank you inadvance.

 

i already have a modified OSC, so can i still install your contrib. and use it to install new contributions??

what about conflict with other contributions when you install or modify a page will your contrib knows what line to keep and what line to change or add??

 

Best regards

SARMAD S.

 

For right now, I strongly suggest that you do not use the Contrib Installer on a modified osCommerce installation. It might work, but it probably wouldn't. I'm working on a way to be able to use this Installer on a modified shop, but I haven't finished it yet. Sorry, but my advice is, don't use this on anything but a brand-new install.

 

- Rinon

Link to comment
Share on other sites

Hello Rinon.

 

I just downloaded the controller install and read that I have to install the package to a clean OSC install. I have already installed STS and a few other contrib to the shop and really don't want to do it again.

 

Can I still use the controller or will it cause problems?

 

TIA

Clesha

Edited by simplyclesha

Thanks!

Clesha

Link to comment
Share on other sites

Hello Rinon.

 

I just downloaded the controller install and read that I have to install the package to a clean OSC install.  I have already installed STS and a few other contrib to the shop and really don't want to do it again. 

 

Can I still use the controller or will it cause problems?

 

TIA

Clesha

 

See post 28 above. I'm planning to make an install package for sts soon, but I haven't been able to get to it yet.

 

- Rinon

Link to comment
Share on other sites

Hello,

 

Thanks for this fantastic job !

 

Anyway still dos not work for me... :(

 

I'm trying to instal Header Tags Controller using Contrib installer locally with EasyPHP. Everything seems fine until I reach this page : http://127.0.0.1/admin/contrib_installer.php.

Here the title is "HEADING_TITLE" and below I have the big square with the contrib I have in my admin/contributions folder. So I select Header Tags Controller and hit the INSTALL button.

This lead to the following error message :

"Not Found

The requested URL /admin/FILENAME_CONTRIB_INSTALLER was not found on this server."

And the URL in the address bar is the following :

"http://127.0.0.1/admin/FILENAME_CONTRIB_INSTALLER?contrib=Header_Tags_Controller-2.5.4-2&action=install"

 

I think the problem come from FILENAME_CONTRIB_INSTALLER which should be something else, but I don't know what....

 

Thanks for your help

Link to comment
Share on other sites

i get this error when going to the web page for configuration- any ideas??

 

Warning: main(includes/functions/xml_parser.php): failed to open stream: No such file or directory in /home/lastdash/public_html/catalog/admin/contrib_installer.php on line 15

 

Fatal error: main(): Failed opening required 'includes/functions/xml_parser.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/lastdash/public_html/catalog/admin/contrib_installer.php on line 15

Link to comment
Share on other sites

i get this error when going to the web page for configuration- any ideas??

 

Warning: main(includes/functions/xml_parser.php): failed to open stream: No such file or directory in /home/lastdash/public_html/catalog/admin/contrib_installer.php on line 15

 

Fatal error: main(): Failed opening required 'includes/functions/xml_parser.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/lastdash/public_html/catalog/admin/contrib_installer.php on line 15

 

It seems that the file xml_parser.php is not in the includes/functions/ directory... Can you check that ?

Link to comment
Share on other sites

Sorry for the bugs, I'm still trying to figure out what the problem is. I'm going to make some improvements to the code this week, so in the mean time, be careful where you install the Contrib Installer, so you don't mess anything important up. Thanks for your patience in this, and I'll get these bugs fixed ASAP.

 

- Rinon

Link to comment
Share on other sites

I am really in a bind. I used Contrib Installer to install Header Tags and now my categories file is missing a lot of ] and }. I am still new to PHP and can't figure out how to fix this problem. Can I get help fixing this file?

 

Here it is if anybody can help.

 

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

 

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

}

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

}

}

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ 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 . "'");

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

$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/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ 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'/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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 . "'");

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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'/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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] . "', ";

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

reset($products_delete);

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

tep_remove_product($key);

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ 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');

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ 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'/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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 . "')");

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ 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 . "'");

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

$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/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ 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 . "'");

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

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 . "')");

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ else {

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {

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

$product = tep_db_fetch_array($product_query);

 

tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, 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_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'] . "')");

$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')");

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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;

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

if (USE_CACHE == 'true') {

tep_reset_cache_block('categories');

tep_reset_cache_block('also_purchased');

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

break;

case 'new_product_preview':

// 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;

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ else {

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

break;

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

// 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');

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ else {

$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

?>

<!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' => '',

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

$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_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'/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

$product = tep_db_fetch_array($product_query);

 

$pInfo->objectInfo($product);

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ 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'];

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

?>

<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";

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

?>

 

function doRound(x, places) {

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ else {

return 0;

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

function updateGross() {

var taxRate = getTaxRate();

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

 

if (taxRate > 0) {

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

function updateNet() {

var taxRate = getTaxRate();

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

 

if (taxRate > 0) {

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

?>

<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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

?>

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

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_file_field('products_image') . '<br>' . tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $pInfo->products_image . tep_draw_hidden_field('products_previous_image', $pInfo->products_image); ?></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_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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

?>

<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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ 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'];

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ else {

$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_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'/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

$product = tep_db_fetch_array($product_query);

 

$pInfo = new objectInfo($product);

$products_image_name = $pInfo->products_image;

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

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

 

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

 

$languages = tep_get_languages();

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

if (isset($HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) {

$pInfo->products_name = tep_get_products_name($pInfo->products_id, $languages[$i]['id']);

$pInfo->products_description = tep_get_products_description($pInfo->products_id, $languages[$i]['id']);

$pInfo->products_url = tep_get_products_url($pInfo->products_id, $languages[$i]['id']);

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ else {

$pInfo->products_name = tep_db_prepare_input($products_name[$languages[$i]['id']]);

$pInfo->products_description = tep_db_prepare_input($products_description[$languages[$i]['id']]);

$pInfo->products_url = tep_db_prepare_input($products_url[$languages[$i]['id']]);

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

?>

<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 tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $pInfo->products_name; ?></td>

<td class="pageHeading" align="right"><?php echo $currencies->format($pInfo->products_price); ?></td>

</tr>

</table></td>

</tr>

<tr>

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

</tr>

<tr>

<td class="main"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->products_description; ?></td>

</tr>

<?php

if ($pInfo->products_url) {

?>

<tr>

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

</tr>

<tr>

<td class="main"><?php echo sprintf(TEXT_PRODUCT_MORE_INFORMATION, $pInfo->products_url); ?></td>

</tr>

<?php

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

?>

<tr>

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

</tr>

<?php

if ($pInfo->products_date_available > date('Y-m-d')) {

?>

<tr>

<td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_AVAILABLE, tep_date_long($pInfo->products_date_available)); ?></td>

</tr>

<?php

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ else {

?>

<tr>

<td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_ADDED, tep_date_long($pInfo->products_date_added)); ?></td>

</tr>

<?php

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

?>

<tr>

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

</tr>

<?php

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

 

if (isset($HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) {

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

$pos_params = strpos($HTTP_GET_VARS['origin'], '?', 0);

if ($pos_params != false) {

$back_url = substr($HTTP_GET_VARS['origin'], 0, $pos_params);

$back_url_params = substr($HTTP_GET_VARS['origin'], $pos_params + 1);

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ else {

$back_url = $HTTP_GET_VARS['origin'];

$back_url_params = '';

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ else {

$back_url = FILENAME_CATEGORIES;

$back_url_params = 'cPath=' . $cPath . '&pID=' . $pInfo->products_id;

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

?>

<tr>

<td align="right"><?php echo '<a href="' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

</tr>

<?php

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ else {

?>

<tr>

<td align="right" class="smallText">

<?php

/* Re-Post all POST'ed variables */

reset($HTTP_POST_VARS);

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

if (!is_array($HTTP_POST_VARS[$key])) {

echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

$languages = tep_get_languages();

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

echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));

echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));

echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

echo tep_draw_hidden_field('products_image', stripslashes($products_image_name));

 

echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '  ';

 

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

echo tep_image_submit('button_update.gif', IMAGE_UPDATE);

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ else {

echo tep_image_submit('button_insert.gif', IMAGE_INSERT);

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

echo '  <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

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ else {

?>

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

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

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

<tr>

<td class="smallText" align="right">

<?php

echo tep_draw_form('search', FILENAME_CATEGORIES, '', 'get');

echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search');

echo '</form>';

?>

</td>

</tr>

<tr>

<td class="smallText" align="right">

<?php

echo tep_draw_form('goto', FILENAME_CATEGORIES, '', 'get');

echo HEADING_TITLE_GOTO . ' ' . tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"');

echo '</form>';

?>

</td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

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

<tr>

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

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></td>

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>

</tr>

<?php

$categories_count = 0;

$rows = 0;

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

$search = tep_db_prepare_input($HTTP_GET_VARS['search']);

 

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ else {

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */

while ($categories = tep_db_fetch_array($categories_query)) {

$categories_count++;

$rows++;

 

// Get parent_id for subcategories if search

if (isset($HTTP_GET_VARS['search'])) $cPath= $categories['parent_id'];

 

if ((!isset($HTTP_GET_VARS['cID']) && !isset($HTTP_GET_VARS['pID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $categories['categories_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {

$categ

Link to comment
Share on other sites

I am really in a bind. I used Contrib Installer to install Header Tags and now my categories file is missing a lot of ] and }. I am still new to PHP and can't figure out how to fix this problem. Can I get help fixing this file?

 

Here it is if anybody can help.

 

<snip>

 

Hopefully you hadn't altered this file previously? If you haven't altered, then you can just replace it with the categories.php file from the oscommerce zip file. I assume you mean admin/categories.php, correct?

 

I'm working on fixing this bug, but I'm not sure what's causing it, it works fine on my system. What version of PHP and MySQL are you using? (you can find this info under "Server Info" in the Tools section of the administration) Also, had you installed anything else before the Header Tags Controller CIP (Contrib Installer Package)? Any manual altering? Any information that you (or anyone else who's having similar problems) can provide will be immensely helpful in getting this fixed. I especially need to know the PHP and MySQL versions of anyone who's having these (or similar) problems.

 

Also, for next time, just a posting on this thread would have been sufficient, instead of the announcements thread.

 

- Rinon

Link to comment
Share on other sites

Hello,

 

Thanks for this fantastic job !

 

Anyway still dos not work for me... :(

 

I'm trying to instal Header Tags Controller using Contrib installer locally with EasyPHP. Everything seems fine until I reach this page : http://127.0.0.1/admin/contrib_installer.php.

Here the title is "HEADING_TITLE" and below I have the big square with the contrib I have in my admin/contributions folder. So I select Header Tags Controller and hit the INSTALL button.

This lead to the following error message :

"Not Found

The requested URL /admin/FILENAME_CONTRIB_INSTALLER was not found on this server."

And the URL in the address bar is the following :

"http://127.0.0.1/admin/FILENAME_CONTRIB_INSTALLER?contrib=Header_Tags_Controller-2.5.4-2&action=install"

 

I think the problem come from FILENAME_CONTRIB_INSTALLER which should be something else, but I don't know what....

 

Thanks for your help

 

I have a problem like yours. :blink: The message says:

 

Warning: opendir(e:/easyphp1-8/www/contributions/): failed to open dir: Invalid argument in e:\easyphp1-8\www\oscommerce\admin\contrib_installer.php on line 832

 

Warning: readdir(): supplied argument is not a valid Directory resource in e:\easyphp1-8\www\oscommerce\admin\contrib_installer.php on line 833

 

Warning: closedir(): supplied argument is not a valid Directory resource in e:\easyphp1-8\www\oscommerce\admin\contrib_installer.php on line 838

 

and the line 832 is

$dh = opendir(MODULE_CONTRIB_INSTALLER_DIR_FS_CONTRIBUTIONS);

Link to comment
Share on other sites

I have a problem like yours.  :blink: The message says:

 

Warning: opendir(e:/easyphp1-8/www/contributions/): failed to open dir: Invalid argument in e:\easyphp1-8\www\oscommerce\admin\contrib_installer.php on line 832

 

Warning: readdir(): supplied argument is not a valid Directory resource in e:\easyphp1-8\www\oscommerce\admin\contrib_installer.php on line 833

 

Warning: closedir(): supplied argument is not a valid Directory resource in e:\easyphp1-8\www\oscommerce\admin\contrib_installer.php on line 838

 

and the line 832 is

$dh  = opendir(MODULE_CONTRIB_INSTALLER_DIR_FS_CONTRIBUTIONS);

 

In both of these cases, it would seem to me that the correct database entry doesn't exist. Can you see if there is any database entry in the configuration table referrring to MODULE_CONTRIB_INSTALLER_DIR_FS_CONTRIBUTIONS? Perhaps this SQL would work for you:

SELECT * FROM configuration WHERE configuration_key = 'MODULE_CONTRIB_INSTALLER_DIR_FS_CONTRIBUTIONS';

 

- Rinon

Link to comment
Share on other sites

Hi. I am new and I am having problems installing the Admin_Access-2.1.1-2. I go through all the steps, and after setting the permissions I get a list of actions that the installer performed. Such as things that it created in the sql, and changes that it made. After that I try to access the admin and I get the following error

Parse error: parse error, unexpected '}', expecting ']' in /home/airsoft1/public_html/admin/index.php on line 146

Was there something that I was suppose to do that I somehow missed? Your help is appreciated, thanks.

Edited by EvaD
Link to comment
Share on other sites

i just reinstalled the contrib again and proceeded to install the admin access. going through the instructions step by step i noticed that it says

2. Database.

You must to create three tables into your DB, using the 'admin_tabel.sql' file.

i searched through the zip file and did not find that admin_table.sql, where am i suppose to find this file so i can create the 3 tables?

Link to comment
Share on other sites

Hi. I am new and I am having problems installing the Admin_Access-2.1.1-2. I go through all the steps, and after setting the permissions I get a list of actions that the installer performed. Such as things that it created in the sql, and changes that it made. After that I try to access the admin and I get the following error

Was there something that I was suppose to do that I somehow missed? Your help is appreciated, thanks.

This is a bug, and has been reported before. I'm working on figuring out exactly what this is and why it is occurring, since I can't duplicate it on my machine. What version of PHP do you have? Can you post the lines around 146 in catalog/admin/index.php please?

 

i just reinstalled the contrib again and proceeded to install the admin access. going through the instructions step by step i noticed that it says

 

i searched through the zip file and did not find that admin_table.sql, where am i suppose to find this file so i can create the 3 tables?

 

What you described above sounds correct (although it is obviously not working). You don't need to use the instructions in the readme for Admin_Access CIP, I just put that there for documentation sake. If you want to install using the Contrib Installer, just do what you did above, don't follow the manual instructions. BTW - the Installer will take care of creating those tables.

 

Sorry for the bug, I'm working on fixing it. I unfortunately just can't duplicate this behavior.

 

- Rinon

Link to comment
Share on other sites

This is a bug, and has been reported before. I'm working on figuring out exactly what this is and why it is occurring, since I can't duplicate it on my machine. What version of PHP do you have? Can you post the lines around 146 in catalog/admin/index.php please?

What you described above sounds correct (although it is obviously not working). You don't need to use the instructions in the readme for Admin_Access CIP, I just put that there for documentation sake. If you want to install using the Contrib Installer, just do what you did above, don't follow the manual instructions. BTW - the Installer will take care of creating those tables.

 

Sorry for the bug, I'm working on fixing it. I unfortunately just can't duplicate this behavior.

 

- Rinon

hi thanks for your quick response. i am using php version 4.3.11. i will do a fresh install right now and as soon as i am done i will post the lines that you asked for.

Link to comment
Share on other sites

ok i just finished the fresh install, and i have the same problem. here are the lines from 140 to 150:

  $orders_contents = '';
 $orders_status_query = tep_db_query("select orders_status_name, orders_status_id from " . TABLE_ORDERS_STATUS . " where language_id = '" . $languages_id . "'");
 while ($orders_status = tep_db_fetch_array($orders_status_query)) {
   $orders_pending_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS . " where orders_status = '" . $orders_status['orders_status_id'] . "'");
   $orders_pending = tep_db_fetch_array($orders_pending_query);
   $orders_contents .= '<a href="' . tep_href_link(FILENAME_ORDERS, 'selected_box=customers&status=' . $orders_status['orders_status_id']) . '">' . $orders_status['orders_status_name'] . '</a>: ' . $orders_pending['count'/* End Admin_Access-2.1.1 - installed by contrib_installer */
}
 $orders_contents = substr($orders_contents, 0, -4);

 $heading = array();
 $contents = array();

line 146 is " } "

Edited by EvaD
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...