Index: glossify.module
===================================================================
--- glossify.module	(revision 58)
+++ glossify.module	(working copy)
@@ -55,6 +55,11 @@
     '#default_value' => variable_get('glossify_style', 'hovertip'),
     '#description' => t('How the glossary should be styled. Note: "hovertip" style requires hovertip.module.'),
   );
+  $form['glossify_support_backlinks'] = array (
+    '#type' => 'checkbox',
+    '#title' => t('Are you using the Backlinks module or backlinking View?'),
+    '#default_value' => variable_get('glossify_support_backlinks', false),
+  );
 
   return system_settings_form($form);
 }
@@ -76,7 +81,7 @@
     switch ($op) {
       case 'alter':
           foreach (array_keys($glossary_term) as $term) {
-            $pattern = '/\b(?<!\"|\/)' . $term . '\b/';
+            $pattern = '#\b(?<!\"|\/)' . $term . '\b#';
             switch ($glossify_style) {
               case 'links':
                 $replacement = l($term, 'node/' . $glossary_term[$term], array('class'=>'glossify_term'));
@@ -96,10 +101,52 @@
               $node->body = preg_replace($pattern, $replacement, $node->body, variable_get('glossify_link_first_only', true) ? 1 : -1);
             }
           } // endforeach looping through terms
+          //if using backlinks support add it to the search index queue for cron
+          if (variable_get('glossify_support_backlinks', false)) {  
+            search_index($node->nid, 'node', $node->body);   
+          }
+          
+          
         break; // done with $op = 'alter'
+      
+      case 'insert':
+      case 'update': //just in case someone changes the title
+        //if set to support backlinks module or backling view
+        if (variable_get('glossify_support_backlinks', false)) {     
+          //find all nodes which have the current node title in their node->body, and process them via glossify and add to searchindex.
+          $result = db_query("SELECT node.nid, node_revisions.body FROM {node} LEFT JOIN {node_revisions} ON node_revisions.vid = node.vid WHERE node_revisions.body LIKE '%%%s%' ESCAPE '%'", $node->title);
+          $rows = array();
+          while ($row = db_fetch_array($result)) {
+            $rows[] = $row;
+          }
+          $i = 0;
+          foreach ($rows as $row) {
+            foreach (array_keys($glossary_term) as $term) {
+              $pattern = '#\b(?<!\"|\/)' . $term . '\b#';
+              switch ($glossify_style) {
+                case 'links':
+                  $replacement = l($term, 'node/' . $glossary_term[$term], array('class'=>'glossify_term'));
+                  break;
+                case 'reference':
+                  $replacement = '<span class="glossify_term">' . $term . '</span>';
+                  break;
+                case 'hovertip':
+                default:
+                  $replacement = '<span class="glossify_term hovertip_target" hovertip="' . $term . '">' . $term . '</span>';
+                  break;
+              } // endswitch glossify style
+            $newbody = preg_replace($pattern, $replacement, $rows[$i]['body'], variable_get('glossify_link_first_only', true) ? 1 : -1);
+            search_index($rows[$i]['nid'], 'node', $newbody);            
+            } // endforeach looping through terms
+            $i++;
+          }
+          #print_r($rows);
+        }  //end if varible_get glossify_support_backlinks
+        break; //done with $op = 'insert/update'
+      
       case 'view':
         foreach (array_keys($glossary_term) as $term) {
-          if (preg_match('/' . $term . '/', $node->body)) { // got one
+          if (preg_match('#' . $term . '#', $node->body)) { // got one
             switch ($glossify_style) {
               case 'links':
                 break;
Index: README.TXT
===================================================================
--- README.TXT	(revision 58)
+++ README.TXT	(working copy)
@@ -94,6 +94,14 @@
   section is then placed under the body of the main content. It is
   themeable -- see "How to Theme It," below.
 
+Are you using the Backlinks module or backlinking View?
+
+    If you check yes, when your Glossify nodes are saved, not only do 
+    links to other content appear, this new content is also submitted to 
+    the search index (which runs on cron).  The Backlinks module or a 
+    backlinking View looks through the search index and can now display 
+    which nodes link to it.
+  
 ## How to Theme It
 
 If you wish to change the looks of the display of glossary terms and
@@ -136,7 +144,5 @@
 
 Development of this module was sponsored by leptree.net.
 
-Original backport of this module from 6.0 to 5.0 was sponsored by
-CommonPlaces e-Solutions. <http://www.commonplaces.com>
-
-
+Original backport of this module from 6.0 to 5.0 and Backlinks support
+was sponsored by CommonPlaces e-Solutions. <http://www.commonplaces.com>
\ No newline at end of file
