Jump to content

Ethan1701

Members
  • Content count

    172
  • Joined

  • Last visited

Posts posted by Ethan1701


  1. great now I have a new problem and I know it's something simple.

     

    Everything works except when an email is sent it does not give the order number, so all i get for the invoice link is

     

    https://www.domain.com/account_history_info.php?order_id=

     

    going through the Order.class.php code I notice in the email section it is pulling it from the $item_number...

    I'm having the same problem. I don't at the moment have the option of testing, but I suspect this might only occur when a customer logs in and goes directly to the checkout. No way of confirming this - this is what happened now.

     

    I'm getting a confirmation email about the order, and I am getting the money. However, the order doesn't appear in the database. Please help!

     

    -Ethan


  2. I've been having the same problems. My server doesn't print the error messages to the screen, so I never know what the problem was until now. After reading your error message, I found a solution to the problem:

    replace

    <?php
                
                 for ($i=1; $i<32; $i++) {
    line378:             $dob_day[] = array('id' => sprintf('%02d', $i), 'text' => sprintf('%02d', $i));
              }
              
     for ($i=1; $i<13; $i++) {
     $dob_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
     }
    
     $today = getdate();
     $first_year = $today['year'] - 77;
     $last_year = $today['year'] - 10;
     for ($i=$first_year; $i < $last_year; $i++) {
     $dob_year[] = array('id' => sprintf('%02d', $i), 'text' => sprintf('%02d', $i));
     }
    
                
     echo tep_draw_pull_down_menu('dob_day', $dob_day);
     echo tep_draw_pull_down_menu('dob_month', $dob_month);
     echo tep_draw_pull_down_menu('dob_year', $dob_year);
                                 echo tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': '';
                 ?>

    with

    <?php
                
    for ($i=1; $i<32; $i++) {
     $dob_day_arr[] = array('id' => sprintf('%02d', $i), 'text' => sprintf('%02d', $i));
    }
              
    for ($i=1; $i<13; $i++) {
     $dob_month_arr[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
    }
    
    $today = getdate();
    $first_year = $today['year'] - 77;
    $last_year = $today['year'] - 10;
    for ($i=$first_year; $i < $last_year; $i++) {
     $dob_year_arr[] = array('id' => sprintf('%02d', $i), 'text' => sprintf('%02d', $i));
    }
    
                
    echo tep_draw_pull_down_menu('dob_day', $dob_day_arr);
    echo tep_draw_pull_down_menu('dob_month', $dob_month_arr);
    echo tep_draw_pull_down_menu('dob_year', $dob_year_arr);
                                 echo tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': '';
                 ?>

    What I did was replace the arrays dob_day[], dob_month[] and dob_year[] with arrays by the same name with the suffix _arr. The reason for this, is that when the page calls for itself (as it does if the email address exists), it receives variables from your browser by the same names as the arrays. The error you got tells us that it can't turn a string variable into an array. It was trying to, because they have the same name. So giving the arrays a new, distinguishing name, solved the problem.

    You can replace your code with the one I put here. I'll ad a new version to the contribution for the next generations.

     

    -Ethan, doing my share.


  3. I've installed a 'who's online' enhancement, and it has given me a few ideas for additional enhancements I'd like to see, but I'm not sure how to do on my own. Here are the ideas I've had:

     

    compair user ID to robots.txt. If the user is a bot, color the line is color A

    detect my IP. color my sessions in color B

    Control these colors via stylesheet.

     

    onder the list, summerise with:

    ........................distinct..............total

    customers.............5......................7

    search engines......2......................3

    Administrator........1......................2

    total.....................8......................12

     

    If a customer has something in his shopping cart, color session in color C

     

    Can this be done? I'd be happy to help, but I have no idea where to start.

     

    -Ethan


  4. Hi,

    In the past couple of weeks, my SE raing has been dropping, till now it's all gone. I traced the problem to the autologin contribution: if there's no cookie (which SE won't have), they get forwarded to the logoff page

      if($autologon_executed != 'true'){

        $autologon_page = '<html><head><meta http-equiv="Refresh" content="0;URL=' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '"></head><body></body></html>';

        $autologon_link = ((getenv('HTTPS') == 'on') ? 'https://' : 'http://') . $SERVER_NAME . $REQUEST_URI . (strpos($REQUEST_URI, "?") ? '&' : '?') . SID;

    The hearders here suck, and that's besides there not being any products on this page. Can someone please briefly explain to me why the user is directed to the logoff page in the first place?

    Is there a nkown fix for this issue? for the meantime, I'm disabling the autologon, but I'd like to get it to work properly, so I could reactivate it.

     

    Please help,

    -Ethan


  5. A quick question:

    In the current version, clicking on a customer's name will open the customer list page, searching for his last name. How can this be altered so instead it goes into the specific customer's info page, based on the customer ID?

     

    -Ethan


  6. oakhill,

    I installed the enable/disable contribution a few weeks ago, over a very moded osC. I had to edit the code of all the contributions i had previously installed, but it's not too dificult. This will take some basic SQL understanding, and a lot of patience:

    The enable/diasable contribution (from here on to be known as E/D), adds a column to the categories table, called categories_status. In all the queries you run, you have to make a condition on this column, as the E/D SQL statements would show.

    any query you wish to edit, which already refers to TABLE_CATEGORIES is easy to fix. In it's WHERE clause, add the following condition:

    c.categories_status = '1'

    Most queries do in fact read from this table, among others, but if you encounter one that doesn't you will have to add the table to the FROM clause (from " . TABLE_CATEGORIES . " c, " ), and in the WHERE clause, use the code I gave you above, and link the table to any other tables by the common fields, usually being the categories_id (WHERE c.categories_id=cd.categories_id, for example)

     

    This ought to fix all the problems you have in this matter.

     

    -Ethan


  7. Hi,

    I installed the enable/ disable category contribution. It has you alter the Queries to the database, to reflect the change it made. It verifies that the cetegory status is '1'. This works great, but not perfect. I've installed some other contributions, and I need to incorporate this change into them.

    I'm haveing a hard time especialy with the all_prods contribution. the query in it is

      $listing_sql = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' order by p.products_price, pd.products_name";

    I need to somehow add to this a line basically saying

    where c.categories_status = '1' and...

    , where as usual, C is TABLE_CATEGORIES.

     

    I will also need help finding how to add this change to the categories dropdown list in the advanced search.

     

    Thanks!

    -Ethan


  8. Jim,

    Your contibution worked, thank you!

    I did, however, have to make a few changes, which I beleive should be made public as the next version:

    1. in order for the link in the email to work, you must add the following lines to admin/includes/filenames.php:

    //// Begin Unsubscribe hack
    ? define('FILENAME_UNSUBSCRIBE', 'unsubscribe.php');
    //// End Unsubscribe hack

     

    2. sdtep 2 of the readme creates a link which is missing the /catalog/ part of the URL. to fix this, replace

    $mimemessage->add_text($this->content . TEXT_UNSUBSCRIBE . HTTP_CATALOG_SERVER . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address']);

    with

    $mimemessage->add_text($this->content . TEXT_UNSUBSCRIBE . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address']);

    Also, if you're sending out HTML base emails, as I am, you may want to change the function call from add_text to add_html. In order to make the link clickable in an HTML email, as well as in non-HTML email clients, replace

    $mimemessage->add_text($this->content . TEXT_UNSUBSCRIBE . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address']);

    with

    $mimemessage->add_html($this->content . TEXT_UNSUBSCRIBE . '<a href="' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '">' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '</a>');

     

    3. again in the readme, you left the line that advises on how to check if it works with the mistake it had in it. that is, it says

    ? ? UPDATE customers SET customer_newsletter = '2' where customer_newsletter = '1'

    instead of

    ? ? UPDATE customers SET customers_newsletter = '2' where customers_newsletter = '1'

    other then that (and those are really minor fixes), It works like a charm! I think a new version ought to be made with the fixes I proposed. If you prefer, I'll make it.

     

    -Ethan


  9. kymation,

    before I go into the trouble of trying out your release, I think it would benefit everyone if you were to please list all the changes you've made. many of the directories in your release are empty, and I don't know If that's deliberate or not.

     

    Have you found a fix for the problem I had - the contribution passed the sID as part of the email address, and returned an error with every unsubscribe atempt.

     

    -Ethan


  10. That worked! Thanks for that code!!

     

    BTW, if I may suggest another idea for version 2.6:

    Include a readme file, which will tell people exaclty what lines of code have to be removed, and what has to come instead of them. Telling them the line numbers on the stock file is also needed.

     

    This will make it easier for users to remove the contribution if they so choose, and it might also help track back problems people have while installing it.

     

    -Ethan, he who broke the code of this forum, and opened a new table row. :)


  11. straider,

    I took your advise, and replacved my index.php with the one in the contribution, and still, no good.

    Not only that, but the lines of code you say appear twice - only appear once.

    I'm attaching the code in the contribution I downloaded. Maybe you could figure out what's going on...

    BTW, do you have a site for example where branch categories appear properly? IE, showing sub-categories and products?

    <?php

    /*

      $Id: index.php,v 1.1 2003/06/11 17:37:59 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');

     

    // the following cPath references come from application_top.php

      $category_depth = 'top';

      if (isset($cPath) && tep_not_null($cPath)) {

        $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");

        $cateqories_products = tep_db_fetch_array($categories_products_query);

        if ($cateqories_products['total'] > 0) {

          $category_depth = 'products'; // display products

        } else {

          $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");

          $category_parent = tep_db_fetch_array($category_parent_query);

          if ($category_parent['total'] > 0) {

            $category_depth = 'nested'; // navigate through the categories

          } else {

            $category_depth = 'products'; // category has no products, but display the 'no products' message

          }

        }

      }

     

      require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

    ?>

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

    <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

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

    </head>

    <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

    <!-- header //-->

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

    <!-- header_eof //-->

     

    <!-- body //-->

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

      <tr>

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

    <!-- left_navigation //-->

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

    <!-- left_navigation_eof //-->

        </table></td>

    <!-- body_text //-->

    <?php

      if ($category_depth == 'nested') {

        $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

        $category = tep_db_fetch_array($category_query);

    ?>

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

          <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_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

              </tr>

            </table></td>

          </tr>

          <tr>

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

          </tr>

          <tr>

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

              <!-- DWD Contribution -> Remove: Browse by Categories v2.2. //-->

              <!--

              <tr>

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

                  <tr>

              //-->

              <!-- DWD Contribution End. //-->

    <?php

        // DWD Contribution -> Remove: Browse by Categories v2.2.

    //    if (isset($cPath) && strpos('_', $cPath)) {

    // // check to see if there are deeper categories within the current category

    //      $category_links = array_reverse($cPath_array);

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

    //        $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");

    //        $categories = tep_db_fetch_array($categories_query);

    //        if ($categories['total'] < 1) {

    //          // do nothing, go through the loop

    //        } else {

    //          $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

    //          break; // we've found the deepest category the customer is in

    //        }

    //      }

    //    } else {

    //      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

    //    }

     

    //    $number_of_categories = tep_db_num_rows($categories_query);

     

    //    $rows = 0;

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

    //      $rows++;

    //      $cPath_new = tep_get_path($categories['categories_id']);

    //      $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

    //      echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";

    //      if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {

    //        echo '              </tr>' . "\n";

    //        echo '              <tr>' . "\n";

    //      }

    //    }

        // DWD Contribution End.

     

    // needed for the new products module shown below

        $new_products_category_id = $current_category_id;

    ?>

              <!-- DWD Contribution -> Remove: Browse by Categories v2.2. !-->

              <!--

                  </tr>

                </table></td>

              </tr>

              //-->

              <!-- DWD Contribution End. //-->

     

              <!-- DWD Contribution -> Add: Browse by Categories v2.0. !-->

              <tr>

                <td><?php $browse_category_id = $current_category_id; include(DIR_WS_MODULES . FILENAME_BROWSE_CATEGORIES); ?></td>

              </tr>

              <!-- DWD Contribution End. !-->

     

              <tr>

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

              </tr>

              <tr>

                <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>

              </tr>

            </table></td>

          </tr>

        </table></td>

    <?php

      } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {

    // create column list

        $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,

                            'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,

                            'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,

                            'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,

                            'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,

                            'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,

                            'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,

                            'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

     

        asort($define_list);

     

        $column_list = array();

        reset($define_list);

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

          if ($value > 0) $column_list[] = $key;

        }

     

        $select_column_list = '';

     

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

          switch ($column_list[$i]) {

            case 'PRODUCT_LIST_MODEL':

              $select_column_list .= 'p.products_model, ';

              break;

            case 'PRODUCT_LIST_NAME':

              $select_column_list .= 'pd.products_name, ';

              break;

            case 'PRODUCT_LIST_MANUFACTURER':

              $select_column_list .= 'm.manufacturers_name, ';

              break;

            case 'PRODUCT_LIST_QUANTITY':

              $select_column_list .= 'p.products_quantity, ';

              break;

            case 'PRODUCT_LIST_IMAGE':

              $select_column_list .= 'p.products_image, ';

              break;

            case 'PRODUCT_LIST_WEIGHT':

              $select_column_list .= 'p.products_weight, ';

              break;

          }

        }

     

    // show the products of a specified manufacturer

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

          if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

    // We are asked to show only a specific category

            $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";

          } else {

    // We show them all

            $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

          }

        } else {

    // show the products in a given categorie

          if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

    // We are asked to show only specific catgeory

            $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

          } else {

    // We show them all

            $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

          }

        }

     

        if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {

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

            if ($column_list[$i] == 'PRODUCT_LIST_NAME') {

              $HTTP_GET_VARS['sort'] = $i+1 . 'a';

              $listing_sql .= " order by pd.products_name";

              break;

            }

          }

        } else {

          $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);

          $sort_order = substr($HTTP_GET_VARS['sort'], 1);

          $listing_sql .= ' order by ';

          switch ($column_list[$sort_col-1]) {

            case 'PRODUCT_LIST_MODEL':

              $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

              break;

            case 'PRODUCT_LIST_NAME':

              $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');

              break;

            case 'PRODUCT_LIST_MANUFACTURER':

              $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

              break;

            case 'PRODUCT_LIST_QUANTITY':

              $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

              break;

            case 'PRODUCT_LIST_IMAGE':

              $listing_sql .= "pd.products_name";

              break;

            case 'PRODUCT_LIST_WEIGHT':

              $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

              break;

            case 'PRODUCT_LIST_PRICE':

              $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

              break;

          }

        }

    ?>

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

          <tr>

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

              <tr>

                <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

    <?php

    // optional Product List Filter

        if (PRODUCT_LIST_FILTER > 0) {

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

            $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";

          } else {

            $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";

          }

          $filterlist_query = tep_db_query($filterlist_sql);

          if (tep_db_num_rows($filterlist_query) > 1) {

            echo '            <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' ';

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

              echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);

              $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));

            } else {

              echo tep_draw_hidden_field('cPath', $cPath);

              $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));

            }

            echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);

            while ($filterlist = tep_db_fetch_array($filterlist_query)) {

              $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);

            }

            echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');

            echo '</form></td>' . "\n";

          }

        }

     

    // Get the right image for the top-right

        $image = DIR_WS_IMAGES . 'table_background_list.gif';

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

          $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

          $image = tep_db_fetch_array($image);

          $image = $image['manufacturers_image'];

        } elseif ($current_category_id) {

          $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");

          $image = tep_db_fetch_array($image);

          $image = $image['categories_image'];

        }

    ?>

                <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

              </tr>

            </table></td>

          </tr>

          <tr>

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

          </tr>

          <tr>

            <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>

          </tr>

        </table></td>

    <?php

      } else { // default page

    ?>

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

          <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_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

              </tr>

            </table></td>

          </tr>

          <tr>

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

          </tr>

          <tr>

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

              <tr>

                <td class="main"><?php echo tep_customer_greeting(); ?></td>

              </tr>

              <tr>

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

              </tr>

              <tr>

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

              </tr>

              <tr>

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

              </tr>

     

              <!-- DWD Contribution -> Add: Browse by Categories v2.0. !-->

              <tr>

                <td><br><?php include(DIR_WS_MODULES . FILENAME_BROWSE_CATEGORIES); ?></td>

              </tr>

              <tr>

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

              </tr>

              <!-- DWD Contribution End. !-->

     

              <tr>

                <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>

              </tr>

    <?php

        include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);

    ?>

            </table></td>

          </tr>

        </table></td>

    <?php

      }

    ?>

    <!-- body_text_eof //-->

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

    <!-- right_navigation //-->

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

    <!-- right_navigation_eof //-->

        </table></td>

      </tr>

    </table>

    <!-- body_eof //-->

     

    <!-- footer //-->

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

    <!-- footer_eof //-->

    <br>

    </body>

    </html>

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

     

    for compairison, here's my index.php, with the BBC and other modifications:

    <?php

    /*

      $Id: index.php,v 1.1 2003/06/11 17:37:59 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');

     

    // the following cPath references come from application_top.php

      $category_depth = 'top';

      if (isset($cPath) && tep_not_null($cPath)) {

        $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");

        $cateqories_products = tep_db_fetch_array($categories_products_query);

        if ($cateqories_products['total'] > 0) {

          $category_depth = 'products'; // display products

        } else {

          $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");

          $category_parent = tep_db_fetch_array($category_parent_query);

          if ($category_parent['total'] > 0) {

            $category_depth = 'nested'; // navigate through the categories

          } else {

            $category_depth = 'products'; // category has no products, but display the 'no products' message

          }

        }

      }

     

      require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

    ?>

    <!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 $page_title; ?><?php echo TITLE; ?></title>

    <LINK REV="made" href="mailto:info@madab-il.com">

    <META NAME="keywords" CONTENT="מדב, מד"ב, מד"ב, il, מדע בדיוני, חנות, ישראל, פנטזיה, קניה, מסע בין כוכבים, בבילון, בבילון 5, באפי, מלחמת הכוכבים, שר הטבעות, מטריקס, פארסקייפ, קלאדה, קלינגון,  sci fi, sci-fi, science fiction,madab, madab-il, israel, store, shop, buy, fantasy, star trek, buffy, babylon, babylon 5, star wars, matrix, lord of the rings, LOTR, farscape, kladagh, klingon">

    <META NAME="description" CONTENT="החנות הישראלית למוצרי מדע בדיוני ופנטזיה: אספנות מעולם אחר">

    <META NAME="author" CONTENT="איתן שלו">

    <META NAME="ROBOTS" CONTENT="ALL">

     

    <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

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

    </head>

    <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

    <!-- header //-->

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

    <!-- header_eof //-->

     

    <!-- body //-->

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

      <tr>

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

    <!-- left_navigation //-->

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

    <!-- left_navigation_eof //-->

        </table></td>

    <!-- body_text //-->

    <?php

      if ($category_depth == 'nested') {

        $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

        $category = tep_db_fetch_array($category_query);

    ?>

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

          <tr>

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

              <tr>

                <td class="pageHeading"><?php echo " " . $category['categories_name']; ?></td>

                <td class="pageHeading" align="left"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

              </tr>

            </table></td>

          </tr>

          <tr>

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

          </tr>

          <tr>

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

              <!-- DWD Contribution -> Remove: Browse by Categories v2.2. //-->

              <!--

              <tr>

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

                  <tr>

              //-->

              <!-- DWD Contribution End. //-->

    <?php

        // DWD Contribution -> Remove: Browse by Categories v2.2.

    //    if (isset($cPath) && strpos('_', $cPath)) {

    // // check to see if there are deeper categories within the current category

    //      $category_links = array_reverse($cPath_array);

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

    //        $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");

    //        $categories = tep_db_fetch_array($categories_query);

    //        if ($categories['total'] < 1) {

    //          // do nothing, go through the loop

    //        } else {

    //          $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

    //          break; // we've found the deepest category the customer is in

    //        }

    //      }

    //    } else {

    //      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

    //    }

     

    //    $number_of_categories = tep_db_num_rows($categories_query);

     

    //    $rows = 0;

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

    //      $rows++;

    //      $cPath_new = tep_get_path($categories['categories_id']);

    //      $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

    //      echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";

    //      if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {

    //        echo '              </tr>' . "\n";

    //        echo '              <tr>' . "\n";

    //      }

    //    }

        // DWD Contribution End.

     

    // needed for the new products module shown below

        $new_products_category_id = $current_category_id;

    ?>

              <!-- DWD Contribution -> Remove: Browse by Categories v2.2. !-->

              <!--

                  </tr>

                </table></td>

              </tr>

              //-->

              <!-- DWD Contribution End. //-->

     

              <!-- DWD Contribution -> Add: Browse by Categories v2.0. !-->

              <tr>

                <td><?php $browse_category_id = $current_category_id; include(DIR_WS_MODULES . FILENAME_BROWSE_CATEGORIES); ?></td>

              </tr>

              <!-- DWD Contribution End. !-->

     

              <tr>

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

              </tr>

              <tr>

                <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>

              </tr>

              <tr>

                <td><br><?php include(DIR_WS_MODULES . FILENAME_DEFAULT_SPECIALS); ?></td>

              </tr>

     

            </table></td>

          </tr>

        </table></td>

    <?php

      } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {

    // create column list

        $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,

                            'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,

                            'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,

                            'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,

                            'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,

                            'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,

                            'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,

                            'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

     

        asort($define_list);

     

        $column_list = array();

        reset($define_list);

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

          if ($value > 0) $column_list[] = $key;

        }

     

        $select_column_list = '';

     

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

          switch ($column_list[$i]) {

            case 'PRODUCT_LIST_MODEL':

              $select_column_list .= 'p.products_model, ';

              break;

            case 'PRODUCT_LIST_NAME':

              $select_column_list .= 'pd.products_name, ';

              break;

            case 'PRODUCT_LIST_MANUFACTURER':

              $select_column_list .= 'm.manufacturers_name, ';

              break;

            case 'PRODUCT_LIST_QUANTITY':

              $select_column_list .= 'p.products_quantity, ';

              break;

            case 'PRODUCT_LIST_IMAGE':

              $select_column_list .= 'p.products_image, ';

              break;

            case 'PRODUCT_LIST_WEIGHT':

              $select_column_list .= 'p.products_weight, ';

              break;

          }

        }

     

    // show the products of a specified manufacturer

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

          if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

    // We are asked to show only a specific category

            $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";

          } else {

    // We show them all

            $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

          }

        } else {

    // show the products in a given categorie

          if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

    // We are asked to show only specific catgeory

            $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

          } else {

    // We show them all

            $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

          }

        }

     

        if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {

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

            if ($column_list[$i] == 'PRODUCT_LIST_NAME') {

              $HTTP_GET_VARS['sort'] = $i+1 . 'a';

              $listing_sql .= " order by pd.products_name";

              break;

            }

          }

        } else {

          $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);

          $sort_order = substr($HTTP_GET_VARS['sort'], 1);

          $listing_sql .= ' order by ';

          switch ($column_list[$sort_col-1]) {

            case 'PRODUCT_LIST_MODEL':

              $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

              break;

            case 'PRODUCT_LIST_NAME':

              $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');

              break;

            case 'PRODUCT_LIST_MANUFACTURER':

              $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

              break;

            case 'PRODUCT_LIST_QUANTITY':

              $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

              break;

            case 'PRODUCT_LIST_IMAGE':

              $listing_sql .= "pd.products_name";

              break;

            case 'PRODUCT_LIST_WEIGHT':

              $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

              break;

            case 'PRODUCT_LIST_PRICE':

              $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

              break;

          }

        }

    ?>

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

          <tr>

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

              <tr>

                <td class="pageHeading"><?php

      $category_query1 = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

      $category1 = tep_db_fetch_array($category_query1);

     

    if ($category1['categories_name'] != "") {echo " " . $category1['categories_name'];} else { echo HEADING_TITLE;} ?>

    </td>

    <?php

    // optional Product List Filter

        if (PRODUCT_LIST_FILTER > 0) {

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

            $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";

          } else {

            $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";

          }

          $filterlist_query = tep_db_query($filterlist_sql);

          if (tep_db_num_rows($filterlist_query) > 1) {

            echo '            <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' ';

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

              echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);

              $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));

            } else {

              echo tep_draw_hidden_field('cPath', $cPath);

              $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));

            }

            echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);

            while ($filterlist = tep_db_fetch_array($filterlist_query)) {

              $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);

            }

            echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');

            echo '</form></td>' . "\n";

          }

        }

     

    // Get the right image for the top-right

        $image = DIR_WS_IMAGES . 'table_background_list.gif';

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

          $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

          $image = tep_db_fetch_array($image);

          $image = $image['manufacturers_image'];

        } elseif ($current_category_id) {

          $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");

          $image = tep_db_fetch_array($image);

          $image = $image['categories_image'];

        }

    ?>

                <td align="left"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

              </tr>

            </table></td>

          </tr>

          <tr>

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

          </tr>

          <tr>

            <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING_COL); ?></td>

          </tr>

        </table></td>

    <?php

      } else { // default page

    ?>

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

          <tr>

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

        &n


  12. straider,

    You could take a look at my site at http://www.madab-il.com. though the site is in Hebrew, I think you could manage, with the layout and the images.

    Click on the Star Trek category (second row, on the right). you will the nsee the products I have in that category, but not the subcategories. You could only get to them by clicking on them from the categories box on the right. I'm sure I'm loosing a lot of customers because of the fact they can't find things they're looking for...

    Like I said earlier, my index.php is identicle to the one in the contribution, and even tehr I can't seem to understand how it's meant to show the categories in non-leaf categories: around line 160 of the index.php file is all the code that displays products. I can't find any referance to the BBC in this segment of the code! I'd expect there to be the sub-categories box, and under that, the products listing...


  13. Hi,

    I just installed this contribution, but I have one problem I can't figure out (had others that I fixed):

    After copy-pasting the URL from the email to my browser, I get to http://www.madab-il.com/catalog/unsubscrib...il=ethan@<no spam!>.com, which shows me the unsubscribe page.

    When I click on the button, however, I'm directed to http://www.madab-il.com/catalog/unsubscrib...il=ethan@<no spam!>.com?osCsid=6442bff62650d641f69e88d9a99fe751, or some othe sID. the unsubscribe_done does't seperate the two parameters being passed, and tells me that the email address below is not on the database: ethan@<no spam!>.com?osCsid=6442bff62650d641f69e88d9a99fe751

    I tested a little, and found that if I replace the '?' with a '&', it will in fact work. The question is, where would I put this fix, and why is this problem occuring?

     

    Other then that, there are several fixes that have to be made for MS2.2, such as putting all the defines in the filenames.php file, and calling to the file within DIR_WS_CATALOG (would have fixed problems other people mentioned earlier.)

     

    Alother modification worth making is in unsubscribe_done, telling customers that they can always re-subscribe by going into their (link) account manager.

     

    The problem I mentioned is one cookie I could use some help cracking...

     

    -Ethan


  14. Regarding the problem I mentioned before;

    (quick reminder: If I'm in a cetegory, say, Hardware, The subcategories don't appear, only the products within the top level category)

     

    I compaired my index.php to the one in the contributions' ZIP file, and there's no diference.

    My guess, is that the problem might be caused if a category has sub-categories, and products in the same level. In my case, for example, I may have:

    Star Trek

    +Shirts

    +Action figures

    +Posters

    -Klingon snow globe

    -Some other product

    -And so on...

     

    Where the Bold represents a sub-category, and the italic, a product.

     

    I haven't seen any other stores where products and categories are listed in the same level, and this is whjy I suspect that this is the cause. I can't think of any other reason why the subcategories wouldn't be listed. I'd love some help here!

     

    Could you direct me to the lines of code that call the subcategory display, within the contributions index.php?

     

    -Ethan


  15. Hey there,

    I have this contribution installed, but I have a problem, which I had originally thought was a feature:

     

    Brouse by categories (henceforth: BBC) doesn't show when I'm in a sub-category. The only reason I could find for that, or at least - this is what drew my attention, is this segment of code I have commented out. It came that way- I don't recall editing it out myself:

    ~ line #90 of index.php

        // DWD Contribution -> Remove: Browse by Categories v2.2.

    //    if (isset($cPath) && strpos('_', $cPath)) {

    // // check to see if there are deeper categories within the current category

    //      $category_links = array_reverse($cPath_array);

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

    //        $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");

    //        $categories = tep_db_fetch_array($categories_query);

    //        if ($categories['total'] < 1) {

    //          // do nothing, go through the loop

    //        } else {

    //          $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

    //          break; // we've found the deepest category the customer is in

    //        }

    //      }

    //    } else {

    //      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");

    //    }

     

    //    $number_of_categories = tep_db_num_rows($categories_query);

     

    //    $rows = 0;

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

    //      $rows++;

    //      $cPath_new = tep_get_path($categories['categories_id']);

    //      $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

    //      echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";

    //      if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {

    //        echo '              </tr>' . "\n";

    //        echo '              <tr>' . "\n";

    //      }

    //    }

        // DWD Contribution End.

    Might his have anything to do with it? is there some other known cause for this?

     

    Another issueu that has to be attended to is correcting the comments in the code, to reflect the current vertion of BBC, instead of the older ones, currently mentioned.

     

    -Ethan

×