We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5811
    • 1,717 Posts
    @Modxlearner123

    Find below a hack that could reduce the volume of parsed document.
    This hack runs only for the non-ajax mode (&ajaxSearch=`0`) with AS 1.8.4

    Edit the snippets/ajaxSearch/classes/ajaxSearch.class.inc.php file
    1/ replace the line 40:
    define('INTROFAILURE_CLASS','AS_ajax_resultsIntroFailure');   // intro failure class

    by:
    define('INTROFAILURE_CLASS','AS_ajax_resultsIntroFailure');   // intro failure class
    define('ASPHX','||-AJAXSEARCH-||');                           // internal place holder


    2/ change the line 207:
              $this->varResults['listResults'] = $results;
    by
              $this->varResults['listResults'] = ASPHX;


    3/ Replace the line 253:
        $output = $this->chkLayout->Render()."\n";

    by:
        $output = $this->chkLayout->Render()."\n";
        $output = str_replace(ASPHX, $results, $output);


    With this hack, the volume of parsed document will be (possibly) under your pcre limit.
      • 20014
      • 200 Posts
      YESSSSSS!!
      the site now has a clean beautiful landing page!

      @bobray, I did a you suggested and it worked!
      @coroico, I also did what you said and it too worked!

      I did both alone, reverted, and tried the other, the reason why I did this is to learn and have a couple of possible ways to attack
      the situation if it should arise on another hosting environment. this thread is definitely a keeper, I haven’t just bookmarked it but pasted and copied the entire thing and put it in my resources folder!!

      now, there was a bit of code injected into the results:
      [+as.extractShow:is=`1`:then=`
      
      ...a=`documentTags`]]
      
      `+] 


      so this is how I set up the call:
       [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`92` &tplLayout=`ajaxlayout` &AS_showResults=`0` &showMoreResults=`0`!]


      and the landing page:
      [!AjaxSearch? &AS_showForm=`0` &ajaxSearch=`0` &phx=`0` &extract=`0`!]


      and everything is perfect!! thanks guys for bearing with me, and I am a bit surprised I haven’t been able to find this problem other than the other thread with coroico.
      you guys really came through, as the site’s owner had yet to notice, and you know as well as I do, the less bugs the catch, the better laugh
        • 5811
        • 1,717 Posts
        [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`92` &tplLayout=`ajaxlayout` &AS_showResults=`0` &showMoreResults=`0`!]
        In your first snippet call, as you use the non-ajax mode, &showMoreResults=`0` is useless.

        And on the landing page, for the second snippet call:
        [!AjaxSearch? &AS_showForm=`0` &ajaxSearch=`0` &phx=`0` &extract=`0`!]
        &phx=`0` is not an AjaxSearch parameter. You probably want to write &tvPhx=`0`. This is useless too, because the default value is 0.

        By setting &extract=`0`, you don’t display the extract of text where the search term is found. So you correct your issue, but IMHO, you loose an interesting feature