diff -u'F^f' d5/sites/all/modules/profiletabs/profiletabs.info d6/sites/all/modules/profiletabs/profiletabs.info
--- d5/sites/all/modules/profiletabs/profiletabs.info	2008-04-08 11:10:18.000000000 -0400
+++ d6/sites/all/modules/profiletabs/profiletabs.info	2009-04-05 21:32:08.000000000 -0400
@@ -1,8 +1,4 @@
 ; $Id: profiletabs.info,v 1.1 2007/08/04 09:20:23 maartenvg Exp $
 name = Profile Tabs
 description = Shows profile categories as tabs when viewing user profiles
-; Information added by drupal.org packaging script on 2008-04-08
-version = "5.x-1.1"
-project = "profiletabs"
-datestamp = "1207667418"
-
+core = 6.x
diff -u'F^f' d5/sites/all/modules/profiletabs/profiletabs.install d6/sites/all/modules/profiletabs/profiletabs.install
--- d5/sites/all/modules/profiletabs/profiletabs.install	2008-04-08 10:49:21.000000000 -0400
+++ d6/sites/all/modules/profiletabs/profiletabs.install	2009-04-05 21:31:50.000000000 -0400
@@ -2,9 +2,14 @@
 // $Id: profiletabs.install,v 1.2 2008/04/08 14:49:21 maartenvg Exp $
 
 /**
+ * @file Profile tabs install file.
+ */ 
+
+/**
  * Implementation of hook_uninstall();
  */
 function profiletabs_uninstall() {
+  //remove variables
   variable_del('profiletabs_default');
   variable_del('profiletabs_hidden');
 }
diff -u'F^f' d5/sites/all/modules/profiletabs/profiletabs.module d6/sites/all/modules/profiletabs/profiletabs.module
--- d5/sites/all/modules/profiletabs/profiletabs.module	2008-04-08 10:49:21.000000000 -0400
+++ d6/sites/all/modules/profiletabs/profiletabs.module	2009-04-05 21:40:57.000000000 -0400
@@ -4,44 +4,49 @@
 /**
  * Implementation of hook_menu().
  */
