// include input checking code for security include("sec.php"); $req = new requestGet(); // get base document name with no extension // $docn = $_GET[docn]; $docn = $req->getVarString("docn",50,"none"); // get name of collection if any (such as Kendrick or Hill) // $coll = $_GET[coll]; $coll = $req->getVarString("coll",30,""); $colldisp = $coll; if ($coll=="Kendrick") { $colldisp = "Kendrick Family"; } // get name of location = folder in collection such as M1 // $loc = $_GET[loc]; $loc = $req->getVarString("loc",15,""); // build path to file from collection and location $path = "coll/"; if ($coll!="") {$path = $path . $coll . "/";} if ($loc!="") {$path = $path . $loc . "/";} // build name of text file $txtn = $path . "txt/".$docn.".txt"; $hilltxtn = $path . "txt-pre-no-html/".$docn.".txt"; // build name of MS Word .doc file $wordn = $path . "doc/".$docn.".doc"; // build name of PDF .pdf file $pdfn = $path . "pdf/".$docn.".pdf"; // build name of Rich Text .rtf file $rtfn = $path . "rtf/".$docn.".rtf"; // build name of .inc file containing blurb about document with description of doc $incn = $path . "inc/".$docn.".inc"; $incnexists = file_exists($incn); // build name of file containing specific copyright information if any // $cr = $_GET[cr]; $cr = $req->getVarString("cr",10,""); if ($cr=="") { // no special copyright filename passed as a parameter $copyrexists = FALSE; } else { // use special copyright info for this document $copyr="copyrights/".$cr.".inc"; $copyrexists = file_exists($copyr); } // get title if any // $t = $_GET[t]; $t = $req->getVarString("t",100,""); if ($t=="") { //no title passed in URL, try to get title from inc file if ($incnexists) { $firstline = readfirstline($incn); // first line should be:
title goes here
$pieces1 = explode(">",$firstline); $pieces2 = explode("<",$pieces1[1]); $t = $pieces2[0]; } } // get keywords if any // $k = $_GET[t]; $k = $req->getVarString("k",50,""); ?>include($txtn); ?>} else { if ($coll=="Hill") { ?>
include($txtn); ?>} else { include($txtn); } } } else { echo "The transcription text file ".$txtn." is not available."; } ?>