--- adsense.module.bak	2006-12-09 19:40:55.000000000 -0800
+++ adsense.module	2006-12-09 20:08:03.000000000 -0800
@@ -162,30 +162,30 @@ function adsense_settings() {
   );
 
   $error_flag = false;
-  if (!module_exist('profile')) {
+  if (!module_exist('profile') && (!(variable_get(ADSENSE_CLIENT_ID, '')))) {
     drupal_set_message('The profile module is not enabled. Please enable it and define a field as per instructions.', 'error');
     $error_flag = true;
   }
 
-  if (!_get_site_owner_client_id()) {
+  if (!_get_site_owner_client_id() && (!(variable_get(ADSENSE_CLIENT_ID, '')))) {
     drupal_set_message('There is no site owner Google Adsense Client ID defined. Please define a profile field, and select it below as per instructions, and enter a value for user id 1 as explained below.', 'error');
     $error_flag = true;
   }
 
-  $form['required'] = array(
+  $form['client_id'] = array(
     '#type' => 'fieldset',
     '#collapsible' => true,
     '#collapsed' => false,
-    '#title' => t('Required parameters'),
+    '#title' => t('Adsense Client ID'),
   );
   
-  $form['required'][ADSENSE_CLIENT_ID_PROFILE_FIELD] = array(
-    '#type'          => 'select',
-    '#title'         => t('Google Adsense Client ID Profile Field'),
-    '#default_value' => variable_get(ADSENSE_CLIENT_ID_PROFILE_FIELD, 0),
-    '#options'       => _adsense_get_profile_fields(),
-    '#required'      => true,
-    '#description'   => t('This is the profile field that holds the Adsense Client ID for the site owner(s) as well as for site users who (optionally) participate in revenue sharing. You must enabled the profile module and create a new field for this.'),
+  $form['client_id'][ADSENSE_CLIENT_ID] = array(
+    '#type' => 'textfield',
+    '#title' => t('Google Adsense Client ID'),
+    '#default_value' => variable_get(ADSENSE_CLIENT_ID, ''),
+    '#size' => 24,
+    '#maxlength' => 32,
+    '#description' => 'Enter your Google Adsense Client ID in this field if you do not want to use the revenue sharing option, and wish to bypass the profile.module requirement.',
   );
 
   if ($error_flag) {
@@ -302,9 +302,18 @@ function adsense_settings() {
     '#title' => t('Enable Revenue Sharing'),
     '#return_value' => 1,
     '#default_value' => variable_get(ADSENSE_REVENUE_ENABLE, 0),
-    '#description' => t('Note that enabling this will disable adsense code caching, which can cause more resource usage for busy sites. The referral feature requires the referral module to be installed.')
+    '#description' => t('Note that enabling this will disable adsense code caching, which can cause more resource usage for busy sites. In addition, revenue sharing requires the profile module to be configured per the module\'s instructions. The referral feature requires the referral module to be installed.')
     );
 
+  $form['revenue'][ADSENSE_CLIENT_ID_PROFILE_FIELD] = array(
+    '#type'          => 'select',
+    '#title'         => t('Google Adsense Client ID Profile Field'),
+    '#default_value' => variable_get(ADSENSE_CLIENT_ID_PROFILE_FIELD, 0),
+    '#options'       => _adsense_get_profile_fields(),
+    '#required'      => true,
+    '#description'   => t('This is the profile field that holds the Adsense Client ID for the site owner(s) as well as for site users who (optionally) participate in revenue sharing. You must enabled the profile module and create a new field for this.'),
+  );
+
   $form['revenue'][ADSENSE_PERCENTAGE_AUTHOR] = array(
     '#type' => 'select',
     '#title' => t('Percentage of node views going to author'),
@@ -1019,12 +1028,17 @@ function _adsense_choose_client($uid) {
 }
 
 function _get_site_owner_client_id() {
+  $client_id = variable_get(ADSENSE_CLIENT_ID, '');
+  if (!$client_id) {
+    return _get_profile_client_id(1);
+  } else {
+    return variable_get(ADSENSE_CLIENT_ID, '');
+  }
   // TODO
   // This should be expanded in the future to allow multiple site owners
   // identified by sharing a specific role. The percentage for each user
   // should be stored somewhere (profile?)
   // For the meantime, the first Drupal user is the owner of the site.
-  return _get_profile_client_id(1);
 }
 
 function _get_profile_client_id($uid = 0) {
