本文整理汇总了PHP中FlexicontentFields::onIndexAdvSearch方法的典型用法代码示例。如果您正苦于以下问题:PHP FlexicontentFields::onIndexAdvSearch方法的具体用法?PHP FlexicontentFields::onIndexAdvSearch怎么用?PHP FlexicontentFields::onIndexAdvSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlexicontentFields
的用法示例。
在下文中一共展示了FlexicontentFields::onIndexAdvSearch方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onIndexAdvSearch
public function onIndexAdvSearch(&$field, &$post, &$item)
{
if (!in_array($field->field_type, self::$field_types)) {
return;
}
if (!$field->isadvsearch && !$field->isadvfilter) {
return;
}
FlexicontentFields::onIndexAdvSearch($field, $post, $item, $required_properties = array('originalname'), $search_properties = array('title', 'desc'), $properties_spacer = ' ', $filter_func = null);
return true;
}
示例2: onIndexAdvSearch
function onIndexAdvSearch(&$field, &$post, &$item)
{
if (!in_array($field->field_type, self::$field_types)) {
return;
}
if (!$field->isadvsearch && !$field->isadvfilter) {
return;
}
$field->isindexed = true;
$field->extra_props = self::$extra_props;
FlexicontentFields::onIndexAdvSearch($field, $post, $item, $required_properties = array(), $search_properties = array('text'), $properties_spacer = ' ', $filter_func = null);
return true;
}
示例3: onIndexAdvSearch
function onIndexAdvSearch(&$field, &$post, &$item)
{
if (!in_array($field->field_type, self::$field_types)) {
return;
}
if (!$field->isadvsearch && !$field->isadvfilter) {
return;
}
// a. Each of the values of $values array will be added to the advanced search index as searchable text (column value)
// b. Each of the indexes of $values will be added to the column 'value_id',
// and it is meant for fields that we want to be filterable via a drop-down select
// c. If $values is null then only the column 'value' will be added to the search index after retrieving
// the column value from table 'flexicontent_fields_item_relations' for current field / item pair will be used
// 'required_properties' is meant for multi-property fields, do not add to search index if any of these is empty
// 'search_properties' contains property fields that should be added as text
// 'properties_spacer' is the spacer for the 'search_properties' text
// 'filter_func' is the filtering function to apply to the final text
FlexicontentFields::onIndexAdvSearch($field, $post, $item, $required_properties = array('title'), $search_properties = array('title', 'text'), $properties_spacer = ' ', $filter_func = 'strip_tags');
return true;
}
示例4: onIndexAdvSearch
function onIndexAdvSearch(&$field, &$post, &$item)
{
if (!$field->iscore) {
return;
}
if (!$field->isadvsearch && !$field->isadvfilter) {
return;
}
$values = $this->_prepareForSearchIndexing($field, $post, $for_advsearch = 1);
$filter_func = $field->field_type == 'maintext' ? 'strip_tags' : null;
$field->isindexed = in_array($field->field_type, array('type', 'state', 'tags', 'categories', 'created', 'createdby', 'modified', 'modifiedby'));
FlexicontentFields::onIndexAdvSearch($field, $values, $item, $required_properties = array(), $search_properties = array(), $properties_spacer = ' ', $filter_func);
return true;
}
示例5: onIndexAdvSearch
function onIndexAdvSearch(&$field, &$post, &$item)
{
if ( !in_array($field->field_type, self::$field_types) ) return;
if ( !$field->isadvsearch && !$field->isadvfilter ) return;
FlexicontentFields::onIndexAdvSearch($field, $post, $item, $required_properties=array('url'), $search_properties=array('title','author','description','audiotype'), $properties_spacer=' ', $filter_func=null);
return true;
}
示例6: onIndexAdvSearch
function onIndexAdvSearch(&$field, &$post, &$item)
{
if (!in_array($field->field_type, self::$field_types)) {
return;
}
if (!$field->isadvsearch && !$field->isadvfilter) {
return;
}
if ($post === null) {
$values = null;
$field->field_valuesselect = ' CAST(fi.value AS UNSIGNED) AS value_id, ct.title AS value';
$field->field_valuesjoin = ' JOIN #__content AS ct ON ct.id = CAST(fi.value AS UNSIGNED)';
$field->field_groupby = ' GROUP BY CAST(fi.value AS UNSIGNED) ';
} else {
if (!empty($post)) {
$_ids = array();
foreach ($post as $_id) {
$_ids[] = (int) $_id;
}
// convert itemID:catID to itemID
$db = JFactory::getDBO();
$query = 'SELECT i.id AS value_id, i.title AS value FROM #__content AS i WHERE i.id IN (' . implode($_ids, ',') . ')';
$db->setQuery($query);
$_values = $db->loadAssocList();
$values = array();
foreach ($_values as $v) {
$values[$v['value_id']] = $v['value'];
}
}
}
//JFactory::getApplication()->enqueueMessage('ADV: '.print_r($values, true), 'notice');
FlexicontentFields::onIndexAdvSearch($field, $values, $item, $required_properties = array(), $search_properties = array(), $properties_spacer = ' ', $filter_func = null);
return true;
}
示例7: onIndexAdvSearch
function onIndexAdvSearch(&$field, &$post, &$item)
{
if (!in_array($field->field_type, self::$field_types)) {
return;
}
if (!$field->isadvsearch && !$field->isadvfilter) {
return;
}
if ($post === null) {
// null indicates that indexer is running, values is set to NULL which means retrieve data from the DB
$values = null;
$field->field_rawvalues = 1;
$field->field_valuesselect = ' file.id AS value_id, file.altname, file.description, file.filename';
$field->field_valuesjoin = ' JOIN #__flexicontent_files AS file ON file.id = fi.value';
$field->field_groupby = null;
} else {
$_files_data = $this->getFileData($post, $published = true, $extra_select = ', id AS value_id');
$values = array();
if ($_files_data) {
foreach ($_files_data as $_file_id => $_file_data) {
$values[$_file_id] = (array) $_file_data;
}
}
}
FlexicontentFields::onIndexAdvSearch($field, $values, $item, $required_properties = array('filename'), $search_properties = array('altname', 'description'), $properties_spacer = ' ', $filter_func = 'strip_tags');
return true;
}
示例8: onIndexAdvSearch
function onIndexAdvSearch(&$field, &$post, &$item) {
if ( !in_array($field->field_type, self::$field_types) ) return;
if ( !$field->isadvsearch && !$field->isadvfilter ) return;
FlexicontentFields::onIndexAdvSearch($field, $post, $item, $required_properties=array(), $search_properties=array(), $properties_spacer=' ', $filter_func='strip_tags');
return true;
}
示例9: onIndexAdvSearch
function onIndexAdvSearch(&$field, &$post, &$item)
{
if ( !in_array($field->field_type, self::$field_types) ) return;
if ( !$field->isadvsearch && !$field->isadvfilter ) return;
FlexicontentFields::onIndexAdvSearch($field, $post, $item, $required_properties=array(), $search_properties=array('addr1','addr2','addr3','city','state','province','zip','country'), $properties_spacer=' ', $filter_func=null);
return true;
}
示例10: onIndexAdvSearch
function onIndexAdvSearch(&$field, &$post, &$item)
{
if ( !$field->iscore ) return;
if ( !$field->isadvsearch && !$field->isadvfilter ) return;
$values = $this->_prepareForSearchIndexing($field, $post, $for_advsearch=1);
$filter_func = $field->field_type == 'maintext' ? 'strip_tags' : null;
FlexicontentFields::onIndexAdvSearch($field, $values, $item, $required_properties=array(), $search_properties=array(), $properties_spacer=' ', $filter_func);
return true;
}
示例11: onIndexAdvSearch
function onIndexAdvSearch(&$field, &$post, &$item)
{
if ( !in_array($field->field_type, self::$field_types) ) return;
if ( !$field->isadvsearch && !$field->isadvfilter ) return;
if ($post) {
$_files_data = $this->getFileData( $post, $published=true, $extra_select =', id AS value_id' );
$values = array();
if ($_files_data) foreach($_files_data as $_file_id => $_file_data) $values[$_file_id] = (array)$_file_data;
} else {
$field->field_rawvalues = 1;
$field->field_valuesselect = ' file.id AS value_id, file.altname, file.description, file.filename';
$field->field_valuesjoin = ' JOIN #__flexicontent_files AS file ON file.id = fi.value';
$field->field_groupby = null;
}
FlexicontentFields::onIndexAdvSearch($field, $values, $item, $required_properties=array('filename'), $search_properties=array('altname', 'description'), $properties_spacer=' ', $filter_func='strip_tags');
return true;
}
示例12: onIndexAdvSearch
function onIndexAdvSearch(&$field, &$post, &$item) {
if ($field->field_type != 'phonenumbers') return;
if ( !$field->isadvsearch ) return;
FlexicontentFields::onIndexAdvSearch($field, $post, $item, $required_properties=array(), $search_properties=array(), $properties_spacer=' ', $filter_func=null);
return true;
}