Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

mastergigi

Members
  • Content count

    4
  • Joined

  • Last visited

1 Follower

  • Guest

About mastergigi

  • Birthday 11/19/1978

Profile Information

  • Real Name
    Paweł
  • Gender
    Male
  • Location
    Warsaw
  1. mastergigi

    ASN Forum for osCommerce

    Hi, I know that the code is not perfect but this was only fast mod to fit original ASN Forum for osc needs. Recently I've worked a little bit on the script and made some improvements: + added forum categories + clean up of admin scripts (replacement of the mysql_fetch_row - use of this function isn't comfortable >_< ) + some register_globals fixes (now it should work with registers_globals off) + ultimate seo integration To do: + there are plenty places wher sql queries should be reduced + admin for forum categories I'll relase new version very soon... Stay tuned
  2. mastergigi

    [Contribution] Availability

    Hi, I have some comments to the contributions: 1. To do the code more universal you should replace in your queries name of the tabele (availability) to TABLE_AVAILABILITY. Ofcourse this constant should be defined in database_tables.php (both in admin and catalog includes) 2. There is small bug in the availability_options.php around line 37 switch ($action) { case 'insert': if ($HTTP_POST_VARS['availability_id'] == 'new') { $availability_query = tep_db_query("select max(availability_id) as avail_id from " . TABLE_AVAILABILITY . ""); } $availability = tep_db_fetch_array($availability_query); but it should be in that way: switch ($action) { case 'insert': if ($HTTP_POST_VARS['availability_id'] == 'new') { $availability_query = tep_db_query("select max(availability_id) as avail_id from " . TABLE_AVAILABILITY); $availability = tep_db_fetch_array($availability_query); } I think that my suggestions are right. Great contrib.
  3. mastergigi

    [CONTRIBUTION] Admin products paging

    Thanks for your notices :). I'll check the code and fix as soon as possible...
  4. mastergigi

    [CONTRIBUTION] Admin products paging

    Hi, there is another (nicer B) ) method of splitting product listing in the Admin Side Area, using standatd osCommerce splitPageResults class: Instructions: 1. backup, backup 2. execute following SQL command (for example in phpMyAdmin) # Important: # BEFORE DO THE SCRIPT KIDDY , please back-up your data!!!!! # AND V-E-R-I-F-Y IF THE 'CONFIGURATION_GROUP_ID' FOR MAXIMUM VALUES IS '3' # iF NOT FIND IT AND CHANGE THE VALUE HERE OR THE CONFIGURATION-LINK WILL APPARE IN OTHER MENU INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` ) VALUES ( '', 'Max products per page admin-side', 'MAX_PROD_ADMIN_SIDE', '30', 'Maximum number of products per page in administration panel', '3', NULL , '2003-11-10 14:54:12', '2003-11-10 14:54:12', NULL , NULL ); 3. open catalog/admin/categories.php a. find the following lines: (~807 on clean install) $products_count = 0; if (isset($HTTP_GET_VARS['search'])) { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name"); } else { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name"); } and replace with the following code: $products_count = 0; if (isset($HTTP_GET_VARS['search'])) { $prod_sql = "select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name"; } else { $prod_sql = "select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name"; } //BOF Admin product paging $prod_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_PROD_ADMIN_SIDE, $prod_sql, $prod_query_numrows); //EOF Admin product paging $products_query = tep_db_query($prod_sql); Notice for users having heavy modified osCommerces: --------------------------------------------------- idea is to replace the queries denoted $products_query = tep_db_query("modified query") only with SQL query string so $products_query = tep_db_query("modified query") becomes $prod_sql = "modified query". The query is executed later $products_query = tep_db_query($prod_sql); b. find the following code (~859 on clean install) $cPath_back = (tep_not_null($cPath_back)) ? 'cPath=' . $cPath_back . '&' : ''; ?> and replace it with the following code: $cPath_back = (tep_not_null($cPath_back)) ? 'cPath=' . $cPath_back . '&' : ''; ?> <? //BOF Admin product paging ?> <tr> <td colspan="3"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" valign="top"><?php echo $prod_split->display_count($prod_query_numrows, MAX_PROD_ADMIN_SIDE, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo $prod_split->display_links($prod_query_numrows, MAX_PROD_ADMIN_SIDE, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page'))); ?></td> </tr> </table> </td> </td> <? //EOF Admin product paging ?> 3. That's it!. Now on admin product/categories pages will be splitted according to the settings
×