-function profiletabs_menu($may_cache) {
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'admin/settings/profiletabs',
-      'title' => t('Profile Tabs'),
-      'description' => t('Administer the profile tabs. Which are shown and which is the default.'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('profiletabs_admin_settings'),
-      'access' => user_access('administer site configuration'),
-    );
-  }
-  else {
-    // Are we at a profile? Continue
-    if (arg(0) == 'user' && is_numeric(arg(1)) && arg(1) > 0) {
-      // Load profile owner
-      $account = user_load(array('uid' => arg(1)));
-    
-      $categories = module_invoke_all('user', 'view', '', $account);
-      $default = variable_get('profiletabs_default', t('History'));
-      $hidden = variable_get('profiletabs_hidden', array());
-
-      // If the current default tab isn't visible (e.g. when you select a tab that
-      // is only visible for admins) default to the History-tab.
-      if (!isset($categories[$default])) {
-        $default = t('History');
-      }
+function profiletabs_menu() {
+  global $user;
+  $items = array();
+
+  // Profile tabs admin settings.
+  $items['admin/settings/profiletabs'] = array(
+      'title'            => 'Profile Tabs',
+      'description'      => 'Administer the profile tabs. Which are shown and which is the default.',
+      'page callback'    => 'drupal_get_form',
+      'page arguments'   => array('profiletabs_admin_settings'),
+      'access arguments' => array('administer site configuration')
+  );
+
+  // Get profile categories
+  $content = _profiletabs_get_categories($user);
+
+  // Get default tab
+  $default = variable_get('profiletabs_default', t('History'));
+  // Get hidden tabs
+  $hidden = variable_get('profiletabs_hidden', array());
+
+  // Default tab
+  $items['user/%user/view/'. $default] = array(
+    'title'  => $default,
+    'type'   => MENU_DEFAULT_LOCAL_TASK,
+    'weight' => 2,
+  );
 
-      if ($account !== FALSE) {
-        // Make tabs for all non-hidden categories
-        foreach ($categories as $key => $category) {
-          if (empty($hidden[$key])) {
-            $items[] = array(
-              'path' => 'user/'. arg(1) .'/view/'. $key,
-              'title' => $key,
-              'type' => $key == $default ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
-            );
-          }
-        }
+  // Other tabs
+  foreach ($content AS $key => $field) {
+    $title = $field['#title'];
+    if ($default != $title && $title != NULL) {
+      if (empty($hidden[$title])) {
+        $items['user/%user/view/'. $title] = array(
+          'title'           => $title,
+          'type'            => MENU_LOCAL_TASK,
+          'page callback'   => 'user_view',
+          'page arguments'  => array(1),
+          'access callback' => TRUE,
+          'file'            => 'user.pages.inc',
+          'file path'       => drupal_get_path('module', 'user'),
+          'weight' => 3,
+        );
       }
     }
   }
@@ -49,6 +54,15 @@ function profiletabs_menu($may_cache) {
 }
 
 /**
+ * Get profile categories
+ */
+function _profiletabs_get_categories(&$account) {
+  $edit = NULL;
+  user_module_invoke('view', $edit, $account);
+  return $account->content;
+}
+
+/**
  * Generate settings form.
  */
 function profiletabs_admin_settings() {
@@ -62,28 +76,39 @@ function profiletabs_admin_settings() {
   }
 
   $form['profiletabs_default'] = array(
-    '#type' => 'select',
-    '#title' => t('Default category'),
+    '#type'          => 'select',
+    '#title'         => t('Default category'),
     '#default_value' => variable_get('profiletabs_default', t('History')),
-    '#description' => t('Choose which profile category should be shown by default.'),
-    '#options' => $options,
+    '#description'   => t('Choose which profile category should be shown by default.'),
+    '#options'       => $options,
   );
   
+  //Form for hidden tabs
   $form['profiletabs_hidden'] = array(
-    '#type' => 'checkboxes',
-    '#title' => t('Hidden tabs'),
+    '#type'          => 'checkboxes',
+    '#title'         => t('Hidden tabs'),
     '#default_value' => variable_get('profiletabs_hidden', array()),
-    '#description' => t('Choose which categories should not have a tab on its own, but should be shown on the default tab.'),
-    '#options' => $options,
+    '#description'   => t('Choose which categories should not have a tab on its own, but should be shown on the default tab.'),
+    '#options'       => $options,
   );
-  return system_settings_form($form);
+  
+  $form = system_settings_form($form);
+  $form['#submit'][] = 'profiletabs_admin_settings_submit';
+  return $form;
+}
+
+/**
+* Rebuild profile tabs on submit
+*/
+function profiletabs_admin_settings_submit($form, $form_state) {
+  menu_rebuild();
 }
 
 
 /**
  *  Implementation of hook_profile_alter().
  */
-function profiletabs_profile_alter(&$account, &$fields) {
+function profiletabs_profile_alter(&$account) {  
   // Which tab are we trying to see?
   $goal = arg(3);
   
@@ -94,7 +119,7 @@ function profiletabs_profile_alter(&$acc
 
   // If the current default tab isn't visible (e.g. when you select a tab that
   // is only visible for admins) default to the History-tab.
-  if (!isset($fields[$default])) {
+  if (!isset($account->content[$default])) {
     $default = t('History');
   }
 
@@ -109,9 +134,10 @@ function profiletabs_profile_alter(&$acc
   
   // Remove all fields that are not to be shown on this tab, i.e. fields that are not
   // the current field and tabs that are hidden and it isn't the default tab.
-  foreach ($fields as $key => $field) {
-    if ($key!=$goal && !(!empty($hidden[$key]) && $default_check)) {
-      unset($fields[$key]);
+  foreach ($account->content AS $key => $field) {
+    $title = $field['#title'];
+    if ($title != $goal) {
+      unset($account->content[$key]);
     }
   }
 }
