We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20508
    • 157 Posts
    Hello,

    I’m almost done fully implementing Ajax Search which I’m using to search blog content only. That is working fine - it’s the search results page I’m having troubles with.

    A working example of the Ajax Search can be seen here: http://www.stirboston.com/index.php?q=blog.

    First, I’d like to remove the text underneath the search field that states: "Please enter a search term to begin your search." I can’t figure out where it’s coming from.

    Secondly, if you search for "pasta" for example, you will see that the search results show up in the same DIV as the search box itself. I’d like to get the search results to show up below the text "These are the search results... " on that page.

    Any advice on how to get this working properly would be greatly appreciated!

    Thanks,
    msflux

      • 5811
      • 1,717 Posts
      Hi msflux,

      1/ to remove the intro message, the most simple way is to mask the placeholder [+as.introMessage+] by replacing:
      	'introMessage' => '
      		<p class="ajaxSearch_intro" id="ajaxSearch_intro">[+as.introMessage+]</p>'

      by :
      	'introMessage' => '
      		<p class="ajaxSearch_intro" id="ajaxSearch_intro"></p>'

      in the template.inc.php file of the include folder.

      2/ for the second point, unfortunately, i can’t reach your web site. I will retry later
        • 20508
        • 157 Posts
        Thanks for your reply. I was able to remove the message from the template.inc.php file. I realized you weren’t seeing the search results because the "search-results" page was unpublished. I published it, but now it looks like a blog posting - but you can see how the search results are formatting.

        Cheers,
        msflux
          • 5811
          • 1,717 Posts
          MsFlux, for the moment AjaxSearch doesn’t provide as Jot for example, any placeholders templating mechanism, so you can’t dissociate, with one single ajaxSearch call, the search input form from the results.

          My suggestion is to distinguish the display of the input search form from the display of results. So for that, to use two AjaxSearch calls

          1/ put the following call snippet in your searchBreadcrumbsWrapper div :
          [!AjaxSearch? &ajaxSearch=`0` &showResults=`0` &&AS_landing=`z`!]

          This call only display the searchForm without any results. z is the id of your current page.

          2/ put the following call snippet in your rightColumn div :
          [!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0`!]

          This call display the results on the z page. Obviously, you can add others parameters like &grabmax to manage the pagination.

          Try it and let me know if it’s ok. If yes, perhaps, you could invite me in your library, i am ready for an hour of wine tasting laugh
            • 22303 MODX Staff
            • 10,725 Posts
            FYI:

            There is a security vulnerability in the version of AjaxSearch included with MODx 0.9.6.1 (see http://www.securityfocus.com/archive/1/485707/30/0/threaded for details). You need to disable this snippet as soon as possible if you have the version included with MODx 0.9.6.1. I do not know what specific versions of AjaxSearch include this vulnerability, so it may be wise to disable it regardless of what version you have.

            Can someone help me coordinate getting this patched and updated in the repository as soon as possible? Once this is done, I will include the newest version of AjaxSearch in an 0.9.6.2 security release. If no patch can be provided within the next few hours, I will likely remove AjaxSearch from the MODx core distribution for 0.9.6.2 and will inform users to watch the AjaxSearch support thread for updates to that component.

            Cheers
              • 2901
              • 277 Posts
              Hi Folks
              I have a strange display problem with the search results in MODx 0.9.6.1. In most browsers the search result are displayed properly, except I use the search in more than two Parent document and with safari 3.0 the problem persists anyway.

              So are longtitle and title displayed like “Porträt” onstead of “Porträt”. I have adjusted the config.inc.php to utf8 and I use the 1.6.2d version of Ajaxsearch. Has anyone any solution to this problem?

              Thanks in advance!
                • 5811
                • 1,717 Posts
                Hi OpenGeek, Happy New year to you and the MODx Team

                The use of $as_language exists since the version provided with MODx 0.9.6 and the code comments regarding this feature is :
                Updated: 01/22/07 - Added templating/language/mootools support

                I am not sure to understand where is the security vulnerability. The report notes :

                $as_language = $_POST[’as_language’];
                ...
                #include other language file if set.
                if($as_language!="english" && $as_language != ’’) {
                if(file_exists(MODX_BASE_PATH .
                "assets/snippets/AjaxSearch/lang/".$as_language.".inc.php"))
                include MODX_BASE_PATH .
                "assets/snippets/AjaxSearch/lang/".$as_language.".inc.php";
                }

                There is no input validation here therefore its possible to set
                $as_language which could result in local file inclusion!


                Not sure to understand the remark, because, the path is build relatively to MODX_BASE_PATH."assets/snippets/AjaxSearch/lang/"
                but ...

                As the program await a simple name of file (e.g : spanish-utf8), perhaps we could add something like :
                $as_language = basename($as_langage); in order to strip any url.

                Do you think that it’s enought ?
                  • 22303 MODX Staff
                  • 10,725 Posts
                  As the program await a simple name of file (e.g : spanish-utf8), perhaps we could add something like :
                  $as_language = basename($as_langage); in order to strip any url.
                  Yes that should be appropriate; same conclusion I came to here. I’m going to commit such a temp fix for now and produce a patch for immediate resolution for 0.9.6.1 (and 0.9.6) users. We’ll coordinate the other additions and improvements you’ve made recently for 0.9.6.2 release.
                    • 5811
                    • 1,717 Posts
                    Hi Bbeer,

                    Just to be sure, this issue occurs only with two parents ids (more of one) and not with only one parents id ?

                    And in any time with Safari (one or more parents).

                    Your connection charset is utf8 for your database and the charset of your document is UTF-8

                    Is it a correct meaning of your issue ?
                      • 5811
                      • 1,717 Posts
                      Opengeek,

                      We’ll coordinate the other additions and improvements you’ve made recently for 0.9.6.2 release.

                      I am still working on a 1.7 version which includes all the improvements provided (1.6.1 and 1.6.2) but also fix (1.6.2b, 1.6.2c, 1.6.2d and 1.6.2.e). I have entirely rebuild the code and adds new fix and features. Find enclosed the changelog (in his current state). Could i have the help of somebody to check the code and make some tests ?

                      Starting now i could deliver this new version. When do you need it ?

                      This discussion is closed to further replies. Keep calm and carry on.