+ $objSearchConfig->Query_Item("SELECT * FROM ".$objSearchConfig->SourceTable." WHERE TableName='$SearchSource' AND AdvancedSearch=1 ORDER BY DisplayOrder");
+ }
+ else {
+ $tables = Array(1 => 'Category', 2 => 'News',
+ 3 => 'Topic', 4 => 'Link',
+ 11 => 'Products');
+ $table = $tables[$ItemType];
+ $sql = "SELECT sc.* FROM ".$objSearchConfig->SourceTable." AS sc LEFT JOIN ".GetTablePrefix()."CustomField AS cf ON sc.CustomFieldId = cf.CustomFieldId WHERE TableName='$table' OR ((TableName='".GetTablePrefix()."CustomField' OR TableName='CustomField') AND cf.Type = $ItemType) AND AdvancedSearch=1 ORDER BY sc.DisplayOrder";
+ $objSearchConfig->Query_Item($sql);
+ }
+ }
+
+ function SetResultTable($SearchSource,$DataClass)
+ $SelectSQL = "SELECT ".$this->SourceTable.".".$idField." as ItemId, ". $this->SourceTable.".Priority as Relevance, ".$this->SourceTable.".ResourceId, CONCAT($typestr) as ItemType, EditorsPick as EdPick FROM ".$this->SourceTable." ";
+
+ foreach($this->Relationships as $JoinTable=>$OnClause)
+ {
+ $SelectSQL .= "LEFT JOIN $JoinTable ON ($OnClause) ";
+ }
+ $first=1;
+ $WhereClause = $this->BuildWhereClause();
+ if(strlen($WhereClause)>0)
+ {
+ $SelectSQL .= " WHERE ".$WhereClause;
+ }
+ $SelectSQL .= " GROUP BY $idField ";
+ //echo $SelectSQL;
+ $this->adodbConnection->Execute("DROP TABLE IF EXISTS ".$this->ResultTable);