42 if(!$this->grant->access)
return new BaseObject(-1,
'msg_not_permitted');
44 $config =
$oModuleModel->getModuleConfig(
'integration_search');
45 if(!$config) $config =
new stdClass;
48 $config->skin =
'default';
49 $template_path = sprintf(
'%sskins/%s', $this->module_path, $config->skin);
54 $config_parse = explode(
'|@|', $config->skin);
55 if (count($config_parse) > 1)
57 $template_path = sprintf(
'./themes/%s/modules/integration_search/', $config_parse[0]);
61 $template_path = sprintf(
'%sskins/%s', $this->module_path, $config->skin);
66 $skin_vars = ($config->skin_vars) ? unserialize($config->skin_vars) :
new stdClass;
69 $target = $config->target;
70 if(!$target) $target =
'include';
72 if(empty($config->target_module_srl))
73 $module_srl_list = array();
75 $module_srl_list = explode(
',',$config->target_module_srl);
79 if($target ===
'include' && !count($module_srl_list))
82 $oMessageObject->setError(-1);
83 $oMessageObject->setMessage(
'msg_not_enabled');
84 $oMessageObject->dispMessage();
100 $oIS =
getModel(
'integration_search');
105 if(!in_array($search_target, array(
'title',
'content',
'title_content',
'tag'))) $search_target =
'title';
108 $output = $oIS->getDocuments($target, $module_srl_list, $search_target, $is_keyword, $page, 10);
113 $output = $oIS->getComments($target, $module_srl_list, $is_keyword, $page, 10);
119 if(!in_array($search_target, array(
'title',
'url',
'blog_name',
'excerpt'))) $search_target =
'title';
122 $output = $oIS->getTrackbacks($target, $module_srl_list, $search_target, $is_keyword, $page, 10);
127 $output = $oIS->getImages($target, $module_srl_list, $is_keyword, $page,20);
132 $output = $oIS->getFiles($target, $module_srl_list, $is_keyword, $page, 20);
137 $output[
'document'] = $oIS->getDocuments($target, $module_srl_list,
'title', $is_keyword, $page, 5);
138 $output[
'comment'] = $oIS->getComments($target, $module_srl_list, $is_keyword, $page, 5);
139 $output[
'trackback'] = $oIS->getTrackbacks($target, $module_srl_list,
'title', $is_keyword, $page, 5);
140 $output[
'multimedia'] = $oIS->getImages($target, $module_srl_list, $is_keyword, $page, 5);
141 $output[
'file'] = $oIS->getFiles($target, $module_srl_list, $is_keyword, $page, 5);
154 $security->encodeHTML(
'is_keyword',
'search_target',
'where',
'page');
setTemplateFile($filename)
& getModuleInstance($module, $type= 'view', $kind= '')
$template_path
a path of directory where template files reside
set($key, $val, $set_to_get_vars=0)