Ejemplo n.º 1
0
 protected function main()
 {
     d('cp');
     if ('onNewQuestion' === $this->eventName) {
         $Question = $this->obj;
         $oParser = SearchFactory::get($this->Registry);
         $oParser->getSimilarQuestions($Question);
     }
 }
Ejemplo n.º 2
0
 /**
  * (non-PHPdoc)
  * @see Lampcms.WebPage::main()
  */
 protected function main()
 {
     /**
      * Do NOT run urldecode() on request string
      * as it's already decoded because it uses
      *  $_GET as underlying array, and php
      *  already decodes $_GET or $_POST vars
      */
     $this->term = $this->Registry->Request->getUTF8('q')->stripTags();
     $this->aPageVars['qheader'] = '<h1>Search results for: ' . $this->term . '</h1>';
     $this->aPageVars['title'] = 'Questions matching &#39;' . $this->term . '&#39;';
     d('$this->term: ' . $this->term);
     $this->Search = SearchFactory::get($this->Registry);
     $this->Search->search($this->term);
     $this->makeTopTabs()->makeInfo()->makeBody();
 }
Ejemplo n.º 3
0
 /**
  * (non-PHPdoc)
  *
  * @see Lampcms.WebPage::main()
  */
 protected function main()
 {
     /**
      * Do NOT run urldecode() on request string
      * as it's already decoded because it uses
      *  $_GET as underlying array, and php
      *  already decodes $_GET or $_POST vars
      */
     try {
         $term = $this->Registry->Router->getSegment(2);
         $this->term = Utf8String::stringFactory(\urldecode($term));
     } catch (\Lampcms\Uri\SegmentNotFoundException $e) {
         $this->term = $this->Registry->Request->getUTF8('q');
     }
     $this->safeTerm = \str_replace(array('<', '>'), array('&lt;', '&gt'), $this->term->valueOf());
     $this->aPageVars['qheader'] = '<h1>@@Search results for@@: ' . $this->safeTerm . '</h1>';
     $this->aPageVars['title'] = '@@Questions matching@@ &#39;' . $this->safeTerm . '&#39;';
     d('$this->term: ' . $this->term);
     $this->Search = SearchFactory::get($this->Registry);
     $this->Search->search($this->term);
     $this->makeTopTabs()->makeInfo()->makeBody();
 }