linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file tpl_search.php

Documentation is available at tpl_search.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage public
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10. ?>
  11.  
  12. <?php
  13. include_once(override('../search/display.php'));
  14.  
  15. if(ActiveItemKey($GLOBALS['activeitem'])=='search-result'{
  16.   SetHTMLTitle(_t('search','section'))// set HTML title
  17.   SetHTMLTitle(_t('search','result'))// set HTML title
  18.   setBreadcrumb(array(ucfirst(_t('search','section')) => HrefMaker(array('rub'=> $GLOBALS['links'][U_L]['search']['linkvalue']))));
  19.   setBreadcrumb(array(ucfirst(_t('search','result')) => false));
  20.   
  21.   echo '<h1>'._t('search','result').'</h1>';
  22.  
  23.   if(!isset($_REQUEST['search']|| strlen($_REQUEST['search']<= 2{
  24.     echo '<div class="info">';
  25.     echo _t('search','min_length');
  26.     echo '</div>';
  27.   else {
  28.     $str=strip_tags($_REQUEST['search']);
  29.     $searchtype=isset($_REQUEST['searchtype']$_REQUEST['searchtype''one';
  30.     echo '<h2>'._t('search','keywords'.'\''.formatText($str,'2HTML').'\'</h2>'.END_LINE;
  31.  
  32.     $start_time getmicrotime();
  33.     DisplayPublicResults($str$searchtype);
  34.     $end_time getmicrotime();
  35.     DisplayQueryTime($start_time$end_time);
  36.     logfile(LOG_KEYWORDS,array($str'PUBLIC'$searchtypei2c_realip()));
  37.     footerAddJS('../lib/js/jquery.easyMark.js');
  38.     // we remove words < 3 chars
  39.     $keywords preg_replace(array('/\b\w{1,2}\b/','/\s+/'),array('',' '),$_REQUEST['search']);
  40.     $js "$('#main div').easymark('highlight', '".formatText($keywords)."');";
  41.     footerAddInlineJS($js);
  42.   }
  43. }
  44.  
  45. if(ActiveItemKey($GLOBALS['activeitem'])=='search'{
  46.   SetHTMLTitle(_t('menu','advancedsearch'))// set HTML title
  47.   setBreadcrumb(array(ucfirst(_t('menu','advancedsearch')) => false));
  48.   
  49.   echo '<h1>'._t('menu','advancedsearch').'</h1>';
  50. }
  51. ?>

Documentation generated on Thu, 20 Mar 2014 16:49:41 +0100 by phpDocumentor 1.4.1