We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21560
    • 145 Posts
    Yes, very much That one

    There’s a lot of research done by me on Dynamic PDF’s, especially since "m making a PDF consisting of 140+ MODx documents (230+ pages in A4)

    So a good read for the nerds among us...
      [font=Times]Comics, stories, music, graphics, games and more! http://Nimja.com
      • 14050
      • 788 Posts
      I don’t use extensions on my page, but it’s a good idea to strip them. I’ll look into this one some time again. I haven’t touched it for a while. PDF’s taking my attention

      Even if you don’t use extensions, you should use his version, as your version causes a parse error if someone adds a trailing slash ("/").
        Jesse R.
        Consider trying something new and extraordinary.
        Illinois Wine

        Have you considered donating to MODx lately?
        Donate now. Every contribution helps.
        • 21560
        • 145 Posts
        Agreed, I’ve edited the original post and formatted the code nicely.

        Oh, and mentioned you obviously wink
          [font=Times]Comics, stories, music, graphics, games and more! http://Nimja.com
          • 19741
          • 90 Posts
          Hi Nimja,

          i used SetSearch for a while, but now with Modx 1.0.2 and AjaxSearch 1.84 it won’t trigger the search successfully.
          I got the following (german) message:
          Bitte geben Sie einen Suchbegriff ein, um die Suche zu starten.
          in english it would be:
          Please enter a search term to begin your search.

          What could be the reason?
            Bye,
            Mithrandir
            • 21560
            • 145 Posts
            It is asking for a search term, what you can do is check the GET or POST variable that the snippet uses.

            $_POST[’search’] = $cleanQuery;

            This is the variable I set. You can see it in the standard search forms as well.
              [font=Times]Comics, stories, music, graphics, games and more! http://Nimja.com
              • 19741
              • 90 Posts
              Hi Nimja,

              strange - i just wanted to debug the snippets, but now it works. huh Thank you for your help.

              [Edit #1]
              I think, the days before i tried something like:
              http://www.simcopack.de/de/wunsch
              (there were (s. solution below) no hits for "de/wunsch")

              http://www.simcopack.de/wunsch
              (one hit for "wunsch")

              I’ll try to change the code to my needs.
              [/Edit #1]


              [Edit #2]
              i think, i got it: http://www.simcopack.de/de/wunsch will give 2 words, one word ("de") with 2 letters only -> AjaxSearch doesn’t "want" this. sad

              New question: could you please give me a hint, how i could delete short words (i know, it must be a RegEx, but i don’t know how - see below)?
              [/Edit #2]


              [Edit #3]
              The solution (i think) is to change:
                  $cleanQuery = strtr(urldecode($_GET['q']),"/-","  "); // translate address to search string (slashes and dashes to spaces)
                  
                  //Find position of last . (in case of multiple .'s)
                  $dotPos = strrpos($ssStrQuery,".");  


              into:
                  $cleanQuery = strtr(urldecode($_GET['q']),"/-","  "); // translate address to search string (slashes and dashes to spaces)
                  $cleanQuery = preg_replace('/\b\w{1,2}\b/','',$cleanQuery); // remove short words due to AjaxSearch's limit
                  //Find position of last . (in case of multiple .'s)
                  $dotPos = strrpos($ssStrQuery,".");  

              [/Edit #3]
                Bye,
                Mithrandir
                • 21560
                • 145 Posts
                This is a very good point! Will edit the original post. laugh
                  [font=Times]Comics, stories, music, graphics, games and more! http://Nimja.com