We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19298
    • 76 Posts
    MichaelHarringtonDesigns Reply #1, 16 years, 9 months ago
    I added this code to my chunk where i would like the search box to go...

    [!AjaxSearch? &ajaxSearch=`1`!]

    but I get this error

    AjaxSearch: unknown database_connection_charset = hp8
    Add the appropriate Html charset mapping in the search.class.inc.php file

    on my site does anyone know what I have done wrong?

    Michael
      • 7231
      • 4,205 Posts
      I am guessing that AjaxSearch doesn’t support the hp8 charset. I have never used that charset so I cant confirm this.

      From the AjaxSearch wiki docs:
      AjaxSearch: unknown database_connection_charset = something. Add the appropriate Html charset mapping in the ajaxSearch.php file

      * is not an error but need that you add in the ajaxSearch.php file the mapping between the mysql database character set (not the collation) and the html charset.
      * e.g: ’latin1’ => ’ISO-8859-1’,


      I am guessing that no one has added the hp8 charset file for AjaxSearch.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 19298
        • 76 Posts
        MichaelHarringtonDesigns Reply #3, 16 years, 9 months ago
        Thanks for your reply

        I tried to install ajaxsearch following tutorial

        http://codingpad.maryspad.com/2009/06/05/building-a-website-with-modx-for-newbies-part-10-adding-search-functionality-using-ajaxsearch/

        Which uses AjaxSearch 1.8.1, but I have 1.8.4 installed would this make a difference?




          • 5811
          • 1,717 Posts
          Hi Michael,

          This tutorial is very good but not enougth relevant when you are outside of the common users ...
          The default installation of ajaxSearch is for utf-8 or latin1 users.

          Which uses AjaxSearch 1.8.1, but I have 1.8.4 installed would this make a difference?
          Yes! you compare the neolitic with the renaissance laugh Lot of issues has been corrected from the release 1.8.1

          I don’t know the hp8 charset but try to do as follow:

          Edit the ajaxSearch/classes/search.class.inc.php file and changes the lines 31-35:
            // Conversion code name between html page character encoding and Mysql character encoding
            // Some others conversions should be added if needed. Otherwise Page charset = Database charset
            var $pageCharset = array(
              'utf8' => 'UTF-8',
              'latin1' => 'ISO-8859-1',
              'latin2' => 'ISO-8859-2'
            );

          by:
            // Conversion code name between html page character encoding and Mysql character encoding
            // Some others conversions should be added if needed. Otherwise Page charset = Database charset
            var $pageCharset = array(
              'utf8' => 'UTF-8',
              'latin1' => 'ISO-8859-1',
              'latin2' => 'ISO-8859-2',
              'hp2' => 'zzz'
            );

          [EDIT] ’hp8’ => ’zzz’ instead of ’hp2’ => ’zzz’

          Where you need to replace ’zzz’ by the page charset which corresponding to the hp8 database charset.
          You need to have a page charset coherent with your database charset (hp8)

          Why don’t you use the utf8 charset ?
            • 19298
            • 76 Posts
            MichaelHarringtonDesigns Reply #5, 16 years, 9 months ago
            HI coroico

            Thanks for your reply much appreciated

            I edited the ajax search code below in ajaxSearch/classes/search.class.inc.php file

            // Conversion code name between html page character encoding and Mysql character encoding
            // Some others conversions should be added if needed. Otherwise Page charset = Database charset
            var $pageCharset = array(
            ’utf8’ => ’UTF-8’,
            ’latin1’ => ’ISO-8859-1’,
            ’latin2’ => ’ISO-8859-2’,
            ’hp2’ => ’utf8’
            );

            I then added [!AjaxSearch? &ajaxSearch=0 &otherParamsAsNeeded=`here` !] in the chunk were i would like the search box to go but i still get this error

            AjaxSearch: unknown database_connection_charset = hp8
            Add the appropriate Html charset mapping in the search.class.inc.php file

            currently on this domain on the right hand side http://www.flashbanners.org.uk/

            you mention "You need to have a page charset coherent with your database charset (hp8)"
            Where would i find out if my page charset coherent with my database charset?
              • 5811
              • 1,717 Posts
              Michael,
              you mention "You need to have a page charset coherent with your database charset (hp8)"
              Yes. I don’t know what is the "hp8" charset, but if you use the utf-8 as html charset (as I saw on your site), you logically should use an utf8 database charset.

              Could you check what is the charset parameter defined in your modx configuration file, see manager/includes/config.inc.php
              You have probably something like this:
               $database_connection_charset = 'hp8';
              is it true ?

              Where would i find out if my page charset coherent with my database charset?
              I don’t know which page charset should be coherent with "hp8" as database charset, but I am sure that with an utf-8 html page charset, you should have a database with an "utf8" database charset.

              So, to resume:
              1/ what is your database charset - use phpmyadmin for instance, to see your database charset.
              Do you remenber during the MODx install, why you choose the "hp8" as database charset. Why do you use it ? (do you come from an another planet? laugh )

              2/ which is the value of the $database_connection_charset in your config file ? Could you check it ?

              3/ If "hp8" is not a mandatory charset for your database, I stronly recommend to redo a modx installaion with "utf8" as database charset
                • 19298
                • 76 Posts
                MichaelHarringtonDesigns Reply #7, 16 years, 9 months ago
                Hi Coroico

                Thanks for your quick reply

                1/ what is your database charset - use phpmyadmin for instance, to see your database charset.
                Do you remenber during the MODx install, why you choose the "hp8" as database charset. Why do you use it ? (do you come from an another planet? )

                Sometime I think I am from another planet grin I looked in phpmyadmin to see the database charset and it is set to "utf8"

                2/ which is the value of the $database_connection_charset in your config file ? Could you check it ?

                Ok I have checked this file and YES it is set to $database_connection_charset = ’hp8’; should i change this to "utf8"

                3/ If "hp8" is not a mandatory charset for your database, I stronly recommend to redo a modx installaion with "utf8" as database charset

                I really don’t want to do a redo modx installation, my work will be lost
                  • 5811
                  • 1,717 Posts
                  I looked in phpmyadmin to see the database charset and it is set to "utf8"
                  You are a lucky man ...
                  should i change this to "utf8"
                  Yes. If your database is set to utf8, so change the value of the config file. Set
                  $database_connection_charset = "utf8";
                  And keep your html page to "UTF-8".
                  Try it and let me know the results.
                    • 19298
                    • 76 Posts
                    MichaelHarringtonDesigns Reply #9, 16 years, 9 months ago
                    Thanks Coroico

                    Its working now I even made a results page, now i just need to add allot more content to my site...

                    thanks again I couldn’t of got it working with out you