Full service web hosting, great prices and support. Starts at $1.99/month!
Results 1 to 7 of 7

Thread: fixing oscmax1.7 for mysql5

  1. #1
    vgreff
    Guest


    Default fixing oscmax1.7 for mysql5

    I can't figure out how to send you a private message to jpf, so maybe he'll see this or someone else can point me in the right direction.

    I'd like to get a patch jpf wrote to convert v2.0RC2 to mysql 5 and then I'll need to manually apply the changes to my copy using oscmax 1.7. The patch would help me tremendously since you already identified all the sql and files that need fixing. I have no problem manually applying.

    I found this message below in a forum but can't find a link to the download of the patch.

    Thank you

    vince

    You will need to backport and apply the patch that jpf put together. It should fix compatibility issues with php and mysql 5. I am running a patched version on php 5.1.4 and mysql 5 without any errors.

    Note that the patch is for v2.0RC2 and will need to be massaged a bit to get it to work on v1.7... You will have to manually compare files and merge the appropriate changes one by one, adapting them for v1.7. I suggest working on a backup copy of your site so that you don't trash your original install should you make a mistake.

  2. #2
    osCMax Developer


    fixing oscmax1.7 for mysql5

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    23,012
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    michael_s     $ 10.00
    Rep Power
    594


    Default Re: fixing oscmax1.7 for mysql5

    New users are not allowed to PM until they have several posts, thus you cannot PM. Regardless, this is not an issue to PM someone, but is perfect for posting to the forums, as anyone that knows mysql can help you.

    It is really simple to fix, there are just a few files that need changes:

    index.php, there are 4 mysql queries that need updating.
    advanced_search_result.tpl.php there is 1 query that needs updating.

    All you have to do is delineate the joins in the queries so that the notation is strict. So you look for the "from" in each query and offset everything after it but before the "left join" with () and make sure to nest the parenthesis for multiple joins.

    Here are the updated queries for index.php:
    PHP Code:
    // 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 "'";
    }


    and advanced_search_result.tpl.php:
    PHP Code:
      $from_str "from ((" TABLE_PRODUCTS " p) left join " TABLE_MANUFACTURERS " m using(manufacturers_id), " TABLE_PRODUCTS_DESCRIPTION " pd) left join " TABLE_SPECIALS " s on p.products_id = s.products_id, " TABLE_CATEGORIES " c, " TABLE_PRODUCTS_TO_CATEGORIES " p2c"
    I think that covers it.

    I don't have a copy of v1.7 for testing so there might be one other file, but I am not 100% sure. If you get any errors remaining after the above fixes, post and we can help you out.

    One final note, you really should not be running v1.7 anymore (at least without patching several serious security flaws first!)
    Michael Sasek

    osCmax 2.5.4 is now available via auto-installation using Softaculous!

    Stay Up To Date with everything osCMax:
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  3. #3
    jpf
    Guest


    Default Re: fixing oscmax1.7 for mysql5

    If people can't PM me - leave a PUBLIC message or use my "contact us" on my main webpage (no the DEMO store).

  4. #4
    vgreff
    Guest


    Default Re: fixing oscmax1.7 for mysql5

    wow. Thank you very much for replying so quickly and right on. This is great and that's an easy fix.

    Ok, now you got me a little worried on the security aspect. How can I get the security patches or the info necessary to patch manually the holes? Upgrading at this point would be very time consuming and if possible I'd rather the fix the known security issues assuming there is not 100's of them. Would you be so kind as to point me in the right direction.

    Vince

  5. #5
    jpf
    Guest


    Default Re: fixing oscmax1.7 for mysql5

    ms2max 1.7 (now OSCMAX) is very old (3+ years) and no further delevlopment has been done.

    You could possably update to 2.0 but is not easy. Do you know if you use any other types of attribues othe than drop down options - like radio button, check boxes etc...?

  6. #6
    vgreff
    Guest


    Default Re: fixing oscmax1.7 for mysql5

    The only things I could find where in the account section.
    The only radio button I could find was for 'male female' selection.
    The only check boxes are for 'newsletter subscription' and 'product notification'

  7. #7
    jpf
    Guest


    Default Re: fixing oscmax1.7 for mysql5

    None of that is produce attribs...so it is possable to upgrade to OSCMAX 2.0 RC3 (or RC4-SVN) without too much problems.

Similar Threads

  1. fixing the AddTablePrefixedMS2.2.rc1 by belal affouri
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 04-25-2008, 07:10 AM
  2. fixing the AddTablePrefixedMS2.2.rc1 by belal affouri
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 04-25-2008, 02:30 AM
  3. Will oscMax work with php5 and MySQL5 ? (All featueres)
    By ryankan1 in forum osCmax v2 Installation issues
    Replies: 3
    Last Post: 10-16-2007, 06:31 PM
  4. oscmax1.7 to 2.0 uppgrade?
    By sergej in forum osCmax v2 Installation issues
    Replies: 3
    Last Post: 08-20-2007, 01:54 AM
  5. Fixing the create account page
    By a1net822 in forum osCmax v2 Customization/Mods
    Replies: 8
    Last Post: 05-27-2007, 08:52 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •