当前位置: 首页>>代码示例>>PHP>>正文


PHP CKunenaLink::GetSearchURL方法代码示例

本文整理汇总了PHP中CKunenaLink::GetSearchURL方法的典型用法代码示例。如果您正苦于以下问题:PHP CKunenaLink::GetSearchURL方法的具体用法?PHP CKunenaLink::GetSearchURL怎么用?PHP CKunenaLink::GetSearchURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CKunenaLink的用法示例。


在下文中一共展示了CKunenaLink::GetSearchURL方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: results

	public function results() {
		require_once KPATH_SITE . '/lib/kunena.link.class.php';

		$model = $this->getModel('Search');
		$this->app->redirect ( CKunenaLink::GetSearchURL('advsearch', $model->getState('searchwords'),
			$model->getState('list.start'), $model->getState('list.limit'), $model->getUrlParams(), false) );
	}
开发者ID:rich20,项目名称:Kunena,代码行数:7,代码来源:search.php

示例2: CKunenaSearch

 /**
  * Search constructor
  * @param limitstart First shown item
  * @param limit Limit
  */
 function CKunenaSearch()
 {
     global $kunena_my;
     $app =& JFactory::getApplication();
     $kunena_db =& JFactory::getDBO();
     $fbConfig =& CKunenaConfig::getInstance();
     // TODO: started_by
     // TODO: active_in
     // Default values for checkboxes depends on function
     $this->func = strtolower(JRequest::getCmd('func'));
     if ($this->func == 'search') {
         $this->defaults['exactname'] = $this->defaults['childforums'] = 1;
     } else {
         $this->defaults['exactname'] = $this->defaults['childforums'] = 0;
     }
     $q = JRequest::getVar('q', '');
     // Search words
     // Backwards compability for old templates
     if (empty($q) && isset($_REQUEST['searchword'])) {
         $q = JRequest::getVar('searchword', '');
     }
     $q = stripslashes($q);
     $this->params['titleonly'] = JRequest::getInt('titleonly', $this->defaults['titleonly']);
     $this->params['searchuser'] = stripslashes(JRequest::getVar('searchuser', $this->defaults['searchuser']));
     $this->params['starteronly'] = JRequest::getInt('starteronly', $this->defaults['starteronly']);
     $this->params['exactname'] = JRequest::getInt('exactname', $this->defaults['exactname']);
     $this->params['replyless'] = JRequest::getInt('replyless', $this->defaults['replyless']);
     $this->params['replylimit'] = JRequest::getInt('replylimit', $this->defaults['replylimit']);
     $this->params['searchdate'] = JRequest::getVar('searchdate', $this->defaults['searchdate']);
     $this->params['beforeafter'] = JRequest::getVar('beforeafter', $this->defaults['beforeafter']);
     $this->params['sortby'] = JRequest::getVar('sortby', $this->defaults['sortby']);
     $this->params['order'] = JRequest::getVar('order', $this->defaults['order']);
     $this->params['childforums'] = JRequest::getInt('childforums', $this->defaults['childforums']);
     $this->params['catids'] = strtr(JRequest::getVar('catids', '0', 'get'), KUNENA_URL_LIST_SEPARATOR, ',');
     $limitstart = $this->limitstart = JRequest::getInt('limitstart', 0);
     $limit = $this->limit = JRequest::getInt('limit', $fbConfig->messages_per_page_search);
     extract($this->params);
     if ($limit < 1 || $limit > 40) {
         $limit = $this->limit = $fbConfig->messages_per_page_search;
     }
     if (isset($_POST['q']) || isset($_POST['searchword'])) {
         $this->params['catids'] = implode(',', JRequest::getVar('catids', array(0), 'post', 'array'));
         $url = CKunenaLink::GetSearchURL($fbConfig, $this->func, $q, $limitstart, $limit, $this->getUrlParams());
         header("HTTP/1.1 303 See Other");
         header("Location: " . htmlspecialchars_decode($url));
         $app->close();
     }
     if ($q == _GEN_SEARCH_BOX) {
         $q = '';
     }
     $this->searchword = $q;
     $arr_searchwords = split(' ', $q);
     $do_search = FALSE;
     $this->arr_kunena_searchstrings = array();
     foreach ($arr_searchwords as $q) {
         $q = trim($q);
         if (strlen($q) > 2) {
             $do_search = TRUE;
         }
         $this->arr_kunena_searchstrings[] = $q;
     }
     if (strlen($searchuser) > 0) {
         $do_search = TRUE;
     }
     $arr_searchwords = $this->arr_kunena_searchstrings;
     $this->str_kunena_username = $searchuser;
     if ($do_search != TRUE) {
         $this->int_kunena_errornr = 1;
         $this->str_kunena_errormsg = _KUNENA_SEARCH_ERR_SHORTKEYWORD;
         return;
     }
     $search_forums = $this->get_search_forums($catids, $childforums);
     /* if there are no forums to search in, set error and return */
     if (empty($search_forums)) {
         $this->int_kunena_errornr = 2;
         $this->str_kunena_errormsg = _KUNENA_SEARCH_NOFORUM;
         return;
     }
     for ($x = 0; $x < count($arr_searchwords); $x++) {
         $searchword = $arr_searchwords[$x];
         $searchword = $kunena_db->getEscaped(addslashes(trim(strtolower($searchword))));
         if (empty($searchword)) {
             continue;
         }
         $matches = array();
         $not = '';
         $operator = ' OR ';
         if (strstr($searchword, '-') == $searchword) {
             $not = 'NOT';
             $operator = 'AND';
             $searchword = substr($searchword, 1);
         }
         if ($titleonly == '0') {
             $querystrings[] = "(t.message {$not} LIKE '%{$searchword}%' {$operator} m.subject {$not} LIKE '%{$searchword}%')";
         } else {
//.........这里部分代码省略.........
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:101,代码来源:kunena.search.class.php

示例3: CKunenaSearch

 /**
  * Search constructor
  * @param limitstart First shown item
  * @param limit Limit
  */
 function CKunenaSearch()
 {
     $this->my = JFactory::getUser();
     $this->app = JFactory::getApplication();
     $this->doc = JFactory::getDocument();
     $this->db = JFactory::getDBO();
     $this->config = KunenaFactory::getConfig();
     $this->session = KunenaFactory::getSession();
     // TODO: started_by
     // TODO: active_in
     // Default values for checkboxes depends on function
     $this->func = JString::strtolower(JRequest::getCmd('func'));
     if ($this->func == 'search') {
         $this->defaults['exactname'] = $this->defaults['childforums'] = 1;
     } else {
         $this->defaults['exactname'] = $this->defaults['childforums'] = 0;
     }
     $q = JRequest::getVar('q', '');
     // Search words
     // Backwards compability for old templates
     if (empty($q) && isset($_REQUEST['searchword'])) {
         $q = JRequest::getVar('searchword', '');
     }
     $q = JString::trim($q);
     $this->params['titleonly'] = JRequest::getInt('titleonly', $this->defaults['titleonly']);
     $this->params['searchuser'] = JRequest::getVar('searchuser', $this->defaults['searchuser']);
     $this->params['starteronly'] = JRequest::getInt('starteronly', $this->defaults['starteronly']);
     $this->params['exactname'] = JRequest::getInt('exactname', $this->defaults['exactname']);
     $this->params['replyless'] = JRequest::getInt('replyless', $this->defaults['replyless']);
     $this->params['replylimit'] = JRequest::getInt('replylimit', $this->defaults['replylimit']);
     $this->params['searchdate'] = JRequest::getVar('searchdate', $this->defaults['searchdate']);
     $this->params['beforeafter'] = JRequest::getVar('beforeafter', $this->defaults['beforeafter']);
     $this->params['sortby'] = JRequest::getVar('sortby', $this->defaults['sortby']);
     $this->params['order'] = JRequest::getVar('order', $this->defaults['order']);
     $this->params['childforums'] = JRequest::getInt('childforums', $this->defaults['childforums']);
     $this->params['catids'] = strtr(JRequest::getVar('catids', '0', 'get'), KUNENA_URL_LIST_SEPARATOR, ',');
     $this->params['show'] = JRequest::getInt('show', $this->defaults['show']);
     $this->limitstart = JRequest::getInt('limitstart', 0);
     $this->limit = JRequest::getInt('limit', $this->config->messages_per_page_search);
     extract($this->params);
     if ($this->limit < 1 || $this->limit > 40) {
         $this->limit = $this->limit = $this->config->messages_per_page_search;
     }
     if (isset($_POST['q']) || isset($_POST['searchword'])) {
         $catids = JRequest::getVar('catids', array(0), 'post', 'array');
         JArrayHelper::toInteger($catids);
         $this->params['catids'] = implode(',', $catids);
         $url = CKunenaLink::GetSearchURL($this->func, $q, $this->limitstart, $this->limit, $this->getUrlParams());
         header("HTTP/1.1 303 See Other");
         header("Location: " . htmlspecialchars_decode($url));
         $this->app->close();
     }
     $catids = explode(',', $this->params['catids']);
     JArrayHelper::toInteger($catids);
     $this->params['catids'] = implode(',', $catids);
     if ($q == JText::_('COM_KUNENA_GEN_SEARCH_BOX')) {
         $q = '';
     }
     $this->q = $q;
     $arr_searchwords = preg_split('/[\\s,]*\'([^\']+)\'[\\s,]*|[\\s,]*"([^"]+)"[\\s,]*|[\\s,]+/u', $q, 0, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
     $do_search = FALSE;
     $this->arr_kunena_searchstrings = array();
     foreach ($arr_searchwords as $q) {
         $q = JString::trim($q);
         if (JString::strlen($q) > 1) {
             $do_search = TRUE;
         }
         $this->arr_kunena_searchstrings[] = $q;
     }
     if (JString::strlen($this->params['searchuser']) > 0) {
         $do_search = TRUE;
     }
     $arr_searchwords = $this->arr_kunena_searchstrings;
     $this->str_kunena_username = $this->params['searchuser'];
     if ($do_search != TRUE) {
         $this->int_kunena_errornr = 1;
         $this->str_kunena_errormsg = JText::_('COM_KUNENA_SEARCH_ERR_SHORTKEYWORD');
         return;
     }
     $search_forums = $this->get_search_forums($this->params['catids'], $this->params['childforums']);
     /* if there are no forums to search in, set error and return */
     if (empty($search_forums)) {
         $this->int_kunena_errornr = 2;
         $this->str_kunena_errormsg = JText::_('COM_KUNENA_SEARCH_NOFORUM');
         return;
     }
     for ($x = 0; $x < count($arr_searchwords); $x++) {
         $searchword = $arr_searchwords[$x];
         $searchword = $this->db->getEscaped(JString::trim($searchword));
         if (empty($searchword)) {
             continue;
         }
         $matches = array();
         $not = '';
         $operator = ' OR ';
//.........这里部分代码省略.........
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:101,代码来源:kunena.search.class.php

示例4:

		<span class="ktoggler"><a class="ktoggler <?php 
echo $advsearch_class;
?>
" title="<?php 
echo $advsearch_title;
?>
" rel="advsearch"></a></span>
		<h2><span><?php 
echo JText::_('COM_KUNENA_SEARCH_ADVSEARCH');
?>
</span></h2>
	</div>
	<div class="kcontainer">
		<div class="kbody">
<form action="<?php 
echo CKunenaLink::GetSearchURL('advsearch');
?>
" method="post" id="searchform" name="adminForm">
	<table id="kforumsearch">
		<tbody id="advsearch"<?php 
echo $advsearch_style;
?>
>
			<tr class="krow1">
				<td class="kcol-first">
					<fieldset class="fieldset">
						<legend><?php 
echo JText::_('COM_KUNENA_SEARCH_SEARCHBY_KEYWORD');
?>
</legend>
						<label class="searchlabel" for="keywords"><?php 
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:31,代码来源:advsearch.php

示例5: defined

 * @package Kunena.Template.Default20
 * @subpackage Common
 *
 * @copyright (C) 2008 - 2011 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();
		$q = JRequest::getVar ( 'q', '' ); // Search words
		$searchuser = JRequest::getVar ( 'searchuser', '' ); // Search user
		// Backwards compability for old templates
		if (empty ( $q ) && isset ( $_REQUEST ['searchword'] )) {
			$q = JRequest::getVar ( 'searchword', '' );
		}
		if (empty ( $searchuser ) && isset ( $_REQUEST ['searchword'] )) {
			$searchuser = JRequest::getVar ( 'searchword', '' );
		}
?>
<div id="mb_search" style="display:none;">
	<div class="tk-mb-header-search" style="display:none; margin-bottom:10px;">
		<span class="tk-mb-first"><?php echo JText::_('COM_KUNENA_TEMPLATE_SEARCH_IN_FORUM'); ?></span>
	</div>
	<form action="<?php echo CKunenaLink::GetSearchURL('advsearch'); ?>" method="post" id="searchform" name="adminForm">
		<input id="keywords" class="tk-searchbox" type="text" name="q" value="<?php echo $this->escape($q); ?>" />
		<?php /*?><input id="kusername" class="tk-searchbox" type="text" name="searchuser" value="<?php echo $this->escape($searchuser); ?>" /><?php */?>
		<input class="tk-search-button" type="submit" value="<?php echo JText::_('COM_KUNENA_SEARCH_SEND'); ?>" />
	</form>
	<div>
		<a class="tk-mb-advsearchlink" href="<?php JURI::base() ?>index.php?option=com_kunena&view=search"><?php echo JText::_('COM_KUNENA_SEARCH_ADVSEARCH'); ?></a>
	</div>
</div>
开发者ID:GoremanX,项目名称:Kunena-2.0,代码行数:31,代码来源:quicksearch.php


注:本文中的CKunenaLink::GetSearchURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。