--- glossary.module	2007-12-19 15:27:47.000000000 -0600
+++ /var/www/vhosts/core/sites/all/modules/glossary/glossary.module	2007-12-18 15:35:57.000000000 -0600
@@ -207,20 +207,20 @@
     '#description' => $cache_msg,
     );
 
-  $form['general']["glossary_vids"] = array(
+  $form['general']["glossary_vids_$format"] = array(
     '#type' => 'select',
     '#title' => t('Select Vocabulary'),
-    '#default_value' => variable_get("glossary_vids", array()),
+    '#default_value' => variable_get("glossary_vids_$format", array()),
     '#options' => $options,
     '#description' => t('Select one or more vocabularies which hold all terms for your glossary. When enabled, posts will be scanned for glossary terms. An icon or a superscripted link is inserted beside each term. Hover over the icon or link to learn the meaning of that term.'),
     '#multiple' => true,
     '#required' => true,
     );
 
-  $form['general']["glossary_absolute"] = array(   /* <<============================== */
+  $form['general']["glossary_absolute_$format"] = array(   /* <<============================== */
     '#type' => 'checkbox',
     '#title' => t('Make Glossary links absolute'),
-    '#default_value' => variable_get("glossary_absolute", false),
+    '#default_value' => variable_get("glossary_absolute_$format", false),
     '#description' => t('RSS feeds need absolute links to ensure they point back to this site. If you are not providing RSS feeds, it is better to leave this turned off.'),
     );
 
@@ -239,10 +239,10 @@
     '#description' => t('Do you want to show all terms on one glossary page or break up the glossary into a page for each first letter (i.e. many pages).'),
     );
 
-  $form['general']["glossary_match"] = array(
+  $form['general']["glossary_match_$format"] = array(
     '#type' => 'select',
     '#title' => t('Match type'),
-    '#default_value' => variable_get("glossary_match", 'match'),
+    '#default_value' => variable_get("glossary_match_$format", 'match'),
     '#options' => array(
       'b' => t('word'),
       'lr' => t('right or left substring'),
@@ -253,10 +253,10 @@
     '#description' => t('Choose the match type of glossary links.'),
     );
 
-  $form['general']["glossary_case"] = array(
+  $form['general']["glossary_case_$format"] = array(
     '#type' => 'select',
     '#title' => t('Case sensitivity'),
-    '#default_value' => variable_get("glossary_case", '1'),
+    '#default_value' => variable_get("glossary_case_$format", '1'),
     '#options' => array(
       t('case insensitive'),
       t('case sensitive')
@@ -264,10 +264,10 @@
     '#description' => t('Match either case sensitive or not. Case sensitive matches are not very resource intensive.'),
     );
 
-  $form['general']["glossary_replace_all"] = array(
+  $form['general']["glossary_replace_all_$format"] = array(
     '#type' => 'select',
     '#title' => t('Replace matches'),
-    '#default_value' => variable_get("glossary_replace_all", 0),
+    '#default_value' => variable_get("glossary_replace_all_$format", 0),
     '#options' => array(
       t('only the first match'),
       t('all matches')
@@ -467,11 +467,11 @@
     return $text;
   }
 
-  if (variable_get("glossary_vids", 0)) {
+  if (variable_get("glossary_vids_$format", 0)) {
 
     $text = ' '. $text .' ';
     $replace_mode = variable_get("glossary_replace_$format", 'superscript');
-    $absolute_link = variable_get("glossary_absolute", false);
+    $absolute_link = variable_get("glossary_absolute_$format", false);
     $terms = _glossary_get_terms($format);
     $vids = _glossary_get_filter_vids();
 
@@ -527,7 +527,7 @@
  */
 function _glossary_insertlink($format, &$text, $match, $ins_before, $ins_after) {
 
-  $findfunc = (variable_get("glossary_case", "1") ? 'strpos' : 'stripos');
+  $findfunc = (variable_get("glossary_case_$format", "1") ? 'strpos' : 'stripos');
   $next = $findfunc($text, $match);
   
   if ($next === false) { // no match at all
@@ -538,7 +538,7 @@
     $newtext    = '';
     $matchlen   = strlen($match);
     $textlen    = strlen($text);
-    $replaceall = variable_get("glossary_replace_all", 0);
+    $replaceall = variable_get("glossary_replace_all_$format", 0);
     
     while ($next && ($next <= $textlen)) {
       
@@ -555,7 +555,7 @@
       $closeacro = substr_count($before, '</acronym>');
       $proper_match = false;
       if ($opena <= $closea && $open <= $close && $openacro <= $closeacro) { // Not in an open link
-        switch (variable_get("glossary_match", 'b')) {
+        switch (variable_get("glossary_match_$format", 'b')) {
           case 'lr': // require word break left or right
             $proper_match = (_glossary_is_boundary($text {$next - 1}) || _glossary_is_boundary($text {$next + $matchlen}));
             break;
@@ -799,7 +799,7 @@
   
   if ($terms === false) {
     $terms = $synonyms = array();
-    $vids = variable_get("glossary_vids", 0);
+    $vids = variable_get("glossary_vids_$format", 0);
     
     foreach ($vids as $vid) {
       $synonyms = _glossary_get_synonyms($vid);
@@ -863,7 +863,7 @@
     $filters = filter_list_format($format->format);
     foreach ($filters as $filter) {
       if ($filter->module == "glossary") {
-        $vids = array_merge($vids, variable_get("glossary_vids", array()));
+        $vids = array_merge($vids, variable_get("glossary_vids_". $format->format, array()));
       }
     }
   }
