Jump to content

acidvertigo

Members
  • Content count

    275
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by acidvertigo


  1. If this is an old contrib i think that inside the addon file  you should remove these lines on top

    <!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>
    <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
    <script language="javascript" src="includes/general.js"></script>
    <script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
    <link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
    </head>
    <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
    <!-- header //-->
    <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
    <!-- header_eof //-->
    

    and remove these lines

    <!-- left_navigation //-->
    <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
    <!-- left_navigation_eof //-->
    

    and remove also

    <!-- footer //-->
    <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
    <!-- footer_eof //-->
    
    

    then add after: require('includes/application_top.php');

    require(DIR_WS_INCLUDES . 'template_top.php');

    and add to the end before: require(DIR_WS_INCLUDES . 'application_bottom.php');

    
      require(DIR_WS_INCLUDES . 'template_bottom.php');
    
    

  2. Hello,

     

    I can finally use the multilanguage support for index.php and product_info pages.

     

    So /catalog/en/index.php for language works.

     

    However for contact_us.php, privacy.php and conditions.php apache says "no input file specified" when the language directory is appendded to page like /catalog/contact_us.php/en or /catalog/conditions.php/en

     

    Anoyne can help me on this?

     

    I realized that i cannot use the multilanguage function 'cause my host don't allow followsymlinks on .htaccess.

     

    So i turned the multilanguage support off.

     

    However on my shop i have two languages: Italian (default) language and english (secondary).

     

    I'm using Usu5 URI rewrite method and does it works well.

     

    The only thing that make me mad and cannot understand why, is that if i spider with google every page in the secondary language, it gets a 301 redirect to my primary language. If a go on the same page in secondary language with a browser i get 200 OK status instead. I have the "prevent spider session" , "recreate session" and "force cookie usage" on ON.

     

    My question is what changes between a googlebot request and a browser request on USU5? Why spiders gets 301 redirect and browser get 200 ok status? Anyone can reproduce it?

     

    p.s. I'm sorry that is a duplicate post. but after 150 pages of posts on this forum seems that i'm the only that have this issue.


  3. Hello,

     

    I can finally use the multilanguage support for index.php and product_info pages.

     

    So /catalog/en/index.php for language works.

     

    However for contact_us.php, privacy.php and conditions.php apache says "no input file specified" when the language directory is appendded to page like /catalog/contact_us.php/en or /catalog/conditions.php/en

     

    Anoyne can help me on this?


  4. I installed the version osc 2.3.x

     

    In the first Column on the left I see this in the headline:

    TEXT_LINE_280_12371

     

     

    The database is being read as:

     

    after that everything seems fine in the left column of the report.

    I think it has something to do with the line, that is not displaying correctly on my site, but I'm not sure:

    $msg .= TEXT_LINE_280_1. $count_db_list. '</br>' .TEXT_LINE_280_2. '<i>' . $sql . '</i></br>' . ($descip_check ? TEXT_LINE_280_3 : '');

     

    Anyone also experiencing this problem and maybe has a solution for it?

     

    Have you installed the language files?


  5. Hello,

     

    i upgraded the sqlite cache system to sqlite3. From my tests it works also on php 5.4.

     

    Here the changes:

     

    On ultimate_seo_urls/cache_system/sqlite.php

     

    find:

     

    
    protected static function createDatabase() {
      if ( !is_readable( self::$sqlite_db_file ) ) {
    	self::$db = new SQLiteDatabase( self::$sqlite_db_file, 0666, $error )
    	or trigger_error( 'Failed: ' . $error, E_USER_WARNING );
    	self::createTables();
      } else {
    	self::$db = new SQLiteDatabase( self::$sqlite_db_file, 0666, $error )
    	or trigger_error( 'Failed: ' . $error, E_USER_WARNING );
      }
    }
    

     

    change to:

     

    protected static function createDatabase() {
      if ( !is_readable( self::$sqlite_db_file ) ) {
    	self::$db = new SQLite3( self::$sqlite_db_file, 0666, $error )
    	or trigger_error( 'Failed: ' . $error, E_USER_WARNING );
    	self::createTables();
      } else {
    	self::$db = new SQLite3( self::$sqlite_db_file, 0666, $error )
    	or trigger_error( 'Failed: ' . $error, E_USER_WARNING );
      }
    }
    

     

    and around line 128 find:

     

    
    $replacements = array( sqlite_escape_string( self::$cache_name ), sqlite_escape_string( $rawdata ), date( "Y-m-d H:i:s" ) );
    	  $query = str_replace( $targets, $replacements, $this->insert_query );
    	  self::$db->query( $query );
    	}
    

     

    change to:

     

    $replacements = array( self::$db->escapeString( self::$cache_name ), self::$db->escapeString( $rawdata ), date( "Y-m-d H:i:s" ) );
    	  $query = str_replace( $targets, $replacements, $this->insert_query );
    	  self::$db->exec( $query );
    	}
    

     

    around line 168 find:

     

    self::$db->query( 'DELETE FROM usu_cache' );
    self::$db->query( 'VACUUM usu_cache' );
    

     

    change to:

     

    self::$db->exec( 'DELETE FROM usu_cache' );
    	self::$db->exec( 'VACUUM usu_cache' );
    

     

    at the end find:

     

    self::$db->query( $create_query );
    }
     } // end class
    

     

    change to:

     

    
    self::$db->exec( $create_query );
       }
     } // end class
    

     

     

    and on ultimate_seo_urls/main/usu5.php

     

    find on line 308:

     

    $row = $result->fetch();
    

     

    Change to:

     

    $row = $result->fetchArray();
    

     

    Hope it can help


  6. osCommerce apparently allows categories id's to be added to no end in the url. I have around 1,000 categories 3 levels deep and around 20,000 products. I've had page load times in excess of 5 minutes, which seem to be caused by the caching system (speeds increased after cache has been deleted). After more insight from problems every 3 months at the start, and more frequent as time went on I've came to notice an interesting trend. For some reason the web crawlers just start adding categories such as: 22_34_78_79_99 and so on! I now have around 90k pages indexed at Google, LOL. I'm going to have a lot of pages not found for quite awhile to come. As long as the last two are valid osCommerce category id's the site accepts the entry and displays the last category id.

     

    Many of the cached entries had category depths as high as 5 levels deep or more?

     

    This becomes a serious issue in USU5 because of the size of the cache (seek times in sqlite are enormous, file seek times are impossible, I never tried mysql caching), with google indexing around 90k pages and crawling an amazing amount of pages and continually adding random add-on categories. I was desperate and made a change to the tep_parse_category_path function in general.php, this fixed the caching problem from osCommerce's cache, but did nothing for the problem with caching in USU5. In order to stop USU5 from caching these invalid url's, I tried to modify the index.php in the page modules directory and couldn't figure out how. So instead I was able to modify the hrefLink function in usu5.php file in the main directory like this:

    public function hrefLink( $page, $parameters, $connection, $add_session_id, $search_engine_safe ) {
     // Badly coded shops often pass in odd characters
    
     if (sizeof($parameters)>2){
      $parameters = array_slice ($parameters, -3);	
      return osc_href_link( $page, $parameters, $connection, $add_session_id, $search_engine_safe );
     }
    

     

    I'm not sure if this is the most elegant way to fix this problem or if there is a better way!

     

    -Bill

     

    I have the same issue, google apparently adds or also remove the category number. For example category with 28_378_451 becomes 378_451 in my case generating a lot of duplicate content (server header returns 200 status).


  7. To explain better:

     

    www.example.com/catalog/nome-prodotto-p-20.html (default language)

     

    returns:

     

    TTP/1.1 200 OK =>

    Date => Mon, 08 Aug 2011 09:02:06 GMT

    Server => Apache/2.2

    X-Powered-By => PHP/5.3.6

    Expires => Thu, 19 Nov 1981 08:52:00 GMT

    Cache-Control => no-store, no-cache, must-revalidate, post-check=0, pre-check=0

    Pragma => no-cache

    Vary => Accept-Encoding

    Connection => close

    Content-Type => text/html; charset=iso-8859-1

     

    www.example.com/catalog/product-name-p-20.html (english)

     

    returns:

     

    HTTP/1.1 301 Moved Permanently =>

    Date => Mon, 08 Aug 2011 08:59:13 GMT

    Server => Apache/2.2

    X-Powered-By => PHP/5.3.6

    Expires => Thu, 19 Nov 1981 08:52:00 GMT

    Cache-Control => no-store, no-cache, must-revalidate, post-check=0, pre-check=0

    Pragma => no-cache

    Set-Cookie => osCsid=qjn1mpd1jpn41ugsr9e6b5tkg6; path=/catalog/; domain=www.nagrit.com

    Location => www.example.com/catalog/nome-prodotto-p-20.html?osCsid=qjn1mpd1jpn41ugsr9e6b5

    Vary => Accept-Encoding

    Connection => close

    Content-Type => text/html

     

    The browser is not redirected it shows the right page www.example.com/catalog/product-name-p-20.html, in firebug it shows status code 200, but googlebot and the other boot will be redirected to the page in the default language.

     

    It's possible to change this behaviour?


  8. Just to share a little trick to send the canonical link also from the server headers

     

    in catalog/includes/modules/kiss_meta_tags/classes/kiss_meta_tags_class.php

     

    find:

     

     private function canonical() {
         if ( ( KISSMT_CANONICAL_ON == 'true' ) && ( false !== $this->canonical ) ) {
           if ( $this->canonical == 'noindex' ) {
             echo '<meta name="robots" content="noindex, follow"' . $this->html_end . PHP_EOL;;
           } else {
    
                   echo '<link rel="canonical" href="' . $this->canonical . '"' . $this->html_end . PHP_EOL;;
    
    
           }
         }
    
    

     

    change to:

     

     private function canonical() {
         if ( ( KISSMT_CANONICAL_ON == 'true' ) && ( false !== $this->canonical ) ) {
           if ( $this->canonical == 'noindex' ) {
             echo '<meta name="robots" content="noindex, follow"' . $this->html_end . PHP_EOL;;
           } else {
    
               header("Link: <$this->canonical>; rel=\"canonical\"");
             echo '<link rel="canonical" href="' . $this->canonical . '"' . $this->html_end . PHP_EOL;;
    
    
           }
         }
    

     

    The server will send the canonical linnk in the HTTP header: Link: <http://www.example.com/downloads/white-paper.pdf>; rel="canonical"


  9. Hello i'm using USUS5 pro but cannot use it in multilanguage mode because i cannot change some configuration on my server (external hosting)

     

    I've noticed that i get a 301 redirect (in non multilanguage mode) on pages in other languages, for example:

     

     

    http://www.example.com/catalog/product-name-p-10.html (english) redirects 301 to http://www.example.com/catalog/nome-prodotto-p-10.html (italian default language).

     

    The reason is this code in /catalog/includes/modules/ultimate_seo_urls5/main/validator.php

     

    //  If the incoming uri and the newly created uri do not match then we need to 301 redirect to the new.
         if ( Usu_Main::i()->getVar( 'request_compare_in' ) != Usu_Main::i()->getVar( 'request_compare_new' ) ) {
           $this->redirect( $new_url );
         }
       } // end method
    
    

     

    if i disable it, I get 200 status code for all the pages in english, but if someone type a invalid url as for example http://www.example.com/catalog/no-p-10.html the scripts does not redirect and return 200 status code and duplicate content.

     

    Can someone help me to chenge the code above to return 200 status code on pages in other languages without lost the useful 301 redirect on duplicate content?


  10. I believe your server settings do not allow path based URIs.

     

    A good test is the non rewrite URI strategy producing a 404 not found, also if you try and access your site like ..

     

    www.mysite.com/index.php/test/ and it produces a 404.

     

    I believe this is due to the apache setting AcceptPathInfo.

     

    You can try ( in root .htaccess )

     

    AcceptPathInfo On

     

    If that fails have a word with your hosts.

     

    Hope that helps.

    I believe your server settings do not allow path based URIs.

     

    A good test is the non rewrite URI strategy producing a 404 not found, also if you try and access your site like ..

     

    www.mysite.com/index.php/test/ and it produces a 404.

     

    I believe this is due to the apache setting AcceptPathInfo.

     

    You can try ( in root .htaccess )

     

    AcceptPathInfo On

     

    If that fails have a word with your hosts.

     

    Hope that helps.

     

    I put AcceptPathInfo On on my .htaccess in my root directory and does nothing

     

     

    www.mysite.com/index.php/test produces 404 error

     

    One strange behaviour is that if i write http://www.mysite.com/catalog/index.php/'>http://www.mysite.com/catalog/index.php/ or www.mysite.com/catalog/products_new.php/ it redirects me to http://www.mysite.com/


  11. Hello I installed the Ultimate Seo Urls 5 PRO contribution on 2.3.1 oscommerce

     

    On my server works only in URI format rewrite and for me is fine. It works well

     

    However when i enable the multilanguage support the urls:

     

    http://www.mysite.com/catalog/en

    http://www.mysite.com/catalog/products_new.php/en

    http://www.mysite.com/catalog/specials.php/en

     

    give me 404 error

     

    English is the second language.

     

    I tried also with the additional upload bm_languages.php but it redirects in every page to http://www.mysite.com/catalog/index.php

     

    this is my htaccess file

     

    # If you are getting errors you may need to comment this out like ..
    # Options +FollowSymLinks
    # Options +SymLinksIfOwnerMatch
    
    # <IfModule mod_rewrite.c>
    
    RewriteEngine On
    
     # RewriteBase instructions
     # Change RewriteBase dependent on how your shop is accessed as below.
     # http://www.mysite.com = RewriteBase /
     RewriteBase /catalog
     # http://www.mysite.com/catalog/shop/ = RewriteBase /catalog/shop/
    
     # Change RewriteBase using the instructions above  
    
    
     RewriteRule ^([a-z0-9-/]+)-p-([0-9]+).html$ product_info.php [NC,L,QSA]
     RewriteRule ^([a-z0-9-/]+)-c-([0-9_]+).html$ index.php [NC,L,QSA]
     RewriteRule ^([a-z0-9-/]+)-m-([0-9]+).html$ index.php [NC,L,QSA]
    
     RewriteRule ^([a-z0-9-/]+)-pi-([0-9]+).html$ popup_image.php [NC,L,QSA]
     RewriteRule ^([a-z0-9-/]+)-pr-([0-9]+).html$ product_reviews.php [NC,L,QSA]
     RewriteRule ^([a-z0-9-/]+)-pri-([0-9]+).html$ product_reviews_info.php [NC,L,QSA]
     # Articles contribution
     RewriteRule ^([a-z0-9-/]+)-t-([0-9_]+).html$ articles.php [NC,L,QSA]
     RewriteRule ^([a-z0-9-/]+)-au-([0-9]+).html$ articles.php [NC,L,QSA]
     RewriteRule ^([a-z0-9-/]+)-a-([0-9]+).html$ article_info.php [NC,L,QSA]
     # Information pages
     RewriteRule ^([a-z0-9-/]+)-i-([0-9]+).html$ information.php [NC,L,QSA]
     # Links contribution
     RewriteRule ^([a-z0-9-/]+)-links-([0-9_]+).html$ links.php [NC,L,QSA]
     # Newsdesk contribution
     RewriteRule ^([a-z0-9-/]+)-n-([0-9]+).html$ newsdesk_info.php [NC,L,QSA]
     RewriteRule ^([a-z0-9-/]+)-nc-([0-9]+).html$ newsdesk_index.php [NC,L,QSA]
     RewriteRule ^([a-z0-9-/]+)-nri-([0-9]+).html$ newsdesk_reviews_info.php [NC,L,QSA]
     RewriteRule ^([a-z0-9-/]+)-nra-([0-9]+).html$ newsdesk_reviews_article.php [NC,L,QSA]
    
    RewriteRule ^([a-z0-9-/]+)-n-([0-9]+).html$ newsdesk_info.php [NC,L,QSA]
    
    # </IfModule>
    

     

    disabled +FollowSymLinks and +SymLinksIfOwnerMatch because my server give me 500 error


  12. I have modified browse_categories.php to the following and it works now on 2.3.1.

     

    Let me know if it works also for you guys:

     

    <?php
    /*
    ###############################################################################
    #-----------------------------------------------------------------------------#
    # Company:  DoWeDo-IT                                                         #
    # Project:  Browse by Categories                                              #
    # Filename: browse_categories.php                                             #
    # Author:   José Carlos Monteiro                                              #
    #           mailto:Jose.Monteiro@DoWeDo-IT.com          Mob: +351.91.776-5726 #
    #-----------------------------------------------------------------------------#
    # Description: This script file is a module for osCommerce 2.2 MS1/MS2.       #
    #   It is used to display a content box with current level categories and     #
    # their sub-categories. The current level categories can be shown as images   #
    # or as text, while sub-categories when shown are always as text.             #
    #   The settings are configured through the osCommerce Administration, under  #
    # Configuration section.                                                      #
    #                                                                             #
    # Usage: Include this module from the main page.                              #
    # Parameters:                                                                 #
    #   BRWCAT_ICON_MODE                                                          #
    #   BRWCAT_SUBCAT_MODE                                                        #
    #   BRWCAT_ICONS_PER_ROW                                                      #
    #   BRWCAT_SUBCAT_BULLET                                                      #
    #   BRWCAT_SUBCAT_COUNTS                                                      #
    #   BRWCAT_NAME_CASE                                                          #
    #                                                                             #
    # To-Do:                                                                      #
    #   Apply UL and LI elements to Sub Category Links, using CSS styles.         #
    #                                                                             #
    #-----------------------------------------------------------------------------#
    # History:                                                                    #
    #  VS     DATE            AUTHOR        SUMMARY                               #
    # 1.00 12/Nov/2003 José Carlos Monteiro Initial Source Code.                  #
    # 2.00 19/Jan/2004 José Carlos Monteiro Make it 2.2-MS2 compatible.           #
    # 2.10 21/Jan/2004 José Carlos Monteiro Add GPL License File.                 #
    #                                       Add GPL copying permission statement. #
    #                                       Add POSITION_SUB_CATEGORIES.          #
    #                                       Replace hard-coded table with         #
    #                                         odd and even rows or columns.       #
    # 2.20 21/Jan/2004 José Carlos Monteiro Remove original sub category icons.   #
    # 2.31 27/Jan/2004 Didier Debbaut (DDB) Add sub categories products count.    #
    # 2.40 29/Jan/2004 José Carlos Monteiro Add new settings to configuration.    #
    #                                       Use BULLET_BROWSE_SUB_CATEGORIES.     #
    #                                       Use DISPLAY_SUB_CATEGORIES_COUNT.     #
    #                                       Show blank table cell when empty sub. #
    #                                       Browse to parent category link.       #
    #                                       Set correct breadcrum trail cPath.    #
    #                                       Clear Sub-Categories Link.            #
    #                                       Replace $cPath with $cPath_cur.       #
    # 2.50 03/Fev/2004 José Carlos Monteiro Use Uniform variables Naming Scheme.  #
    #                                       Add BRWCAT_NAME_CASE.                 #
    #                                       Choose Image with or without caption. #
    #      08/Fev/2004 azer                 Fix blank cell, image wo caption bugs.#
    #      08/Fev/2004 José Carlos Monteiro Use Language Dependant files.         #
    # 2.60 28/Apr/2004 José Carlos Monteiro Remove Version from Comments.         #
    #                                       Handle Non-Leaf with Products.        #
    #                                       Cleanup Bug/Feature Tracking Comments.#
    #                                       Moved Language files to modules/.     #
    #                                                                             #
    #-----------------------------------------------------------------------------#
    # This file is part of Browse by Categories.                                  #
    #                                                                             #
    # Browse by Categories is free software; you can redistribute it and/or modify#
    # it under the terms of the GNU General Public License as published by        #
    # the Free Software Foundation; either version 2 of the License, or any       #
    # later version.                                                              #
    #                                                                             #
    # Browse by Categories is distributed in the hope that it will be useful,     #
    # but WITHOUT ANY WARRANTY; without even the implied warranty of              #
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
    # GNU General Public License for more details.                                #
    #                                                                             #
    # You should have received a copy of the GNU General Public License           #
    # along with Browse by Categories; if not, write to the Free Software         #
    # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   #
    #-----------------------------------------------------------------------------#
    ###############################################################################
    */
    
    /*
    *tab-width=2
    *indent=2
    *width=132
    */
    ?>
    
    <!-- browse_categories !-->
    <?php
     //DWD GOTCHA: /modules/ is hardcoded, but should be the same value as the value in configuration.php
     require(DIR_WS_LANGUAGES . $language . '/modules/' . FILENAME_BROWSE_CATEGORIES);
    
     //DWD Comment: Select Heading Text for Content Box based on current category.
     if ( (!isset($browse_category_id)) || ($browse_category_id == '0') ) {
       $browse_category_id = 0;
       $browse_category_heading = BOX_HEADING_BROWSE_TOP_CATEGORIES;
     } else {
       $browse_category_heading = BOX_HEADING_BROWSE_SUB_CATEGORIES;
     } // Checks to see if current category level is top or sub.
    
     //DWD Comment: Select all categories of current level.
     $categories_query = "select c.categories_id, cd.categories_name, c.categories_image
                            from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
                           where c.categories_id = cd.categories_id
                             and cd.language_id ='" . $languages_id . "'
                             and c.parent_id = '" . $browse_category_id . "'
                           order by c.sort_order, cd.categories_name";
     $arr_current_categories_query = tep_db_query($categories_query);
    
     //DWD Comment: Only show content box if there are categories at this level.
     if ((tep_db_num_rows($arr_current_categories_query) > 0) and (BRWCAT_ICON_MODE != 'off')) {
    
       //DWD Comment: Select parent category of current level.
       $parent_query = "select c.categories_id, cd.categories_name, c.parent_id
                          from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
                         where c.parent_id = cd.categories_id
                           and cd.language_id ='" . $languages_id . "'
                           and c.categories_id = '" . $browse_category_id . "'";
       $arr_parent_category_query = tep_db_query($parent_query);
       $parent_category = tep_db_fetch_array($arr_parent_category_query);
    
       if ($parent_category['parent_id'] > 0) {
         //DWD Comment: Browse to parent category link from 3rd level categories to 2nd level category.
         $content_box_text_parent = '<a href="' . tep_href_link(FILENAME_DEFAULT . '?cPath=' . $parent_category['parent_id'], '', 'NONSSL') . '">' . TEXT_BROWSE_PARENT_CATEGORY . $parent_category['categories_name'] . '</a>';
       } else if ($browse_category_id > 0) {
         //DWD Comment: Browse to top-level category link.
         $content_box_text_parent = '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . TEXT_BROWSE_TOP_CATEGORY . '</a>';
       } else {
         // Top Category Level is 0, don't print back text.
       }
    
       //DWD Comment: Create Content Box with Heading Text.
       $content_box_contents = array();
       $content_box_contents[] = array('align' => 'left',
                                       'text'  => $browse_category_heading);
    
    
       //DWD Comment: Display Browse to ... Link.
       $content_box_contents = array();
       $content_box_contents[][] = array('align'  => 'left',
                                         'params' => 'class="smallText" valign="top" colspan=2"',
                                         'text'   => '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_cur, 'NONSSL') . '"><b>' . $current_category_name . '</b></a>');
    
    
    ?>
     <div class="ui-widget infoBoxContainer">
       <div class="ui-widget-header ui-corner-top infoBoxHeading">
         <span><?php echo $browse_category_heading; ?></span>
       </div>
     </div>
    <?php
    
    
    
    
       //DWD Comment: Initialize Content Box Row/Column Variables and Loop through all current categories.
       $row = 1;
       $col = 0;
       while ($current_categories = tep_db_fetch_array($arr_current_categories_query)) {
         $cPath_cur =  tep_get_path($current_categories['categories_id']);
    
         //DWD Comment: Apply Category Name Case setting to current category name.
         if (BRWCAT_NAME_CASE == 'same') {
           $current_category_name = $current_categories['categories_name'];
         } else {
           if (BRWCAT_NAME_CASE == 'upper') {
             $current_category_name = strtoupper($current_categories['categories_name']);
           } else if (BRWCAT_NAME_CASE == 'lower') {
             $current_category_name = strtolower($current_categories['categories_name']);
           } else if (BRWCAT_NAME_CASE == 'title') {
             $current_category_name = ucwords($current_categories['categories_name']);
           } else {
             //DWD Comment: Unknown Category Name Case.
           }
         }
    
         //DWD Comment: Select all Sub-Categories of Top-Category (Parent ID equal to Category ID).
         if (BRWCAT_SUBCAT_MODE != 'off') {
           //DWD Comment: Sort rows by Sort Order and then Name.
           $sub_query = "select c.categories_id, cd.categories_name, c.categories_image
                           from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
                          where c.categories_id = cd.categories_id
                            and cd.language_id='" . $languages_id . "'
                            and c.parent_id ='" . $current_categories['categories_id'] . "'
                          order by c.sort_order, cd.categories_name";
           $arr_sub_categories_query = tep_db_query($sub_query);
    
           //DWD Comment: Split Sub-Category Mode in bottom or right/valign.
           $arr_sub_category_mode = explode(' ', BRWCAT_SUBCAT_MODE);
    
           //DWD Comment: Build Sub Category Links.
           $sub_category_links = '';
           if (tep_db_num_rows($arr_sub_categories_query) > 0) {
             $sub_category_links .= '<ul class="BrowseBy">';
             while ($sub_categories = tep_db_fetch_array($arr_sub_categories_query)) {
               $cPath_new_sub = $cPath_cur . '_' . $sub_categories['categories_id'];
               $sub_category_links .= '<li class="BrowseBy">' . BRWCAT_SUBCAT_BULLET .
                                      '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '">' .
                                      $sub_categories['categories_name'] . '</a>';
    
               //DWD Comment: Display Sub-Category Product Count, if enabled.
               if (BRWCAT_SUBCAT_COUNTS != '') {
                 $products_in_category = tep_count_products_in_category($sub_categories['categories_id']);
                 if ($products_in_category > 0) {
                   $sub_category_links .= sprintf(' ' . BRWCAT_SUBCAT_COUNTS, $products_in_category);
                 }
               }
    
               $sub_category_links .= '';
    
             } // While Loop: Fetch all Query Rows. Each row is a Sub Category of current level Category.
             $sub_category_links .= '</ul>';
           } // Middle If: Build Sub Category Links if they exist.
         } // Outer If: Build Sub Category Links if enabled by Configuration Settings.
    
         //DWD Comment: Set Content Box Table Width depending on Sub-Category Link Mode.
         if ($arr_sub_category_mode[0] == 'right') {
           $table_cell_width = (100 / BRWCAT_ICONS_PER_ROW / 2) . '%';
         } else {
           $table_cell_width = (100 / BRWCAT_ICONS_PER_ROW) . '%';
         }
    
         //DWD Comment: Fill Content Box Array with Category Icon.
         //DWD Comment: BRWCAT_ICON_MODE is set on Control Panel: Configuration->My Store.
         //DWD Comment: If Mode is set as image only then the category name will be displayed on top of sub-category links.
         if (BRWCAT_ICON_MODE == 'text') {
           $content_box_contents[$row][$col] = array('align'  => 'center',
                                                     'params' => 'class="smallText" valign="top" width="' . $table_cell_width . '"',
                                                     'text'   => '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_cur, 'NONSSL') . '"><b>' .
                                                                 $current_category_name . '</b></a>');
         } else if (BRWCAT_ICON_MODE == 'image only') {
           $content_box_contents[$row][$col] = array('align'  => 'center',
                                                     'params' => 'class="smallText" valign="top" width="' . $table_cell_width . '"',
                                                     'text'   => '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_cur, 'NONSSL') . '">' .
                                                                 tep_image(DIR_WS_IMAGES . $current_categories['categories_image'],
                                                                           $current_category_name,
                                                                           SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) .
                                                                 '</a>');
           $sub_category_links = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_cur, 'NONSSL') . '"><b>' .
                                 $current_category_name . '</b></a><br>' . $sub_category_links;
         } else if (BRWCAT_ICON_MODE == 'image with caption') {
           $content_box_contents[$row][$col] = array('align'  => 'center',
                                                     'params' => 'class="smallText" valign="top" width="' . $table_cell_width . '"',
                                                     'text'   => '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_cur, 'NONSSL') . '">' .
                                                                 tep_image(DIR_WS_IMAGES . $current_categories['categories_image'],
                                                                           $current_category_name,
                                                                           SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) .
                                                                 '</a><br><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_cur, 'NONSSL') . '"><b>' .
                                                                 $current_category_name . '</b></a>');
         } else {
           // Unknown Browse by Categories Content Box Type.
         } // Checks Type of Content Box for Browse by Categories.
    
         //DWD Comment: Fill Content Box Array with Sub-Category Links.
         if ($arr_sub_category_mode[0] == 'right') {
           $content_box_contents[$row][$col + 1] = array('align'  => 'left',
                                                         'params' => 'class="smallText" valign="' . $arr_sub_category_mode[1] . '" width="' . $table_cell_width . '"',
                                                         'text'   => ($sub_category_links == '' && BRWCAT_SUBCAT_MODE != 'off') ? ' ' : $sub_category_links);
           $col = $col + 2;
           if ($col >= BRWCAT_ICONS_PER_ROW * 2) {
             $col = 0;
             $row++;
           }
         } else {
           $content_box_contents[$row + 1][$col] = array('align'  => 'left',
                                                         'params' => 'class="smallText" valign="top" width="' . $table_cell_width . '"',
                                                         'text'   => ($sub_category_links == '' && BRWCAT_SUBCAT_MODE != 'off') ? ' ' : $sub_category_links);
           $col++;
           if ($col >= BRWCAT_ICONS_PER_ROW) {
             $col = 0;
             $row = $row + 2;
           }
         } // Inner If: Set Content Box contents based on Sub Categories Position
       } // While Loop: Grab all current level Categories.
    
    
    
    
       new contentBox($content_box_contents);
    
    
    
    
     } // Check if there are categories at this level.
    ?>
    <!-- browse_categories_eof !-->
    


  13. Sounds interesting.

     

    I got the categories name to show in the searchresults dropdown easily, the only issue is to not have it in the search box when it is selected? Any ideas?

     

    $fetch = tep_db_query("SELECT
                          p.products_id,
                          pd.products_name,
                          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($_GET['term']) . "%'
                          ORDER BY
                          pd.products_name
                          LIMIT 0, 10");
    
    
    while ($row = mysql_fetch_assoc($fetch)) { 
     array_push($return_arr, sprintf(SEARCH_RESULT, $row['products_name'], tep_get_category_name($row['categories_id'])));
    }
    

     

    new function includes/functions/general.php;

     

     function tep_get_category_name($category_id, $language = '') {
       global $languages_id;
    
       if (empty($language)) $language = $languages_id;
    
       $category_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language . "'");
       $category = tep_db_fetch_array($category_query);
    
       return $category['categories_name'];
     }
    

     

    New language define /includes/languages/english.php

     

    define('SEARCH_RESULT', '%s, found in %s');
    

     

    I changed your code to:

     

     

    while ($row = mysql_fetch_assoc($fetch)) { 
     array_push($return_arr, $row['products_name']), tep_get_category_name($row
    
    ['categories_id']));
    }

     

    and now it shows the cateories name, but the query seems to have a strange beahaviour. If a type a category name it doesn't show, but if i type a product name the name of the category appear.

×