--- formblock.module	2008-12-10 13:42:39.000000000 +1100
+++ formblock.module.new	2010-12-23 12:03:05.000000000 +1100
@@ -20,6 +20,10 @@
       '#description' => t('Enable this option to make the entry form for this content type available as a block.'),
     );
   }
+  if (formblock_current_form() == $form_id) {
+    // Let other modules know this form is being displayed in a block.
+    $form['#formblock'] = TRUE;
+  }
 }
 
 /**
@@ -51,15 +55,19 @@
           // Don't display the form to logged in users or if registration is disabled
           if (!$user->uid && variable_get('user_register', 1)) {
             drupal_add_css(drupal_get_path('module', 'formblock'). '/formblock.css', 'module', 'all');
-            return array(
+            formblock_current_form('set', $delta);
+            $block = array(
               'subject' => t('Create new account'),
               'content' => drupal_get_form('user_register')
             );
+            formblock_current_form('set');
+            return $block;
           }
           break;
 
         case 'contact_site':
           if (user_access('access site-wide contact form') && module_exists('contact')) {
+            formblock_current_form('set', $delta);
             if (!flood_is_allowed('contact', variable_get('contact_hourly_threshold', 3))) {
               $content = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold', 3)));
             }
@@ -68,6 +76,7 @@
               module_load_include('inc', 'contact', 'contact.pages');
               $content = drupal_get_form('contact_mail_page');
             }
+            formblock_current_form('set');
             return array(
               'subject' => t('Contact'),
               'content' => $content,
@@ -91,7 +100,11 @@
     module_load_include('inc', 'node', 'node.pages');
     // Note title before rendering of form.
     $title = drupal_get_title();
+    // Allow other functions to know if the form is being displayed in the form block
+    formblock_current_form('set', $type .'_node_form');
     $form = node_add($type);
+    // Remove this formid from the caching function
+    formblock_current_form('set');
     $types = node_get_types('names');
     // Restore title, which will have been overridden.
     drupal_set_title($title);
@@ -101,3 +114,23 @@
     );
   }
 }
+
+/**
+ * Statically caches the current form being presented in a block so that we can give the node
+ * object context.
+ *
+ * @param string $op
+ *  set: Statically caches the second paramater
+ *  get: ignores the second paramater
+ * @param string $form_id
+ *  Form ID string. Ignored if $op == 'get'
+ * @return string
+ *  Current cached form ID
+ */
+function formblock_current_form($op = 'get', $form_id = NULL) {
+  static $current_form;
+  if ($op == 'set') {
+    $current_form = $form_id;
+  }
+  return $current_form;
+}
\ No newline at end of file
