--- user_terms.module.original	2009-06-06 02:27:11.000000000 +0530
+++ user_terms.module.modified	2009-06-27 11:52:55.000000000 +0530
@@ -145,10 +145,11 @@ function user_terms_view_profile(&$accou
  */
 function user_terms_form_profile($edit, $account, $category, $register = FALSE) {
   $form  = array();
-  $vid = variable_get('user_terms_vocabulary', -1);
-
+  $vids = variable_get('user_terms_vocabulary', -1);
+  $vocab_count = count($vids);
+  
   // Skip everything if no user term vocabulary is selected.
-  if ($vid != -1) {
+  if ($vids != -1 && $vocab_count) {
 
     $default = NULL;
     if (!$register) {
@@ -156,22 +157,37 @@ function user_terms_form_profile($edit, 
       $default = empty($user->user_terms) ? array() : array_keys($user->user_terms);
     }
 
-    $vocab = taxonomy_vocabulary_load($vid);
-    $vocab_title = variable_get('user_terms_title', $vocab->name);
-    $vocab_desc  = variable_get('user_terms_description', $vocab->description);
-
     $form['user_terms'] = array(
       '#type'        => 'fieldset',
-      '#title'       => $vocab_title,
-      '#description' => $vocab_desc,
+      '#title'			 => 'User terms'
+    );  
+    
+    $form['vocab_count'] = array(
+      '#type'	  => 'value',
+      '#value'	=> $vocab_count
     );
-      $form['user_terms']['user_terms'] = array(
+    
+    $i = 1; //start vocab_index from 1     
+    foreach ($vids as $vid)  {
+      $vocab = taxonomy_vocabulary_load($vid);
+      $vocab_title = variable_get('user_terms_title', $vocab->name);
+      $vocab_desc  = variable_get('user_terms_description', $vocab->description);
+      
+      if (!$vocab_title)
+        $vocab_title = $vocab->name;
+      if (!$vocab_desc)
+        $vocab_desc = $vocab->description;      
+      
+      $form['user_terms']['user_terms_' . $i] = array(
         '#type'     => 'select',
         '#multiple' => TRUE,
         '#title'    => $vocab_title,
         '#options'  => _user_terms_term_select_options($vid),
         '#default_value' => $default,
-      );
+        '#description' => $vocab_desc,
+      );      
+      $i++;
+    }
   }
 
   return $form;
@@ -200,6 +216,18 @@ function _user_terms_term_select_options
 
 
 function user_terms_save_profile(&$edit, &$account, $category, $register = FALSE) {
+  
+  //merge all terms into one array
+  $vocab_count = $edit['vocab_count'];
+  
+  $i = 1; //vocab index starts from 1
+  $user_terms = array();
+  while ($i <= $vocab_count) {    
+    $user_terms = array_merge($user_terms, $edit['user_terms_' . $i]);
+    $i++;
+  }
+  $edit['user_terms'] = $user_terms; 
+  
   // Clear existing if not inserting.
   if (!$register) {
     $query = "DELETE FROM {term_user} WHERE uid = %d";
@@ -226,25 +254,27 @@ function user_terms_save_profile(&$edit,
 function user_terms_settings() {
   $form    = array();
   $vocabs  = taxonomy_get_vocabularies();
-  $options = array(
+  //removing the 'none' option
+  /*$options = array(
     -1 => t('None'),
-  );
+  );*/
 
   foreach ($vocabs as $vid => $voc) {
     $options[$vid] = $voc->name;
   }
 
-  $description = t('Chose the vocabulary that will be used to tag users.');
+  $description = t('Choose the vocabularies that will be used to tag users. Note: (Ctrl + click) to select multiple options and to unselect a selected option');
 
   $form['user_terms_vocabulary'] = array(
     '#type'          => 'select',
-    '#title'         => t('User Vocabulary'),
+    '#title'         => t('User Vocabularies'),
     '#options'       => $options,
     '#description'   => $description,
     '#default_value' => variable_get('user_terms_vocabulary', -1),
+    '#multiple'			 => true
   );
 
-  $description = t('When the terms are presented to the user for selection, this text will be used to label the form elements for selecting those terms. For example, for selecting user hobbies, this might be "Hobbies".');
+  $description = t('When the terms are presented to the user for selection, this text will be used to label the form elements for selecting those terms. For example, for selecting user hobbies, this might be "Hobbies". Leave this blank in case of multiple vocabularies.');
   $form['user_terms_title'] = array(
     '#type'          => 'textfield',
     '#title'         => t('Vocabulary Display Title'),
@@ -253,7 +283,7 @@ function user_terms_settings() {
     '#size'          => 32,
   );
 
-  $description = t('This description will be displayed with the terms on the user profile page and should provide an explanation to the user what these terms are for.');
+  $description = t('This description will be displayed with the terms on the user profile page and should provide an explanation to the user what these terms are for. Leave this blank in case of multiple vocabularies.');
   $form['user_terms_description'] = array(
     '#type'          => 'textarea',
     '#title'         => t('Vocabulary Explanation'),
@@ -280,6 +310,5 @@ function user_terms_settings() {
       '#default_value' => variable_get('user_terms_profile_path', 0),
     );
   }
-
   return system_settings_form($form);
 }
