--- isbn.module-orig	2009-09-14 23:16:10.000000000 -0400
+++ isbn.module	2009-09-16 22:04:29.000000000 -0400
@@ -41,7 +41,7 @@ function isbn_validate_ajax($isbn_format
  * Implementation of hook_theme().
  */
 function isbn_theme() {
-  return array(
+  $themes = array(
     'isbn_field' => array(
       'arguments' => array('element' => NULL),
     ),
@@ -52,6 +52,12 @@ function isbn_theme() {
       'arguments' => array('element' => NULL),
     ),
   );
+
+  if (module_exists('bookpost')) {
+	$themes['isbn_formatter_bookpost'] = array('arguments' => array('element' => NULL));
+  }
+
+  return $themes;
 }
 
 /**
@@ -182,7 +188,7 @@ function isbn_content_is_empty($item, $f
  * Implementation of hook_field_formatter_info().
  */
 function isbn_field_formatter_info() {
-  return array(
+  $formatter = array(
     'raw' => array(
       'label' => t('ISBN: As Entered'),
       'field types' => array('isbn'),
@@ -194,6 +200,17 @@ function isbn_field_formatter_info() {
       'multiple values' => CONTENT_HANDLE_CORE,
     ),
   );
+
+  if (module_exists('bookpost')) {
+    $formatter['bookpost'] = 
+	  array(
+		'label' => t('Info from BookPost'),
+		'field types' => array('isbn'),
+		'multiple values' => CONTENT_HANDLE_CORE,
+		);
+  }
+
+  return $formatter;
 }
 
 /**
@@ -213,6 +230,18 @@ function theme_isbn_formatter_clean($ele
 }
 
 /**
+ * Theme function for bookpost mode, (requires bookpost module)
+ */
+function theme_isbn_formatter_bookpost($element) {
+	$string = $element['#item']['value'];
+	if (module_exists('bookpost')) {
+	  module_load_include('inc', 'bookpost');
+	  $string = retrieve_bookdata(isbn_format_clean($string));
+	}
+	return $string;
+}
+
+/**
  * Helper function for cleaning dashes and spaces
  */
 function isbn_format_clean($string) {
