Jump to content

Dutchmen

Members
  • Content count

    1
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Bert Teunissen
  1. Hello Pronux, Thanx for the nice MOD, if have installed it in my site. the admin was good..but as some wrote there was no possibily to insert the data into the database..i have not much expirience with programming...but i get it together so it works for me ;) for those who want to update the admin section this is what i did... ATTENTION...i could fix a problem Pronus add give me..so the nice box from Pronux doesn't work in my admin section..perhaps Pronux does have a solution. What I did: ------------ 1. catalog/admin/catagories: (i have 3 tabs at this moment, the original DESCIPTION file..added SPECIFICATIONS and EXTRA INFO, so look for the changes I made) ============================ somewhere around:325 $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_specification' => tep_db_prepare_input($HTTP_POST_VARS['products_specification'][$language_id]), 'products_extra_info' => tep_db_prepare_input($HTTP_POST_VARS['products_extra_info'][$language_id]), 'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id])); somewher around:385 $dup_products_id = tep_db_insert_id(); $description_query = tep_db_query("select language_id, products_name, products_description, products_specification, products_extra_info, 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_specification, products_extra_info, 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_specification']) . "', '" . tep_db_input($description['products_extra_info']) . "', '" . 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; } somewhere around: 450 <!-- body_text //--> <td width="100%" valign="top"> <?php if ($action == 'new_product') { $parameters = array('products_name' => '', 'products_description' => '', 'products_specification' => '', 'products_extra_info' => '', 'products_url' => '', 'products_id' => '', 'products_quantity' => '', 'products_model' => '', 'products_image' => '', somewhere around: 478 $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_specification, pd.products_extra_info, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_image_array, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product = tep_db_fetch_array($product_query); $products_image_array = unserialize($product['products_image_array']); if (!is_array($products_image_array)) $products_image_array = array(); // EOF Simple multi image addon $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_specification = $HTTP_POST_VARS['products_specification']; $products_extra_info = $HTTP_POST_VARS['products_extra_info']; $products_url = $HTTP_POST_VARS['products_url']; somewhere around: 634 <=== this is the part for Pronux add-on <script language="javascript"><!-- updateGross(); //--></script> <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?> <tr> <td class="main1" 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']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr> </table></td> </tr> <?php } ?> <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?> <tr> <td class="main1" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_SPECIFICATION; ?></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_specification[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_specification[$languages[$i]['id']]) ? stripslashes($products_specification[$languages[$i]['id']]) : tep_get_products_specification($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr> </table></td> </tr> <?php } ?> <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?> <tr> <td class="main1" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_EXTRA_INFO; ?></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_extra_info[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_extra_info[$languages[$i]['id']]) ? stripslashes($products_extra_info[$languages[$i]['id']]) : tep_get_products_extra_info($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr> </table></td> </tr> <?php } ?> somewhere around: 793 </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_specification = $HTTP_POST_VARS['products_specification']; $products_extra_info = $HTTP_POST_VARS['products_extra_info']; $products_url = $HTTP_POST_VARS['products_url']; } else { // Simple multi image addon $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_specification, pd.products_extra_info, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_image_array, 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'] . "'"); $product = tep_db_fetch_array($product_query); somewhere around: 816 $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_specification = tep_get_products_specification($pInfo->products_id, $languages[$i]['id']); $pInfo->products_extra_info = tep_get_products_extra_info($pInfo->products_id, $languages[$i]['id']); $pInfo->products_url = tep_get_products_url($pInfo->products_id, $languages[$i]['id']); } 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_specification = tep_db_prepare_input($products_specification[$languages[$i]['id']]); $pInfo->products_extra_info = tep_db_prepare_input($products_extra_info[$languages[$i]['id']]); $pInfo->products_url = tep_db_prepare_input($products_url[$languages[$i]['id']]); } somewhere around:843 </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"') . '<b><u>' . TEXT_PRODUCTS_DESCRIPTION . '</u></b><br><br>' . $pInfo->products_description . '<br><br><b><u>' . TEXT_PRODUCTS_SPECIFICATION . '</u></b><br><br>' . $pInfo->products_specification. '<br><br><b><u>' . TEXT_PRODUCTS_EXTRA_INFO . '</u></b><br><br>' . $pInfo->products_extra_info; ?></td> </tr> <?php if ($pInfo->products_url) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> somewhere around: 935 $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_specification[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_specification[$languages[$i]['id']]))); echo tep_draw_hidden_field('products_extra_info[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_extra_info[$languages[$i]['id']]))); echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']]))); } echo tep_draw_hidden_field('products_image', stripslashes($products_image_name)); // Simple multi image addon $i=1;reset($products_image_array); while (list($key, $value) = each($products_image_array)) THATS THE catagorie.php file !!! 2. catalog/admin/includes/general.php ====================================== only one add for each tab function tep_get_products_name($product_id, $language_id = 0) { global $languages_id; if ($language_id == 0) $language_id = $languages_id; $product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_name']; } function tep_get_products_specification($product_id, $language_id = 0) { global $languages_id; if ($language_id == 0) $language_id = $languages_id; $product_query = tep_db_query("select products_specification from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_specification']; } function tep_get_products_extra_info($product_id, $language_id = 0) { global $languages_id; if ($language_id == 0) $language_id = $languages_id; $product_query = tep_db_query("select products_extra_info from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_extra_info']; } 3. catalog/includes/languages/....../catagories.php =================================================== Just add the following define('TEXT_PRODUCTS_SPECIFICATION', 'specification:'); define('TEXT_PRODUCTS_EXTRA_INFO', 'extra_info:'); 4. ADD TO DATABASE: products_description ========================================= products_specification products_extra_info this can be use on de public site in the tabs Hope I help somebody else with this..it took me 1 day :D:D As I say..it works for me..I wanted the tabs on the publicsite :D:D Take a look at NOT READY !!..but take a look
×