$result=db_query('SELECT name, title, type, visibility FROM {profile_fields} WHERE visibility == %d ORDER BY weight',PROFILE_PUBLIC,PROFILE_PUBLIC_LISTING);
$result=db_query('SELECT name, title, type, visibility FROM {profile_fields} WHERE visibility = %d ORDER BY weight',PROFILE_PUBLIC,PROFILE_PUBLIC_LISTING);
while($record=db_fetch_object($result)){
// Endure that field is displayed only if it is among the defined block fields and, if it is private, the user has appropriate permissions.
$result=db_query('SELECT name, title, type, visibility FROM {profile_fields} WHERE visibility == %d ORDER BY weight',PROFILE_PUBLIC,PROFILE_PUBLIC_LISTING);
$result=db_query('SELECT name, title, type, visibility FROM {profile_fields} WHERE visibility = %d ORDER BY weight',PROFILE_PUBLIC,PROFILE_PUBLIC_LISTING);
while($record=db_fetch_object($result)){
// Endure that field is displayed only if it is among the defined block fields and, if it is private, the user has appropriate permissions.