Jump to content

Java Roasters

♥Ambassador
  • Content count

    2,058
  • Joined

  • Last visited

  • Days Won

    2

Reputation Activity

  1. Like
    Java Roasters reacted to Harald Ponce de Leon in Is OSCOM 3.0 ever going to be released   
    Hi Tom..
     
    If v3.0 is out of date when it is released in Q1 2011, then I too will eat my hat.
     
    Kind regards,
  2. Like
    Java Roasters reacted to timint in Suggestions to a more tidy and optimized code   
    Digg it or call me crazy...
     
    Examples from catalog/index.php
     

    // 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);
     
    Drop all the crazy whitespace and make it mod-friendly
     

    // 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, // BOF: Mod example 'PRODUCT_LIST_FIELD' => PRODUCT_LIST_FIELD, // EOF: Mod example '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, // <--- coma ending );
     
    Why 4 sql queries?
     

    // 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 left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c 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 left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m 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 left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c 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 left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c 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 . "'"; } }
     
    Where one is enough
     

    $listing_sql = "select distinct " . $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 left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on (p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "') left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id) left join " . TABLE_SPECIALS . " s on (p.products_id = s.products_id) left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on (p.products_id = p2c.products_id) where p.products_status = '1' ". ((isset($HTTP_GET_VARS['manufacturers_id'])) ? "and m.manufacturers_id = '" . tep_db_input($HTTP_GET_VARS['manufacturers_id']) . "'" : false) ." ". ((isset($HTTP_GET_VARS['filter_id'])) ? "and p2c.categories_id = '" . tep_db_input($HTTP_GET_VARS['filter_id']) . "'" : false) ." and p2c.categories_id = '" . (int)$current_category_id . "';
     
    Line breaking sql queries is also friendlier for the human eye.
  3. Like
    Java Roasters reacted to Harald Ponce de Leon in New version of OSC2?   
    Hi All..
     
    Thanks for the feedback - it has been well received. This is a good time to lock the topic to prevent a circular discussion occurring; we would rather answer with releases than statements.
     
    Our main focus is still concentrated on v3.0 and beyond. In addition, v2.2 is also being maintained with bug fixes and security updates. We are looking at pushing 2.2RC3 out this week with security updates.
     
     
    That statement needs to be stamped in everyones mind - the v3.0 release is not a revision to v2.2, it is just shy of a rewrite with opposite fundamentals with how v2.2 was realized. A lot of work has gone into realizing v3.0 (which started as 2.2MS3) to get the foundation right for future point releases, and to make the upgrade path as easy as possible for store owners to perform.
     
    We are proud of how v3.0 is developing and are real anxious to push it out as soon as possible.
     
    Kind regards,
  4. Downvote
    Java Roasters reacted to Vger in PHP6 and OsCommerce   
    The RC versions of osCommerce are Register Globals and Register Long Arrays 'off' compatible, due to a compatibility layer fix. PHP 6 will also have Magic Quotes 'off' and I'm not sure yet how that will affect the RC versions of osCommerce.
     
    MySQL 6 is already released.
     
    Vger
×