--- site_map.admin.inc	2010-08-17 12:08:40.768450500 -0400
+++ site_map.adminNEW.inc	2010-08-17 12:12:21.047450500 -0400
@@ -39,31 +39,35 @@ function site_map_admin_settings_form($f
     '#default_value' => variable_get('site_map_show_front', 1),
     '#description' => t('When enabled, this option will include the front page in the site map.'),
   );
-  $form['site_map_content']['site_map_show_blogs'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Show active blog authors'),
-    '#default_value' => variable_get('site_map_show_blogs', 1),
-    '#description' => t('When enabled, this option will show the 10 most active blog authors.'),
-  );
-  $book_options = array();
+  
+  if (module_exists('blog')) {
+    $form['site_map_content']['site_map_show_blogs'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Show active blog authors'),
+      '#default_value' => variable_get('site_map_show_blogs', 1),
+      '#description' => t('When enabled, this option will show the 10 most active blog authors.'),
+    );
+  }
+  
   if (module_exists('book')) {
+    $book_options = array();
     foreach (book_get_books() as $book) {
       $book_options[$book['nid']] = $book['title'];
     }
+    $form['site_map_content']['site_map_show_books'] = array(
+      '#type' => 'checkboxes',
+      '#title' => t('Books to include in the site map'),
+      '#default_value' => variable_get('site_map_show_books', array()),
+      '#options' => $book_options,
+      '#multiple' => TRUE,
+    );
+    //   $form['site_map_content']['site_map_books_expanded'] = array(
+    //     '#type' => 'checkbox',
+    //     '#title' => t('Show books expanded'),
+    //     '#default_value' => variable_get('site_map_books_expanded', 1),
+    //     '#description' => t('When enabled, this option will show all children pages for each book.'),
+    //   );
   }
-  $form['site_map_content']['site_map_show_books'] = array(
-    '#type' => 'checkboxes',
-    '#title' => t('Books to include in the site map'),
-    '#default_value' => variable_get('site_map_show_books', array()),
-    '#options' => $book_options,
-    '#multiple' => TRUE,
-  );
-//   $form['site_map_content']['site_map_books_expanded'] = array(
-//     '#type' => 'checkbox',
-//     '#title' => t('Show books expanded'),
-//     '#default_value' => variable_get('site_map_books_expanded', 1),
-//     '#description' => t('When enabled, this option will show all children pages for each book.'),
-//   );
 
   $menu_options = array();
   $menu_options = menu_get_menus();
@@ -81,52 +85,52 @@ function site_map_admin_settings_form($f
     '#default_value' => variable_get('site_map_show_faq', 0),
     '#description' => t('When enabled, this option will include the content from the FAQ module in the site map.'),
   );
-  $vocab_options = array();
+  
   if (module_exists('taxonomy')) {
+    $vocab_options = array();
     foreach (taxonomy_get_vocabularies() as $vocabulary) {
       $vocab_options[$vocabulary->vid] = $vocabulary->name;
     }
+    $form['site_map_content']['site_map_show_vocabularies'] = array(
+      '#type' => 'checkboxes',
+      '#title' => t('Categories to include in the site map'),
+      '#default_value' => variable_get('site_map_show_vocabularies', array()),
+      '#options' => $vocab_options,
+      '#multiple' => TRUE,
+    );
+    $form['site_map_taxonomy_options'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Categories settings'),
+    );
+    $form['site_map_taxonomy_options']['site_map_show_count'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Show node counts by categories'),
+      '#default_value' => variable_get('site_map_show_count', 1),
+      '#description' => t('When enabled, this option will show the number of nodes in each taxonomy term.'),
+    );
+    $form['site_map_taxonomy_options']['site_map_categories_depth'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Categories depth'),
+      '#default_value' => variable_get('site_map_categories_depth', 'all'),
+      '#size' => 3,
+      '#maxlength' => 10,
+      '#description' => t('Specify how many subcategories should be included on the categorie page. Enter "all" to include all subcategories, "0" to include no subcategories, or "-1" not to append the depth at all.'),
+    );
+    $form['site_map_taxonomy_options']['site_map_term_threshold'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Category count threshold'),
+      '#default_value' => variable_get('site_map_term_threshold', 0),
+      '#size' => 3,
+      '#description' => t('Only show categories whose node counts are greater than this threshold. Set to -1 to disable.'),
+    );
+    $form['site_map_taxonomy_options']['site_map_forum_threshold'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Forum count threshold'),
+      '#default_value' => variable_get('site_map_forum_threshold', -1),
+      '#size' => 3,
+      '#description' => t('Only show forums whose node counts are greater than this threshold. Set to -1 to disable.'),
+    );
   }
-  $form['site_map_content']['site_map_show_vocabularies'] = array(
-    '#type' => 'checkboxes',
-    '#title' => t('Categories to include in the site map'),
-    '#default_value' => variable_get('site_map_show_vocabularies', array()),
-    '#options' => $vocab_options,
-    '#multiple' => TRUE,
-  );
-
-  $form['site_map_taxonomy_options'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Categories settings'),
-  );
-  $form['site_map_taxonomy_options']['site_map_show_count'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Show node counts by categories'),
-    '#default_value' => variable_get('site_map_show_count', 1),
-    '#description' => t('When enabled, this option will show the number of nodes in each taxonomy term.'),
-  );
-  $form['site_map_taxonomy_options']['site_map_categories_depth'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Categories depth'),
-    '#default_value' => variable_get('site_map_categories_depth', 'all'),
-    '#size' => 3,
-    '#maxlength' => 10,
-    '#description' => t('Specify how many subcategories should be included on the categorie page. Enter "all" to include all subcategories, "0" to include no subcategories, or "-1" not to append the depth at all.'),
-  );
-  $form['site_map_taxonomy_options']['site_map_term_threshold'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Category count threshold'),
-    '#default_value' => variable_get('site_map_term_threshold', 0),
-    '#size' => 3,
-    '#description' => t('Only show categories whose node counts are greater than this threshold. Set to -1 to disable.'),
-  );
-  $form['site_map_taxonomy_options']['site_map_forum_threshold'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Forum count threshold'),
-    '#default_value' => variable_get('site_map_forum_threshold', -1),
-    '#size' => 3,
-    '#description' => t('Only show forums whose node counts are greater than this threshold. Set to -1 to disable.'),
-  );
 
   $form['site_map_rss_options'] = array(
     '#type' => 'fieldset',
