mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Remove trackback from integration search
This commit is contained in:
parent
2ab8281355
commit
2139b8541c
2 changed files with 19 additions and 72 deletions
|
|
@ -126,56 +126,6 @@ class integration_searchModel extends module
|
|||
return $oCommentModel->getTotalCommentList($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Search trackbacks
|
||||
*
|
||||
* @param string $target choose target. exclude or include for $module_srls_list
|
||||
* @param string $module_srls_list module_srl list to string type. ef - 102842,59392,102038
|
||||
* @param string $search_target Target
|
||||
* @param string $search_keyword Keyword
|
||||
* @param integer $page page of page navigation
|
||||
* @param integer $list_count list count of page navigation
|
||||
*
|
||||
* @return Object output trackback list
|
||||
*/
|
||||
function getTrackbacks($target, $module_srls_list, $search_target = "title", $search_keyword = '', $page=1, $list_count = 20)
|
||||
{
|
||||
$oTrackbackModel = getAdminModel('trackback');
|
||||
if(!$oTrackbackModel) return new BaseObject();
|
||||
|
||||
if(!is_array($module_srls_list))
|
||||
{
|
||||
$module_srls_list = $module_srls_list ? explode(',', $module_srls_list) : array();
|
||||
}
|
||||
$module_srls_list = array_map('intval', $module_srls_list);
|
||||
$accessible_modules = array_keys(getModel('module')->getAccessibleModuleList());
|
||||
|
||||
$args = new stdClass();
|
||||
if($target == 'exclude')
|
||||
{
|
||||
$args->module_srl = $accessible_modules;
|
||||
$args->exclude_module_srl = $module_srls_list;
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->module_srl = array_intersect($module_srls_list, $accessible_modules);
|
||||
$args->exclude_module_srl = array(0); // exclude 'trash'
|
||||
}
|
||||
$args->module_srl[] = 0;
|
||||
|
||||
$args->page = $page;
|
||||
$args->list_count = $list_count;
|
||||
$args->page_count = Mobile::isFromMobilePhone() ? 5 : 10;
|
||||
$args->search_target = $search_target;
|
||||
$args->search_keyword = $search_keyword;
|
||||
$args->sort_index = 'list_order';
|
||||
$args->order_type = 'asc';
|
||||
// Get a list of documents
|
||||
$output = $oTrackbackModel->getTotalTrackbackList($args);
|
||||
if(!$output->toBool()|| !$output->data) return $output;
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search file
|
||||
*
|
||||
|
|
@ -328,6 +278,17 @@ class integration_searchModel extends module
|
|||
{
|
||||
return $this->_getFiles($target, $module_srls_list, $search_keyword, $page, $list_count, 'N');
|
||||
}
|
||||
|
||||
/**
|
||||
* Search trackbacks
|
||||
*
|
||||
* @deprecated
|
||||
* @return BaseObject
|
||||
*/
|
||||
function getTrackbacks()
|
||||
{
|
||||
return new BaseObject();
|
||||
}
|
||||
}
|
||||
/* End of file integration_search.model.php */
|
||||
/* Location: ./modules/integration_search/integration_search.model.php */
|
||||
|
|
|
|||
|
|
@ -47,13 +47,13 @@ class integration_searchView extends integration_search
|
|||
$this->setRedirectUrl($redirect_url);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Check permissions
|
||||
if(!$this->grant->access)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
// Block robots
|
||||
$config = $oModuleModel->getModuleConfig('integration_search') ?: new stdClass;
|
||||
if (!isset($config->block_robots) || $config->block_robots !== false)
|
||||
|
|
@ -63,7 +63,7 @@ class integration_searchView extends integration_search
|
|||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set skin path
|
||||
if(ends_with('Mobile', get_class($this), false))
|
||||
{
|
||||
|
|
@ -100,7 +100,7 @@ class integration_searchView extends integration_search
|
|||
$config->skin = 'default';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->setTemplatePath($template_path);
|
||||
$skin_vars = ($config->skin_vars) ? unserialize($config->skin_vars) : new stdClass;
|
||||
Context::set('module_info', $skin_vars);
|
||||
|
|
@ -133,7 +133,7 @@ class integration_searchView extends integration_search
|
|||
// Set page variables
|
||||
$page = (int)Context::get('page');
|
||||
if(!$page) $page = 1;
|
||||
|
||||
|
||||
// Set page title
|
||||
$title = config('seo.subpage_title') ?: '$SITE_TITLE - $SUBPAGE_TITLE';
|
||||
Context::setBrowserTitle($title, array(
|
||||
|
|
@ -149,13 +149,8 @@ class integration_searchView extends integration_search
|
|||
// Create integration search model object
|
||||
if($is_keyword)
|
||||
{
|
||||
$oIS = getModel('integration_search');
|
||||
$oTrackbackModel = getAdminModel('trackback');
|
||||
Context::set('trackback_module_exist', true);
|
||||
if(!$oTrackbackModel)
|
||||
{
|
||||
Context::set('trackback_module_exist', false);
|
||||
}
|
||||
$oIS = integration_searchModel::getInstance();
|
||||
Context::set('trackback_module_exist', false);
|
||||
|
||||
switch($where)
|
||||
{
|
||||
|
|
@ -173,15 +168,6 @@ class integration_searchView extends integration_search
|
|||
Context::set('output', $output);
|
||||
$this->setTemplateFile("comment", $page);
|
||||
break;
|
||||
case 'trackback' :
|
||||
$search_target = Context::get('search_target');
|
||||
if(!in_array($search_target, array('title','url','blog_name','excerpt'))) $search_target = 'title';
|
||||
Context::set('search_target', $search_target);
|
||||
|
||||
$output = $oIS->getTrackbacks($target, $module_srl_list, $search_target, $is_keyword, $page, 10);
|
||||
Context::set('output', $output);
|
||||
$this->setTemplateFile("trackback", $page);
|
||||
break;
|
||||
case 'multimedia' :
|
||||
$output = $oIS->getImages($target, $module_srl_list, $is_keyword, $page,20);
|
||||
Context::set('output', $output);
|
||||
|
|
@ -195,9 +181,9 @@ class integration_searchView extends integration_search
|
|||
default :
|
||||
$output['document'] = $oIS->getDocuments($target, $module_srl_list, 'title_content', $is_keyword, $page, 5);
|
||||
$output['comment'] = $oIS->getComments($target, $module_srl_list, $is_keyword, $page, 5);
|
||||
$output['trackback'] = $oIS->getTrackbacks($target, $module_srl_list, 'title', $is_keyword, $page, 5);
|
||||
$output['multimedia'] = $oIS->getImages($target, $module_srl_list, $is_keyword, $page, 5);
|
||||
$output['file'] = $oIS->getFiles($target, $module_srl_list, $is_keyword, $page, 5);
|
||||
$output['trackback'] = new BaseObject;
|
||||
Context::set('search_result', $output);
|
||||
Context::set('search_target', 'title_content');
|
||||
$this->setTemplateFile("index", $page);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue