getID() == $b->getID()) return 0; else if ($a->getMajor() > $b->getMajor()) return 1; else if ($a->getMajor() < $b->getMajor()) return -1; else if ($a->getMinor() > $b->getMinor()) return 1; else if ($a->getMinor() < $b->getMinor()) return -1; else if ($a->getRelease() > $b->getRelease()) return 1; else if ($a->getRelease() < $b->getRelease()) return -1; else if ($a->getBeta() > $b->getBeta()) return 1; else if ($a->getBeta() < $b->getBeta()) return -1; else if ($a->getPatchlevel() > $b->getPatchlevel()) return 1; else if ($a->getPatchlevel() < $b->getPatchlevel()) return -1; } // // Simple macro to start a code block // function code_start() { return "

\n

\n
";
  }
  
  //
  // Simple macro to end a code block
  //
  function code_end() {
    return "
\n
\n"; } function print_me($fp, $string) { if ($fp == -1) print($string); else fputs($fp, $string); } function display_question($q, $num, $fp = -1) { global $disp_quest_ver_xrefs; global $lamversion; global $lamversiondir; global $topdir; $table_start = "\n\n \n \n \n
\n"; print_me($fp, $table_start); if ($num <= 0) print_me($fp, $q->getTitle()); else print_me($fp, "$num. " . $q->getTitle()); $vxs = getVerXrefsByQID($q->getID()); if ($vxs[0]->isValid()) { // Obtain all the versions $vers = getAllVersAssoc(); // Make an array of the ones that we're interested in for ($i = 0; $i < sizeof($vxs); $i++) { $id = $vxs[$i]->getVersionID(); if (isset($vers[$id]) && $vers[$id]->isValid()) { $foundvers[] = $vers[$id]; $andup[$id] = $vxs[$i]->getAndUp(); } } // Sort the interesting ones if (sizeof($foundvers) > 0) { usort($foundvers, vercompare); // Now build the string to print -- stop when we hit a version // that has "and up" set in it $ver_string = ""; for ($i = 0; $i < sizeof($foundvers); $i++) { $ver_string .= $foundvers[$i]->getName(); if ($andup[$foundvers[$i]->getID()] == 1) { $ver_string .= " and above"; break; } if ($i < sizeof($foundvers) - 1) $ver_string .= ", "; } // Sanity check before printing it if ($ver_string != "") { print_me($fp, "\n
" . "Applies to LAM $ver_string"); } } } $table_end = "
\n\n"; print_me($fp, $table_end); $ans = $q->getAnswer(); $cs = code_start(); $ce = code_end(); $lammailarchive = get_archive_link(); $lamfaq = get_faq_link(); $ans = str_replace("", $topdir, $ans); $ans = str_replace("", $topdir, $ans); $ans = str_replace("", $cs, $ans); $ans = str_replace("", $cs, $ans); $ans = str_replace("", $ce, $ans); $ans = str_replace("", $ce, $ans); $ans = str_replace("", $lamversion, $ans); $ans = str_replace("", $lamversion, $ans); $ans = str_replace("", $lamversiondir, $ans); $ans = str_replace("", $lamversiondir, $ans); $ans = str_replace("", $lammailarchive, $ans); $ans = str_replace("", $lammailarchive, $ans); $ans = str_replace("", $lamfaq, $ans); $ans = str_replace("", $lamfaq, $ans); print_me($fp, "

" . $ans . "\n\n"); } function display_question_id($qid, $num, $fp = -1) { $q = getQuestByID($qid); if (!$q->isValid()) print_me($fp, "

Sorry, this does not appear to be a valid question.\n"); else display_question($q, $num, $fp); } }