? example.patch
Index: ohloh.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ohloh/Attic/ohloh.module,v
retrieving revision 1.3
diff -u -p -r1.3 ohloh.module
--- ohloh.module	2 Oct 2007 16:54:28 -0000	1.3
+++ ohloh.module	19 May 2009 20:25:32 -0000
@@ -38,8 +38,6 @@ function ohloh_user($type, &$edit, &$use
       ohloh_view_profile($user);
     case 'form':
       return ohloh_form_profile($edit, $user, $category);
-    case 'validate':
-      return ohloh_validate_profile($edit, $category);
     case 'delete':
       db_query('DELETE FROM {variable} WHERE name = \'ohloh_%d\'', $user->uid);
   }
@@ -59,10 +57,10 @@ function ohloh_form_profile($edit, $user
     );
     $fields['Ohloh']['Ohloh'] = array(
       '#type' => 'textfield',
-      '#title' => t('Ohloh Account Number'),
+      '#title' => t('Ohloh account'),
       '#default_value' => isset($edit['Ohloh']) ? $edit['Ohloh'] : $user->ohloh,
       '#maxlength' => 7,
-      '#description' => t('Insert your <a href="@ohloh" target="_blank">Ohloh</a> account number (e.g. 5397).', array('@ohloh' => 'http://www.ohloh.net')),
+      '#description' => t('Insert your <a href="@ohloh" target="_blank">Ohloh</a> account identifier (i.e. ohloh.net/accounts/YOURID).', array('@ohloh' => 'http://www.ohloh.net')),
       '#required' => false,
     );
   }
@@ -70,18 +68,6 @@ function ohloh_form_profile($edit, $user
 } // function ohloh_form_profile
 
 /**
-* Validates the profile input for the ohloh account information
-*/
-function ohloh_validate_profile($edit, $category) {
-  if ($edit['Ohloh']) {
-    if (!is_numeric($edit['Ohloh']) || $edit['Ohloh'] <= 0) {
-      form_set_error('Ohloh', t('The value provided for the Ohloh account information is not valid.'));
-    }
-  }
-  return $edit; 
-} // function ohloh_validate_profile
-
-/**
 * Loads the Ohloh account information from the database into the user account
 */
 function ohloh_load_profile(&$user) {
@@ -117,7 +103,7 @@ function ohloh_view_profile(&$user) {
 } // function ohloh_view_profile
 
 /**
-* Private Ohloh function to create a badge for the given Ohloh account number.
+* Private Ohloh function to create a badge for the given Ohloh account ID.
 */  
 function _ohloh_create_badge($ohloh = '', $username = '', $badge_type = 'detailed') {
   if (empty($ohloh)) return '';
@@ -156,7 +142,7 @@ function ohloh_block($op = 'list', $delt
       return $block;
     case 'view':
       if ($delta == 0) {
-        $account = variable_get('ohloh_block_account_number', '');
+        $account = variable_get('ohloh_block_account_id', '');
         $badge_type = variable_get('ohloh_block_badge_type', 'detailed');
         if ($account) {
           $block = array(
@@ -178,7 +164,7 @@ function ohloh_block($op = 'list', $delt
       return $block;
     case 'save':
       if ($delta == 0) {
-        variable_set('ohloh_block_account_number', $edit['account_number']);
+        variable_set('ohloh_block_account_id', $edit['account_id']);
         variable_set('ohloh_block_badge_type', $edit['badge_type']);
       }
       break;
@@ -190,11 +176,11 @@ function ohloh_block($op = 'list', $delt
           '#collapsible' => TRUE,
           '#collapsed' => FALSE,
         );
-        $form['ohloh']['account_number'] = array(
+        $form['ohloh']['account_id'] = array(
           '#type' => 'textfield',
           '#title' => t('Ohloh Account Number'),
-          '#description' => t('Insert the <a href="@ohloh" target="_blank">Ohloh</a> account number you want to display here (e.g. 5397). Leave blank to display the current user\'s Ohloh badge.', array('@ohloh' => 'http://www.ohloh.net')),
-          '#default_value' => variable_get('ohloh_block_account_number', ''),
+          '#description' => t('Insert the <a href="@ohloh" target="_blank">Ohloh</a> account id you want to display here (e.g. 5397). Leave blank to display the current user\'s Ohloh badge.', array('@ohloh' => 'http://www.ohloh.net')),
+          '#default_value' => variable_get('ohloh_block_account_id', ''),
         );
         $form['ohloh']['badge_type'] = array(
           '#type' => 'select',
