--- civicrm_theme.module.bak	2007-03-01 04:14:21.000000000 -0800
+++ civicrm_theme.module	2008-06-05 19:50:07.000000000 -0700
@@ -6,7 +6,20 @@
   }
   elseif (arg(0) == 'civicrm') {
     global $custom_theme;
-    $theme_var = arg(1) == 'admin' ? 'civicrm_admin_theme' : 'civicrm_theme';
+    
+    if (arg(1) == 'admin' ) {      
+        $theme_var = 'civicrm_admin_theme';
+    }
+    else {
+        $public_paths = explode(' ', variable_get('civicrm_theme_public_pages', 'event profile'));
+        if (in_array(arg(1), $public_paths)) {
+          $theme_var = 'civicrm_public_theme';
+        }
+        else {
+          $theme_var = 'civicrm_theme';
+        }
+    }
+    
     if (($custom_theme = variable_get($theme_var, '0')) != '0') {
       $path = drupal_get_path('module', 'system');
       drupal_add_css($path .'/admin.css', 'module');
@@ -31,6 +44,20 @@
       '#description' => t('Choose which theme the CiviCRM user pages should display in.'),
       '#default_value' => variable_get('civicrm_theme', ''),
     );
+    $newform['civicrm_public_theme'] = array(
+      '#type' => 'select',
+      '#options' => $form['admin_theme']['#options'],
+      '#title' => t('CiviCRM Public Pages theme'),
+      '#description' => t('Choose which theme the CiviCRM Public pages should display in.'),
+      '#default_value' => variable_get('civicrm_public_theme', ''),
+    );
+     $newform['civicrm_theme_public_pages'] = array(
+      '#type' => 'textfield',
+      '#title' => t('CiviCRM Public Pages'),
+      '#description' => t('List path arguments (separated by a space) which should designate a Public Page for the purposes of the Theme setting above. Note that this does not affect any actual permissions. Only second level arguments are valid, e.g., \'event\' or \'group\'.'),
+      '#default_value' => variable_get('civicrm_theme_public_pages', 'event profile'),
+    );
+
     $form = array_merge(array_slice($form, 0, 1), $newform, array_slice($form, 1));
   }
 }
