setSpreadsheetKey('0AuPh9cI948YxdGkxdFMzQmdiamZKWnFQdW9ZbkFyUWc'); $query->setWorksheetId('od6'); $wsEntry = $service->getWorksheetEntry($query); } catch (Exception $e) { die('ERROR: ' . $e->getMessage()); } $glossary_php_last_updated = strtotime($wsEntry->updated); // Dynamic $glossary_html_last_updated = strtotime(date("F d Y H:i:s.", filemtime('glossary.html'))); // Static // Make sure no glossary user activated functions are called //if (empty($study_set) && empty($checkedname) && empty($study_mode)) { // Redirect to previously generated static html page if no recent Google Spreadsheets update // if ($glossary_php_last_updated < $glossary_html_last_updated) { // header('Location: glossary.html'); // exit; // } // Else the rest of the php script below will run and overwrite glossary.html file //} ?> setSpreadsheetKey("0AuPh9cI948YxdGkxdFMzQmdiamZKWnFQdW9ZbkFyUWc"); $query->setWorksheetId("od6"); } catch (Exception $e) { die('ERROR: ' . $e->getMessage()); } // Get a list of the 2nd, 3rd, and 4th rows (glossary_media, glossary_name, glossary_definition) and put into big arrays $query->setReturnEmpty(true); $query->setMinCol(2); $query->setMaxCol(4); $query->setMinRow(2); $cellFeed = $service->getCellFeed($query); // Populate the data_arrays to generate the Javascript data $array_counter = 1; $special_chars = array("\n"); $replace_special_chars = array("
"); foreach ($cellFeed as $cellEntry) { if ($array_counter == 1) { $glossary_medias[] = str_replace(" ", "", $cellEntry->getCell()->getText()); } elseif ($array_counter == 2) { $glossary_names[] = $cellEntry->getCell()->getText(); } elseif ($array_counter == 3) { $glossary_definitions[] = str_replace($special_chars, $replace_special_chars, $cellEntry->getCell()->getText()); } // Reset array counter when all of row data is entered $array_counter < 3 ? $array_counter++ : $array_counter = 1; } // Autocomplete search function $all_glossary_tags = " \n"; // Write/overwrite to all_glossary_tags.inc file_put_contents("./glossary_terms/all_glossary_tags.inc", $all_glossary_tags); // Output javascript autocomplete array and function echo $all_glossary_tags; ?>

Hematology Glossary


Go To: A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z


or

\n"; $ALPHABET_COUNTER++; } // Alternating background row color $color == '#ffffff' ? $color = '#eeeeee' : $color = '#ffffff'; // Parse the definition for all glossary terms and set hyperlinks unset($str_link); // Reset the definition string for ($y = 0; $y < count($glossary_names); $y++) { // Loop through all glossary names if ($str_link == "") $str_link = $glossary_definitions[$x]; // Set initial definition string as original if (stripos($glossary_definitions[$x], $glossary_names[$y])) { // The name is found within the definition text, so continue //Check the case of the name in the original definition text against the array of terms that should always be alphabetized if (in_array($glossary_names[$y], $CAPITAL_TERMS)) { $fixed_glossary_name = str_replace("'", "'", $glossary_names[$y]); } else { $fixed_glossary_name = strtolower(str_replace("'", "'", $glossary_names[$y])); } // Build final string $replacement_str = "$fixed_glossary_name"; $str_link = str_replace_word($glossary_names[$y], $replacement_str, $str_link); } } // Extract media (possibly multiple), if any unset($media_string); if ($glossary_medias[$x]) { unset($media_list); $media_list = explode(",", $glossary_medias[$x]); $media_string = "
Back to top ^

" . $ARRAY_ALPHABET[$ALPHABET_COUNTER] . "


\n"; for ($z = 0; $z < count($media_list); $z++) { $media_string .= "\n"; if ($z == 3) $media_string .= ""; } $media_string .= "
  
Figure " . ($z+1) . "
\n"; $media_string = "

" . $media_string . "

\n"; } $row_string = " " . str_replace("_", " ", $glossary_names[$x]) . " " . $str_link . $media_string . " \n"; echo $row_string; // Create a file containing the glossary term $remove_table_str = array("", "", "
", "
"); $glossary_term_table = "
" . str_replace("_", " ", $glossary_names[$x]) . "


" . $str_link . str_replace($remove_table_str, "", $media_string) . "
"; $glossary_file_name = $x . ".inc"; //file_put_contents("./glossary_terms/" . $glossary_file_name, $glossary_term_table); } ?>