getVarInt("pgid",1); // make sure not past ends if ( $pgid<1 ) {$pgid = 1; } if ( $pgid>402 ) {$pgid = 402; } //set previous page if ( $pgid>1 ) { $prev = $pgid - 1; } else { $prev = 1; } // set next page if ( $pgid<402 ) { $next=$pgid + 1; } else { $next = 402; } // get name of book or collection if any (such as PeytonsHistory) // $book = $_GET[book]; // Note: having this in the querystring is mostly for SEO $book = $req->getVarString("book",30,"PeytonsHistory"); $bookdisp = $book; if ($book=="PeytonsHistory") { $bookdisp = "Peyton's History of Augusta County, Virginia (1882)"; } // get bookid (integer) for PeytonsHistory (tbd: generalize) $bookid = 2; // get name of location = folder holding current page // = 0 for pages up through 99, 1 for pages 100-199, etc. // calculate this numeric value for // PeytonsHistory = pageID with last two digits removed: $pgbin = (int) ($pgid/100); if ($pgid<100) { $loc="0"; } else { $loc = strval($pgbin); } // build path to file from book and location $path = "books/"; if ($book!="") {$path = $path . $book . "/";} if ($loc!="") {$path = $path . $loc . "/";} // build name of text file if any $txtn = $path . "txt/".$pgid.".txt"; $txtnexists = file_exists($txtn); $sql = "SELECT * FROM pages INNER JOIN chapters ON (pages.intChID = chapters.intChID) WHERE (pages.intPgID=" . $pgid . ") AND (pages.intBookID=2) AND (chapters.intBookID=2) LIMIT 1"; // get data from database $conn = mysql_connect ("localhost", "roanetnh_spadmin", "aO4XpJv9FK"); if (!$conn) { echo "Unable to connect to DB: " . mysql_error(); exit; } if (!mysql_select_db("roanetnh_coll")) { echo "Unable to select database roanetnh_coll: " . mysql_error(); exit; } $result = mysql_query($sql,$conn); if ($myrow = mysql_fetch_array($result)) { // a row for this pgid was found! get fields.... $k = $myrow["strKeywords"]; $t = $myrow["strHTMLTitle"]; $chtitle = $myrow["strChTitle"]; $chsubt = $myrow["strChSubT"]; if (strlen($chsubt)==0) { $chfulltitle = $chtitle; } else { $chfulltitle = $chtitle . ": " . $chsubt; } $pgnum = $myrow["strPgNum"]; if (strlen($pgnum)==0) { $pgdisp = ""; } else { $pgdisp = " -  Page " . $pgnum; } if (strlen($t)>0) { $t = $t . " - " . $chfulltitle . $pgdisp . ", " . $bookdisp; } else { $t = $chfulltitle . $pgdisp . ", " . $bookdisp; } } else { echo "Sorry, no record for page " . $pgid . " found!"; } mysql_close($conn); ?> <? echo $t; ?> /> />

0) { // calculate google books bookmark if ($pgid<8) { // front matter, roman numerals i - vii $googlepgid = $pgid; $googlebookmark = "PR" . $googlepgid; } else { // numbered, 1- $googlepgid = $pgid-7; $googlebookmark = "PA" . $googlepgid; } ?>

Other links about this page of Peyton's History of Augusta County, Virginia:


0 } // show special copyright info such as Creative Commons license if applicable if ($copyrexists) { include($copyr); } ?>