/***************************************************************************\ * index.php * * ~~~~~~~~~ * * This script is designed to call the appropriate functions in * * mprfunctions.php * * * * See its documentation for further details. * \***************************************************************************/ require ('mprfunctions.php'); /***************************************************************************\ * Begin Function Selection * * ~~~~~~~~~~~~~~~~~~~~~~~~ * * * * Possible values for fxn * * ~~~~~~~~~~~~~~~~~~~~~~~ * * searchhelp: Provide help on searching * * archives: List archived, back issues * * dltopalm: Show page with options to get the newsletter for Palm * * about: Display 'about' info * * contact: Display contact info * * current: Display latest newsletter without 'faux frames' * * * * Possible values for button * * ~~~~~~~~~~~~~~~~~~~~~~~~~~ * * Go: Display results of a search * * Get MPR for iSilo: Convert latest issue to iSilo format and download * \***************************************************************************/ //If a function has been chosen explicitly, copy it to $function if($_GET['fxn']) $function=$_GET['fxn']; //The 'Go' button is for submitting a search term if($_POST['button']=="Go") { //Choose the search function $function="search"; //Capture the search term $searchterm=$_POST['searchstring']; } //The 'Get MPR for iSilo' button is for the iSilo converter if($_POST['button']=="Get MPR for iSilo") { $function="isiloconv"; } //If only a volume and issue number have been chosen, we want to output an issue if($_GET['v'] && $_GET['n']) { //Capture the specific volume and issue number $volume=$_GET['v']; $issuenum=$_GET['n']; //Choose the issue function if(!$function) $function="issue"; } //If no function has been chosen either implicitly or explicitly, output the latest issue if(!$function) { $function="issue"; $v=null; $n=null; } /***************************************************************************\ * End Function Selection * \***************************************************************************/ /***************************************************************************\ * Begin Output * \***************************************************************************/ //If we are displaying an issue, get the issue and strip its header and footer if($function=="current" || $function=="issue" || $function=="ag") { $issuearray=getissue($volume, $issuenum); $contents=stripheadfoot($issuearray[0]); if ($function=="ag") $contents=str_replace("website", "website at http://medpalmrev.medtau.org", $contents); $vnum=$issuearray[1]; $nnum=$issuearray[2]; if(strlen($vnum)==1)$vnum="0".$vnum; if(strlen($nnum)==1)$nnum="0".$nnum; $newsletter="v".$vnum."n".$nnum; } //Current is used to display the issue without frames, so no title box or navigation bar if($function=="current" || $function=="ag") $titleandnavbar=false; else $titleandnavbar=true; //Build the
| \n"; titlebar(); echo " | |
| "; navbar($searchterm); echo " | \n\n"; //echo""; } //Call the appropriate function switch($function) { case "current": case "ag": //Display latest newsletter without faux frames case "issue": echo $contents; break; //Display an issue with faux frames case "archives": listarchives(); break; //List archived, back issues case "search": searchnewsletters($searchterm); break; //Display results of a search case "searchhelp": searchhelp(); break; //Provide help on searching case "about": about(); break; //Show 'about' info case "contact": contact(); break; //Show contact info case "dltopalm": dltopalm(); break; //Show page with options to get the newsletter for AvantGo or iSilo } //Call appropriate function cont'd if($function=="isiloconv") isiloconv(); //Convert latest issue to iSilo format and download //If function is anything other than isiloconv, close the page. else { if($function!="current" && $function!="ag") echo"\n\n\t |