? cacheexclude-478790_0.patch
? cacheexclude-478790_1.patch
Index: cacheexclude.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cacheexclude/cacheexclude.module,v
retrieving revision 1.6.2.3
diff -u -p -r1.6.2.3 cacheexclude.module
--- cacheexclude.module	27 May 2009 18:31:30 -0000	1.6.2.3
+++ cacheexclude.module	23 Jun 2009 15:13:47 -0000
@@ -22,6 +22,7 @@ function cacheexclude_menu() {
  * Administrative settings form.
  */
 function cacheexclude_admin_settings() {
+
   $form['cacheexclude_list'] = array(
     '#type' => 'textarea',
     '#title' => t('Pages to exclude from caching'),
@@ -31,6 +32,20 @@ function cacheexclude_admin_settings() {
     '#description' => t("Enter one page per line as Drupal paths. Don't begin link with trailing slash. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>')),
   );
 
+  // Options to exclude by node type.
+  $full_types = node_get_types();
+  foreach ($full_types as $type) {
+    $types[$type->type] = $type->name;
+  }
+
+  $form['cacheexclude_node_types'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Node types to exclude from caching'),
+    '#default_value' => variable_get('cacheexclude_node_types', array()),
+    '#options' => $types,
+    '#description' => t("Check all node types that you do not want to be cached."),
+  );
+
   // Add an additional submit handler to clear the cache after list is updated.
   $full_form = system_settings_form($form);
   $full_form['#submit'][] = 'cacheexclude_admin_settings_submit';
@@ -66,4 +81,14 @@ function cacheexclude_init() {
                          drupal_match_path(drupal_get_path_alias($_GET['q']), $pages) )) {
     $GLOBALS['conf']['cache'] = 0;
   }
+  
+  // Check if the current node type is one we want to exclude from the cache.
+  $types = variable_get('cacheexclude_node_types', array());
+  if ($node = menu_get_object('node')) {
+    // Check to see if the value is not zero 
+    // because that is how the checkboxes are stored in the array.
+    if (in_array($node->type, $types) && $types[$node->type] != '0') {
+      $GLOBALS['conf']['cache'] = 0;
+    }
+  }
 }
