getID(); $months["Jan"] = 1; $months["Feb"] = 2; $months["Mar"] = 3; $months["Apr"] = 4; $months["May"] = 5; $months["Jun"] = 6; $months["Jul"] = 7; $months["Aug"] = 8; $months["Sep"] = 9; $months["Oct"] = 10; $months["Nov"] = 11; $months["Dec"] = 12; // Some helpful functions first // Announcement function starting($filename) { print("
Generating $filename... \n"); } // Announce that we're finished with a file function ending() { print("Completed\n\n"); } // Write the standard header to a file function write_header($fp, $title) { fputs($fp, ' '); } // Write the standard footer to a file function write_footer($fp) { fputs($fp, 'getLastModDate(); if ($d == "") $sys->update(); // $title = "LAM FAQ
Last updated: " . // $sys->getLastModDate() . ""; $title = "LAM FAQ"; // Write the header write_header($fp, $title); // Write the body // Get all the categories, and then build an array of active, // non-empty categories $cats = getAllCats(); $c[] = new Category(""); $sizes[] = 0; if (sizeof($cats) > 0) { for ($i = 0; $i < sizeof($cats); $i++) { if ($cats[$i]->getActive() == "1") { $foo = getCatXrefsByCID($cats[$i]->getID()); if (!$foo[0]->isValid()) $s = 0; else { $c[] = $cats[$i]; $sizes[] = sizeof($foo); } } } } if (sizeof($c) > 1) { fputs($fp, "FAQ categories available:\n\n
    \n"); for ($i = 1; $i < sizeof($c); $i++) { fputs($fp, "
  1. " . $c[$i]->getName() . " (" . $sizes[$i] . " question" . (($sizes[$i] > 1) ? "s" : "") . ")
  2. \n"); } fputs($fp, "
\n\n"); } else { fputs($fp, "Sorry, no FAQ categories are currently defined.\n"); } // Write the footer write_footer($fp); system("mv $tempfile $gendir/index.php3"); fclose($fp); ending(); // // Individual category pages // for ($i = 1; $i < sizeof($c); $i++) { $filename = "category$i.php3"; starting($filename); $fp = fopen($tempfile, "w"); $cat = $c[$i]; // Get all the questions so that we can calculate the last // time one of them was updated unset($xrefs); unset($q); $xrefs = getCatXrefsByCID($cat->getID()); $cat_last_update = ""; $last = 0; for ($j = 0; $j < sizeof($xrefs); $j++) { $q[] = getQuestByID($xrefs[$j]->getQuestionID()); $dstr = $q[$j]->getLastModDate(); $day = intval($dstr); $month = $months[substr($dstr, 3, 3)]; $year = intval(substr($dstr, 7)); $dval = mktime(0, 0, 0, $month, $day, $year); // print("Checking date of question $j: $dstr - $dval : " . // "$month/$day/$year
\n"); if ($last < $dval) { $last = $dval; $cat_last_update = date("F j, Y", $dval); // print("Got new: $cat_last_update
\n"); } } // Make the title $title = "LAM FAQ: " . $cat->getNi>]tVWD&6?;CM#|۷9d0k>|J~s!9 AB}(G,?c%ett3>!{fE ) m@D8 kkNJѬ}gܻ/]^:˷` =>I<6320Qp45\s۸=,O~ds'Ek`hoaoW%B=?Ki}?9\7{}:wtxG]*?ѳ]v]^?Ox@RK2|, ]ayտMGv KA|܌^ۧNalﱪG4'E<;.2r @/s8R͈~ @0Uh.Z׆ok+aWDcDǬ (/[7v /k٭/iY\"[gk즚 ksz沋G &P$KP7ncOۥ=7??NyΪkgco}W_= pu~9 +~@;iQ64X:_?\ ˟Gz][+wX[Wׁx)9J_Ib[Q+S(WmZ!3 Ȑ$!w9SyƆآnE:ަR9kγ'ӵ#U4>].[GkZ.wH9x1ԜH-5G2)c?wwϝ= hp" {N>i:_+HL^jEpSùRۄ:>R#+VQQMҶM3v/720Xܽܟ; uӤ8| /RNk1VERV<"fvdn\}'eSvmag&Ϳl囿!Or>}59oM[xف!p㝋EpcT|)R[i]=zΫIn3ѥA9?[_zS hvĺK2LLo)˜قm:&;{לczް,,݈ލF08#Oedwϩ9>y.5%sGe6;{GyesOIگEZ=.bu "[c)yci_!Tٞi>MŗyEm5j 5]y&?=ɬM  SG;mS_,eu=Ɍ䩞+PEKlo6|ĈU_5} ͼl/kxU6~yC#a(\HR?ZLwCd) {xX}' %F0Ƒ=U:5?X 1Nn[ ,v,KZ=9neG8~ !ߣTrsƣĆvAϳv.EW*v^[)ՙԕsn9e