--- modules/profile.module.orig	2006-06-16 19:15:30.000000000 -0400
+++ modules/profile.module	2006-06-20 18:18:50.408400376 -0400
@@ -26,6 +26,7 @@ function profile_help($section) {
 <li>single-line textfield</li>
 <li>multi-line textfield</li>
 <li>checkbox</li>
+<li>checkbox group</li>
 <li>list selection</li>
 <li>freeform list</li>
 <li>URL</li>
@@ -240,6 +241,14 @@ function profile_field_form($arg = NULL)
       '#description' => t('A list of all options. Put each option on a separate line. Example options are "red", "blue", "green", etc.'),
     );
   }
+  if ($type == 'checkboxes') {
+    $form['fields']['options'] = array('#type' => 'textarea',
+      '#title' => t('Checkbox options'),
+      '#default_value' => $edit['options'],
+      '#description' => t('A list of all options. Put each option on a separate line. Example options are "red", "blue", "green", etc.'),
+    );
+  }
+
   $form['fields']['weight'] = array('#type' => 'weight',
     '#title' => t('Weight'),
     '#default_value' => $edit['weight'],
@@ -251,7 +260,7 @@ function profile_field_form($arg = NULL)
     '#default_value' => isset($edit['visibility']) ? $edit['visibility'] : PROFILE_PUBLIC,
     '#options' => array(PROFILE_HIDDEN => t('Hidden profile field, only accessible by administrators, modules and themes.'), PROFILE_PRIVATE => t('Private field, content only available to privileged users.'), PROFILE_PUBLIC => t('Public field, content shown on profile page but not used on member list pages.'), PROFILE_PUBLIC_LISTINGS => t('Public field, content shown on profile page and on member list pages.')),
   );
-  if ($type == 'selection' || $type == 'list' || $type == 'textfield') {
+  if ($type == 'selection' || $type == 'list' || $type == 'textfield' || $type == 'checkboxes') {
     $form['fields']['page'] = array('#type' => 'textfield',
       '#title' => t('Page title'),
       '#default_value' => $edit['page'],
@@ -396,7 +405,6 @@ function profile_admin_overview() {
  * Menu callback; display a list of user information.
  */
 function profile_browse() {
-
   $name = arg(1);
   list(,,$value) = explode('/', $_GET['q'], 3);
 
@@ -436,6 +444,10 @@ function profile_browse() {
         $query = "v.value LIKE '%%%s%%'";
         $arguments[] = $value;
         break;
+      case 'checkboxes':
+        $query = "v.value LIKE '%%%s%%'";
+        $arguments[] = $value;
+        break;
       default:
         drupal_not_found();
         return;
@@ -451,10 +463,12 @@ function profile_browse() {
       $output .= theme('profile_listing', $account, $profile);
     }
     $output .= theme('pager', NULL, 20);
-
-    if ($field->type == 'selection' || $field->type == 'list' || $field->type == 'textfield') {
-      $title = strtr($field->page, array('%value' => theme('placeholder', $value)));
+    
+    if ($field->type == 'selection' || $field->type == 'list' || $field->type == 'textfield' || $field->type == 'checkboxes') {
+       $title = strtr($field->page, array('%value' => theme('placeholder', $value)));
     }
+    
+    
     else {
       $title = $field->page;
     }
@@ -470,6 +484,7 @@ function profile_browse() {
     // Compile a list of fields to show.
     $fields = array();
     $result = db_query('SELECT name, title, type, weight FROM {profile_fields} WHERE visibility = %d ORDER BY category, weight', PROFILE_PUBLIC_LISTINGS);
+
     while ($record = db_fetch_object($result)) {
       $fields[] = $record;
     }
@@ -560,6 +575,15 @@ function profile_view_field($user, $fiel
           }
         }
         return implode(', ', $fields);
+
+      case 'checkboxes':
+        $values = split("[,\n\r]", $value);
+        $fields = array();
+        foreach ($values as $value) {
+          if ($value = trim($value)) {
+            $fields[] = $browse ? l($value, 'profile/'. $field->name .'/'. $value) : check_plain($value);
+          }
+        }
     }
   }
 }
@@ -659,6 +683,27 @@ function profile_form_profile($edit, $us
           '#required' => $field->required,
         );
         break;
+
+      case 'checkboxes':
+        $options = array();
+        $lines = split("[,\n\r]", $field->options);
+        foreach ($lines as $line) {
+          if ($line = trim($line)) {
+            $options[$line] = $line;
+          }
+        } 
+        
+         $fields[$category][$field->name] = array('#type' => 'checkboxes',
+          '#title' => check_plain($field->title),
+          '#default_value' => $edit[$field->name],
+          '#options' => $options,
+          '#description' => _profile_form_explanation($field),
+          '#required' => $field->required,
+        );
+
+        break;
+        
+        
       case 'selection':
         $options = $field->required ? array() : array('--');
         $lines = split("[,\n\r]", $field->options);
@@ -675,6 +720,8 @@ function profile_form_profile($edit, $us
           '#required' => $field->required,
         );
         break;
+        
+        
       case 'date':
         $fields[$category][$field->name] = array('#type' => 'date',
           '#title' => check_plain($field->title),
@@ -776,6 +823,7 @@ function _profile_field_types($type = NU
   $types = array('textfield' => t('single-line textfield'),
                  'textarea' => t('multi-line textfield'),
                  'checkbox' => t('checkbox'),
+                 'checkboxes' => t('checkbox group'),
                  'selection' => t('list selection'),
                  'list' => t('freeform list'),
                  'url' => t('URL'),
@@ -784,5 +832,5 @@ function _profile_field_types($type = NU
 }
 
 function _profile_field_serialize($type = NULL) {
-  return $type == 'date';
+  return $type == 'date' || $type == 'checkboxes';
 }
