Модуль Поиск v2.26.0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.5 KiB

<?php
/**
* AVE.cms - Модуль Поиск
*
* @package AVE.cms
* @subpackage module_Search
* @filesource
*/
if (!defined('BASE_DIR')) exit;
function mod_search()
{
global $AVE_Template;
if (isset($_REQUEST['module']) && $_REQUEST['module'] == 'search') $AVE_Template->assign('hide', 1);
$AVE_Template->display(BASE_DIR . '/modules/search/templates/form.tpl');
}
if (!defined('ACP') && (isset($_REQUEST['module']) && $_REQUEST['module'] == 'search'))
{
global $stemmer;
if (! @require_once(BASE_DIR . '/modules/search/class/search.php')) module_error();
if (! @require_once(BASE_DIR . '/modules/search/class/porter.php')) module_error();
$tpl_dir = BASE_DIR . '/modules/search/templates/';
$lang_file = BASE_DIR . '/modules/search/lang/' . $_SESSION['user_language'] . '.txt';
$AVE_Template->config_load($lang_file, 'module');
$search = new Search;
$stemmer = new Lingua_Stem_Ru();
$search->searchResultGet($tpl_dir, $lang_file);
}
if (defined('ACP') && !empty($_REQUEST['moduleaction']))
{
if (! (is_file(BASE_DIR . '/modules/search/class/search.php') &&
@require_once(BASE_DIR . '/modules/search/class/search.php'))) module_error();
$tpl_dir = BASE_DIR .'/modules/search/templates/';
$lang_file = BASE_DIR .'/modules/search/lang/' . $_SESSION['admin_language'] . '.txt';
$search = new Search;
$AVE_Template->config_load($lang_file, 'module');
switch ($_REQUEST['moduleaction'])
{
case '1':
$search->searchWordsShow($tpl_dir);
break;
case 'delwords':
$search->searchWordsDelete();
break;
}
}
?>