Jump to content


  • Content count

  • Joined

  • Last visited

1 Follower

Profile Information

  1. I thought you wanted to check whether supported or not FOUND_ROWS in the mysql server version. if (strpos($this->sql_query, ' SQL_CALC_FOUND_ROWS ') !== false) { // new } else { //old } I don't understand why to go this way, when there is an easy way to add (or not) last parameter to the splitPageResults function call, and set this parameter 'true'. ... and no need to change all queries where is used pagination. just add last parameter 'true' to the function call, and contribution will do all work. .... = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id', 'page', true); If the user don't need new concept, all will work by oscommerce core code, nothing need to change, nothing to worry about. If the user needs new concept, he will add last parameter 'true'.
  2. @@burt Unfortunately, there is no easy way to do it. I was not able to find a way to detect if SQL has FOUND_ROWS. The only way, that I found, is to check the version of MySQL. FOUND_ROWS works since MySQL version 5.0.1. But, unfortunately, there is another problem: PHP Function, or mysql query to check the version of MySQL depends on the version of MySQL :) There are several ways to check the version: SELECT VERSION(); mysql_get_server_info(); mysqli_get_server_info(); SHOW VARIABLES LIKE '%version%' SELECT variable_value FROM information_schema.global_variables WHERE variable_name='version' Witch one to use? All of them (as I read) depends on the server version of MySQL (!!!). Some of them are depreciated, some of them are not supported in the newest versions. Of course, it is possible, after a heavy coding to detect the version of MySQL, but this is an extra time during pagination on the version check. Alternatively, I can add configuration key to give an option to the admin, which method to use. The default value will be “traditional method using count()”. + I can add admin side checking routine, to check that FOUND_ROWS supported on his server. Is this way acceptable ?
  3. Download is available here: http://addons.oscommerce.com/info/9378 See more details more details in the download package.
  4. This contribution was created to improve osCommerce pagination class performance by avoiding two slow queries, and using SQL_CALC_FOUND_ROWS technique for pagination. Using this contribution you can increase pagination process performance two times. some information: As you know (maybe you do not know), in the splitPageResults class the pagination process realised using two separate SQL-queries: - The first query "select count(...)", to count how many records will return the main query. - The second query - the query with " limit offset, number_of_rows_per_page", to select results and limit number of rows. Performance is good when the main query has no "where" clause, or "where" clause based on an indexed field. The performance problems occurs when products table become huge and there is a where clause with a search keywords. Performance has fallen dramatically. This occurs because the: 1. "select count(...)" query have to select all resulting records to calculate amount of records. It takes an extra time because of the "select count" query is slow when there is a "where clause" on the non indexed fields. 2. Then, the second query will do the same job - select records using limit. Two queries does the same job twise. As a result, we spend double time. (for example, in my case, it spends 4.4 seconds on the "select count(...)" query, and then it spends 4.7 seconds on the second query. Both queries take 9.1 seconds). SQL_CALC_FOUND_ROWS technique allows to decrease this double time (in my case, it decreased to 4.4 seconds). This technique is well known, and is realised in this contribution. Compatibility: I'm using this contribution on the osCommerce v2.3
  5. Hi spidometrs, All about this is in the installation manual. There is an empty folder "content_templates" in the package catalog/includes/modules/ that should be uploaded to the server.
  6. hava.ge

    Header Tags SEO

    May be, I have not set some setting in php.ini, because of when I use this way echo "<a name=\"\$header_tags_array['title']\"></a>"; I have variable name in the html output: <a name="$header_tags_array['title']">... not the variable value - htc title of the product.
  7. hava.ge

    Header Tags SEO

    File - product_info.php FIND (around line 24): require(DIR_WS_INCLUDES . 'template_top.php'); ADD BENEATH: /*** Begin Header Tags SEO ***/ echo "<a name=\"\$header_tags_array['title']\"></a>"; /*** End Header Tags SEO ***/ There is an error in the addon code, this line will not work correctly: echo "<a name=\"\$header_tags_array['title']\"></a>"; it should be echo "<a name=\"" . $header_tags_array['title'] . "\"></a>"; am I wrong?
  8. Download is available here: http://addons.oscommerce.com/info/9288 See more details more details in the download package.
  9. This contribution allows you to create html templates where you insert names of the product fields, instead of inserting values of the product fields. Content Templates Manager finds field names in the html of the template and replaces them by corresponding values of the product. This allows you to edit fields values of each product on the product administration page in the traditional manner, like you are editing product name, product description etc., instead of searching product data in the html code and pasting there a corresponding values of each product , manually. As a result, you will have dynamic content on the page. You can change html code of the Template when you want and how you want. You can create different Templates for the different groups and types of the product. You will not have to edit php script, or edit each product description for changing html of each product. You will change the Template in one place only. All field values of the product will find their place in the Html code automatically. Content Templates Manager will do this. You will be able to use any existing fields of the product, or add new fields and use them. You will be able to repeat fields in the html of the template how many times you want and place them where you want in the html. Having done this in the template in one place, changes will effect in all products which are linked to this template. This contribution allows you - to create Html templates like the tables, multipage tabs, specification multilayer tabs, beautiful blocks with products data - attributes, specifications, description, etc. After changing template, or creating new template you will not have to edit each product description to make changes there. You will change only template, changes will effect every product which are linked to this template - it allows you to create additional fields of the products, associated with a template or with a several templates, then Content Templates Manager automatically inserts fields values in the Html markup of the template. - allows you to link the product, or group of the products with the template and display the Template on the page. - to create, edit, copy, remove template fields, which actually becomes a field of each product, if product is linked to the template. A little more about this: For instance, we have product some page like this: Let say, the text is the same for the group of the products, but there are field values in the text (I put them in the quotes) which are different for each product. let say also, there are about a thousand of product, which have this text saved in their description field, but with the corresponding to the product values in the text. Could you imagine what happens if we decide to change this text for this group of products? We will have to change the description fields values all of the thousand products, in order to change values in the text and replace old saved text with a new text. What would be, if we are using the Content Templates Manager, then we do not have to touch the products fields in general. We will need to change only the Template where we have saved the text, we will change it in one place and all the fields will find their place in the changed text. Changes will take effect for all products that are linked to the text template. "Lorem ipsum dolor sit amet, "2014-March" consectetur adipiscing elit, sed "9.4 mm" do "146.4mm" eiusmod tempor incididunt "width : 5.76" ut labore et dolore magna aliqua. Ut "1920 pixels" enim ad "32 GB" minim veniam, quis nostrud exercitation ullamco "5 MP" laboris nisi ut aliquip ex ea commodo "8Kw" consequat. Duis aute irure dolor "5.7 px" in reprehenderit in voluptate "0.48 X 0.56" velit esse cillum dolore eu fugiat nulla pariatur. Excepteur "12.3 M2" sint occaecat cupidatat non proident." Another example: Let say we have a large table for products specification, with a large number of rows and cells for each product. Tables looks quite well on the page, but it is very difficult to search for the data, that are corresponding to the product, to fill or edit them in the Html code of the table. "<table width="100%" style="color:#000;border:1px solid #83addb;background-color:#fff;" align="center" cellpadding="4" cellspacing="1"> <tr style="background-color:#d2e8ff;"> <td style="text-align:center;" width="36%">8.4 Kw</td><td style="text-align: center;" width="22%">800 px</td></tr> <tr> <td style="text-align: center;">44 mm</td> <td style="text-align: center;">32 GB</td></tr> <tr> <td style="text-align: center;">freq</td><td style="text-align: center;">400</td></tr> <tr> <td style="text-align: center;">band</td><td style="text-align: center;">56.7</td></tr> <tr> <td style="text-align: center;">92</td><td style="text-align: center;">24</td></tr>" Can you see where the data is and where Html is in this example code of the table?- Yes, you can, but it is very hard to work with this. Is it easy populating product data in this code? This contribution can do this job very easy. In the other words, - You will be able to create and add any amount of additional fields to the products, by creating fields in the templates and linking products to this templates. - These fields are easy to edit or fill, because they are visible for editing in the product administration panel, displayed normally, in the human friendly form. - Then contribution automatically uses your entered fields values and inserts them to the appropriate place on the products page. - The insertion of the fields values in the Templates will be done dynamically, before the page will be shown, content are not stored statically. - This makes Content Templates Manager flexible and allows you to modify existing templates appearance and all changes will be applied to all related products without worrying about to iterate through each product and change their markup. - There is an "empty fields" control ability, you have opportunity to show products empty fields as empty, or do not show some part of the Html markup in the template (for example, not show table row), if corresponding product field value is empty. - You can use in your templates already existing product fields (like products name, products description, price etc.) contribution automatically inserts them where you specify in the template, on the page. - You can repeat the same field in any place in the same template. - You are able to share fields between the templates, and editing the field value in one place, will have an effect in all templates, where this shared field was copied. - You are able to copy, duplicate, edit, delete fields. - Fields are multilanguage, or you are able set it to have one value for all languages that you use. - You are able to create, edit, save, delete Templates Html code from the administration panel of the templates. - You are able to add css styles to the template, edit and save style from the administration panel of the templates. - You can add simple java script to the template, edit and save script from the administration panel of the templates. - ... and tou are able to do many other things from the administration panel of the templates. Compatibility: I'm using this contribution on the osCommerce v2.3 Other versions not tested yet. But should work in many other versions, because the contribution do not changes any other tables in the database and uses only own tables, and the contribution uses very few from the functions of the core script.
  10. I just found it! It's a great job, You have written your own CMS :) thank you.