Index: profile_privacy.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/profile_privacy/profile_privacy.module,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 profile_privacy.module
--- profile_privacy.module	18 Jul 2008 21:46:32 -0000	1.2.2.1
+++ profile_privacy.module	21 Jul 2008 18:47:47 -0000
@@ -32,9 +32,19 @@ function profile_privacy_user($op, &$edi
               $field->visibility = PROFILE_PUBLIC;
               if ($value = profile_view_field($account, $field)) {
                 $title = ($field->type != 'checkbox') ? check_plain($field->title) : NULL;
-                $item = array('title' => $title,
-                  'value' => $value,
-                  'class' => $field->name,
+                // Create a single fieldset for each category.
+                if (!isset($account->content[$field->category])) {
+                  $account->content[$field->category] = array(
+                    '#type' => 'user_profile_category',
+                    '#title' => $field->category,
+                  );
+                }
+                $item = array('#title' => $title,
+                  '#value' => $value,
+                  '#class' => $field->name,
+                  '#type' => 'user_profile_item',
+                  '#weight' => $field->weight,
+                  '#attributes' => array('class' => 'profile-'. $field->name),
                 );
                 // TODO: This currently appends the now visible field to the end
                 // of other profile fields, should insert in original position.
