Index: advanced_forum.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/advanced_forum.module,v
retrieving revision 1.149.2.94
diff -u -p -r1.149.2.94 advanced_forum.module
--- advanced_forum.module	6 Feb 2011 01:43:00 -0000	1.149.2.94
+++ advanced_forum.module	23 Feb 2011 01:13:05 -0000
@@ -490,6 +490,38 @@ function advanced_forum_form_alter(&$for
   if (!empty($form['og_settings']['group_details']['og_home_page_view'])) {
      $form['og_settings']['group_details']['og_home_page_view']['#options']['advanced_forum_group_topic_list'] = 'advanced_forum_group_topic_list';
   }
+
+  // Insert AF style select box into theme settings page.
+  if ($form_id == 'system_theme_settings') {
+    $form['advanced_forum'] = array(
+      '#type' => fieldset,
+      '#title' => t('Advanced forum'),
+      '#weight' => -1,
+    );
+
+    $options = array();
+    $available_styles = advanced_forum_get_all_styles();
+    foreach ($available_styles as $style_machine_name => $style) {
+      $options[$style_machine_name] = $style['name'];
+    }
+    asort($options);
+
+    // Determine whether this style is global or theme specific
+    $key = arg(4);
+    $settings = variable_get('theme_'. ($key ? $key .'_' : '') .'settings', array());
+    $default = $settings['advanced_forum_style'];
+
+    $form['advanced_forum']['advanced_forum_style'] = array(
+      '#type' => 'select',
+      '#title' => t('Advanced forum style'),
+      '#options' => $options,
+      '#description' => t('Choose which style to use for your forums.'),
+      '#default_value' => $default,
+    );
+    if (! $key) {
+      $form['advanced_forum']['advanced_forum_style']['#description'] .= ' '. t('This will apply independent of site theme.');
+    }
+  }
 }
 
 // MAKE VIEWS BITS WORK *****************************************************/
Index: includes/settings.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/includes/Attic/settings.inc,v
retrieving revision 1.1.2.16
diff -u -p -r1.1.2.16 settings.inc
--- includes/settings.inc	11 Feb 2011 20:57:09 -0000	1.1.2.16
+++ includes/settings.inc	23 Feb 2011 01:13:05 -0000
@@ -18,22 +18,6 @@ function advanced_forum_settings_page() 
     '#collapsed' => FALSE,
   );
 
-  // Choose style
-  $options = array();
-  $available_styles = advanced_forum_get_all_styles();
-  foreach ($available_styles as $style_machine_name => $style) {
-    $options[$style_machine_name] = $style['name'];
-  }
-  asort($options);
-
-  $form['advanced_forum_general']['advanced_forum_style'] = array(
-    '#type' => 'select',
-    '#title' => t('Advanced forum style'),
-    '#options' => $options,
-    '#description' => t('Choose which style to use for your forums. This will apply independent of site theme.'),
-    '#default_value' => variable_get('advanced_forum_style', 'cloudless_day_stacked'),
-  );
-
   // Choose node types that are styled.
   $node_types = node_get_types();
   $options = array();
Index: includes/style.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/advanced_forum/includes/Attic/style.inc,v
retrieving revision 1.1.2.17
diff -u -p -r1.1.2.17 style.inc
--- includes/style.inc	13 Jan 2011 04:11:07 -0000	1.1.2.17
+++ includes/style.inc	23 Feb 2011 01:13:05 -0000
@@ -12,7 +12,12 @@
  * Returns the name of the forum style to use.
  */
 function advanced_forum_get_current_style() {
-  return variable_get('advanced_forum_style', 'silver_bells');
+  static $settings;
+  if (! $settings) {
+    init_theme();
+    $settings = theme_get_settings($GLOBALS['theme_key']);
+  }
+  return isset($settings['advanced_forum_style']) ? $settings['advanced_forum_style'] : 'cloudless_day_stacked';
 }
 
 function advanced_forum_get_style($style) {
