$fields = !empty($fields) ? explode( ',',$fields ) : array();
if(count($fields)>0){
$xfields = xfieldsload();
$newxfields = array();
foreach($xfields as $val){if(in_array($val[0], $fields) && $val[6]==1) {$newxfields[] = str_replace("\r\n", ",", $val[4] );}}
if(count($newxfields)>0){
$value3 = array();
foreach($newxfields as $val){
$temp_array = explode(",", $val );
foreach ($temp_array as $value2) {
$value2 = trim($value2);
$value2 = str_replace("'", "'", $value2);
if( $config['allow_alt_url'] ) $value3[] = "<a href=\"" . $config['https_home_url'] . "xfsearch/" . urlencode( $value2 ) . "/\">" . $value2 . "</a>";
else $value3[] = "<a href=\"$PHP_SELF?do=xfsearch&xf=" . urlencode( $value2 ) . "\">" . $value2 . "</a>";
}
$content = implode(", ", $value3);
}
echo $content;
}
}