cum pot modifica scriptul de cautare ca sa imi caute dupa field1 >= field2 OR field3 <= field4 ? am incercat cum se arata la http://www.webreference.com/programming/php/search/ dar gresesc undeva si nu functioneaza!
Cod: Selectaţi tot
$catid = intval( JRequest::getInt('catid', -1 ));
//$text_search = JRequest::getVar('tsearch','');
$app = &JFactory::getApplication();
$text_search = $app->getUserStateFromRequest('com_adsmanager.front_content.tsearch','tsearch',"");
$itemid = intval($params->get( 'default_itemid', JRequest::getInt('Itemid', 0 ) )) ;
$advanced_search = intval($params->get( 'advanced_search', 1)) ;
$search_by_cat = intval($params->get( 'search_by_cat', 1)) ;
$fields[] = $params->get( 'field1', "") ;
$fields[] = $params->get( 'field2', "") ;
$fields[] = $params->get( 'field3', "") ;
$fields[] = $params->get( 'field4', "") ;
$fields[] = $params->get( 'field5', "") ;
$type = $params->get( 'type', "table") ;
$listfields="";
foreach($fields as $field)
{
if (($listfields == "")&&($field != ""))
$listfields .= "'$field'";
if ($field != "")
$listfields .= ",'$field'";
}
$fieldmodel = new AdsmanagerModelField();
$field_values = array();
if ($listfields != "")
{
$searchfields = $fieldmodel->getSearchModuleFields($listfields);
$field_values = $fieldmodel->getFieldValues();
foreach($searchfields as $field)
{
if ($field->cbfieldvalues != "-1")
{
/*get CB value fields */
$cbfieldvalues = $fieldmodel->getCBFieldValues($field->cbfieldvalues);
$field_values[$field->fieldid] = $cbfieldvalues;
}
}
}