當前位置: 首頁>>代碼示例>>PHP>>正文


PHP IPSText::urldecode_furlSafe方法代碼示例

本文整理匯總了PHP中IPSText::urldecode_furlSafe方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSText::urldecode_furlSafe方法的具體用法?PHP IPSText::urldecode_furlSafe怎麽用?PHP IPSText::urldecode_furlSafe使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在IPSText的用法示例。


在下文中一共展示了IPSText::urldecode_furlSafe方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: searchResults

 /**
  * Processes a search request
  *
  * @return	@e void
  */
 public function searchResults()
 {
     /* Search Term */
     if (isset($this->request['search_term']) && !is_string($this->request['search_term'])) {
         $this->registry->getClass('output')->showError('invalid_search_term', 10312564);
     }
     $_st = $this->searchController->formatSearchTerm(trim($this->request['search_term']));
     $search_term = $_st['search_term'];
     $removedTerms = $_st['removed'];
     /* Set up some defaults */
     $this->settings['max_search_word'] = $this->settings['max_search_word'] ? $this->settings['max_search_word'] : 300;
     /* Did we come in off a post request? */
     if ($this->request['request_method'] == 'post') {
         /* Set a no-expires header */
         $this->registry->getClass('output')->setCacheExpirationSeconds(30 * 60);
     }
     if (is_array($this->request['search_app_filters'])) {
         array_walk_recursive($this->request['search_app_filters'], create_function('&$item, $key', '$item = IPSText::htmlspecialchars($item);'));
     }
     /* App specific */
     if (isset($this->request['search_sort_by_' . $this->request['search_app']])) {
         $this->request['search_sort_by'] = $_POST['search_sort_by_' . $this->request['search_app']] ? htmlspecialchars($_POST['search_sort_by_' . $this->request['search_app']]) : $this->request['search_sort_by_' . $this->request['search_app']];
         $this->request['search_sort_order'] = $_POST['search_sort_order_' . $this->request['search_app']] ? htmlspecialchars($_POST['search_sort_order_' . $this->request['search_app']]) : $this->request['search_sort_order_' . $this->request['search_app']];
     }
     /* Populate the registry */
     IPSSearchRegistry::set('in.search_app', $this->request['search_app']);
     IPSSearchRegistry::set('in.raw_search_term', trim($this->request['search_term']));
     IPSSearchRegistry::set('in.clean_search_term', $search_term);
     IPSSearchRegistry::set('in.raw_search_tags', str_replace('&', '&', trim(IPSText::parseCleanValue(IPSText::urldecode_furlSafe($_REQUEST['search_tags'])))));
     IPSSearchRegistry::set('in.search_higlight', str_replace('.', '', $this->request['search_term']));
     IPSSearchRegistry::set('in.search_date_end', ($this->request['search_date_start'] && $this->request['search_date_end'] and !is_array($this->request['search_date_end'])) ? $this->request['search_date_end'] : 'now');
     IPSSearchRegistry::set('in.search_date_start', ($this->request['search_date_start'] and !is_array($this->request['search_date_start'])) ? $this->request['search_date_start'] : '');
     IPSSearchRegistry::set('in.search_author', !empty($this->request['search_author']) ? $this->request['search_author'] : '');
     /* Set sort filters */
     $this->_setSortFilters();
     /* These can be overridden in the actual engine scripts */
     //	IPSSearchRegistry::set('set.hardLimit'        , 0 );
     IPSSearchRegistry::set('set.resultsCutToLimit', false);
     IPSSearchRegistry::set('set.resultsAsForum', false);
     /* Are we option to show titles only / search in titles only */
     IPSSearchRegistry::set('opt.searchType', (!empty($this->request['search_content']) and in_array($this->request['search_content'], array('both', 'titles', 'content'))) ? $this->request['search_content'] : 'both');
     /* Time check */
     if (IPSSearchRegistry::get('in.search_date_start') and strtotime(IPSSearchRegistry::get('in.search_date_start')) > time()) {
         IPSSearchRegistry::set('in.search_date_start', 'now');
     }
     if (IPSSearchRegistry::get('in.search_date_end') and strtotime(IPSSearchRegistry::get('in.search_date_end')) > time()) {
         IPSSearchRegistry::set('in.search_date_end', 'now');
     }
     /* Do some date checking */
     if (IPSSearchRegistry::get('in.search_date_end') and IPSSearchRegistry::get('in.search_date_start') and strtotime(IPSSearchRegistry::get('in.search_date_start')) > strtotime(IPSSearchRegistry::get('in.search_date_end'))) {
         $this->searchAdvancedForm($this->lang->words['search_invalid_date_range']);
         return;
     }
     /**
      * Lower limit
      */
     if ($this->settings['min_search_word'] && !IPSSearchRegistry::get('in.search_author') && !IPSSearchRegistry::get('in.raw_search_tags')) {
         if ($this->settings['search_method'] == 'sphinx' && substr_count($search_term, '"') >= 2) {
             $_ok = true;
         } else {
             $_words = explode(' ', preg_replace("#\"(.*?)\"#", '', $search_term));
             $_ok = $search_term ? true : false;
             foreach ($_words as $_word) {
                 $_word = preg_replace('#^\\+(.+?)$#', "\\1", $_word);
                 if (!$_word or $_word == '|') {
                     continue;
                 }
                 if (strlen($_word) < $this->settings['min_search_word']) {
                     $_ok = false;
                     break;
                 }
             }
         }
         if (!$_ok) {
             $this->searchAdvancedForm(sprintf($this->lang->words['search_term_short'], $this->settings['min_search_word']), $removedTerms);
             return;
         }
     }
     /**
      * Ok this is an upper limit.
      * If you needed to change this, you could do so via conf_global.php by adding:
      * $INFO['max_search_word'] = #####;
      */
     if ($this->settings['max_search_word'] && strlen(IPSSearchRegistry::get('in.raw_search_term')) > $this->settings['max_search_word']) {
         $this->searchAdvancedForm(sprintf($this->lang->words['search_term_long'], $this->settings['max_search_word']));
         return;
     }
     /* Search Flood Check */
     if ($this->memberData['g_search_flood']) {
         /* Check for a cookie */
         $last_search = IPSCookie::get('sfc');
         $last_term = str_replace("&quot;", '"', IPSCookie::get('sfct'));
         $last_term = str_replace("&amp;", '&', $last_term);
         /* If we have a last search time, check it */
         if ($last_search && $last_term) {
//.........這裏部分代碼省略.........
開發者ID:mover5,項目名稱:imobackup,代碼行數:101,代碼來源:search.php


注:本文中的IPSText::urldecode_furlSafe方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。