<?php 
	$usrfields = explode("|", $row->extrafields);
    if (( count($usrfields) > 0) && (trim($usrfields) != '' ) ) {
	//$ufields is an array having as key the extraid and value the extra field value for the selected user
	$ufields = array();
	foreach ($usrfields as $usrfield) {
		$uf = preg_split("/[\=]/", $usrfield, 2);
		$ufid = intval($uf[0]); //if invalid then extraid=0
        $ufval = preg_split('/[\/]+/', $uf[1], -1, PREG_SPLIT_NO_EMPTY);
        if ( count($ufval) < 1 ) { $ufval = array(''); }
		if (($ufid != 0) && ($ufid != '')) {
			$ufields[$ufid] = $ufval;
		}
	}
    $query = "SELECT extraid, name FROM #__users_extra WHERE published='1'"
    ."\n AND profile='1' AND etype<>'hidden' ORDER BY ordering ASC";
	$database->setQuery( $query );
	$exxs = $database->loadObjectList();
    	for ($i = 0; $i<count($exxs); $i++) {
    		$exx = &$exxs[$i];
			$eid = $exx->extraid;
    		if ( isset($ufields[$eid]) && eUTF::utf8_trim($ufields[$eid][0]) != '' ) {
    			$lists['extra'] .= '<tr><td><strong>'.$exx->name.':</strong></td><td>'.implode(', ', $ufields[$eid]).'</td></tr>'._LEND;
    		}
		}
	}
?>