GetFieldByName($FieldTypesOrFieldName)); } else { $Fields = $Schema->GetFields($FieldTypesOrFieldName); } # set up a counter for the loop $Counter = 0; foreach ($Fields as $CurrentField) { # if limit field is marked to be used in Advanced Search if ($CurrentField->Enabled() && $CurrentField->IncludeInAdvancedSearch() && ($G_User->HasPriv($CurrentField->ViewingPrivileges()) || $G_User->HasPriv($CurrentField->EditingPrivileges()) )) { if (($CurrentField->Type() & (MetadataSchema::MDFTYPE_OPTION | MetadataSchema::MDFTYPE_FLAG | MetadataSchema::MDFTYPE_USER)) || $CurrentField->Name() == "Cumulative Rating") { # print entry and increment counter if ($Counter) { print(", "); } print("".strtolower($CurrentField->GetDisplayName()).""); $Counter++; } } if (is_numeric($ListLength) && $Counter >= $ListLength) { print(", and more"); break; } } } # print a search limit form entry function PrintSearchLimitFormEntry($LimitName, $LimitType) { if ($LimitType & (MetadataSchema::MDFTYPE_OPTION | MetadataSchema::MDFTYPE_FLAG | MetadataSchema::MDFTYPE_USER)) { $ListLength = ($LimitType == MetadataSchema::MDFTYPE_FLAG) ? 1 : 6; ?>