[!AjaxSearch? &AS_showResults=`0` &AS_showForm=`1` &language=`english` &debug=`0` &ajaxSearch=`0` &ajaxSearchType=`0` &hideMenu=`2` &hideLink=`1` &depth=`10` &grabMax=`10` &AS_landing=`44` &parents=`31` &filter=`type,reference,2|searchable,1,1` &mbstring=`0` !]
« MODx Parse Error » MODx encountered the following error while attempting to parse the requested resource: « PHP Parse Error » PHP error debug Error: array_filter() [function.array-filter]: The first argument should be an array Error type/ Nr.: Warning - 2 File: .../modx-0.9.6.3/assets/snippets/ajaxSearch/classes/filter.class.inc.php Line: 34 Line 34 source: $resource = array_filter($resource, array($this, "basicFilter")); Parser timing MySQL: 0.1333 s (28 Requests) PHP: 0.9415 s Total: 1.0748 s
&filter=`type,reference,2|searchable,1,1`Regarding http://ditto.modxcms.com/tutorials/basic_filtering.html you would like exclude all documents of type reference or documents not (equal to) searchable
[!AjaxSearch? &AS_showResults=`0` &AS_showForm=`1` &language=`english` &debug=`0` &ajaxSearch=`0` &grabMax=`10` &AS_landing=`44` &parents=`31` &mbstring=`0` !]
// get the rows linked to the unfiltered listIDs
$rs = $this->doSearch();
while ($row = mysql_fetch_assoc($rs)) {
$rows[] = $row;
}
// filter the listIDs
if (!class_exists('asFilter')) include_once AS_PATH . "classes/filter.class.inc.php";
$filter = new asFilter();
$rows = $filter->execute($rows,$parsedFilters);
// filter the listIDs
if (!class_exists('asFilter')) include_once AS_PATH . "classes/filter.class.inc.php";
$filter = new asFilter();
$rows = $filter->execute($rows,$parsedFilters);
if (count($rows) > 0) {
foreach ($rows as $key => $value) {
$filteredIDs[] = $value[$this->main['id']];
}
$this->listIDs = implode(',',$filteredIDs);
}
// get the rows linked to the unfiltered listIDs
$rs = $this->doSearch();
if ($modx->getRecordCount($rs) > 0){
$rows = array();
while ($row = mysql_fetch_assoc($rs)) {
$rows[] = $row;
}
// filter the listIDs
if (!class_exists('asFilter')) include_once AS_PATH . "classes/filter.class.inc.php";
$filter = new asFilter();
$rows = $filter->execute($rows,$parsedFilters);
if (count($rows) > 0) {
foreach ($rows as $key => $value) {
$filteredIDs[] = $value[$this->main['id']];
}
$this->listIDs = implode(',',$filteredIDs);
}
}