From: Michael Ang Date: Mon, 25 Oct 2010 19:48:18 +0000 (+0000) Subject: Add comment in generated BookReader main html showing how to use JSLocate for stable... X-Git-Url: http://git.rot13.org/?p=bookreader.git;a=commitdiff_plain;h=50dd312114aa8bbf1d593eada5c57f3b179e810d Add comment in generated BookReader main html showing how to use JSLocate for stable metadata access instead of referencing datanode directly. --- diff --git a/BookReaderIA/inc/BookReader.inc b/BookReaderIA/inc/BookReader.inc index 7f7b647..f7e1b2e 100644 --- a/BookReaderIA/inc/BookReader.inc +++ b/BookReaderIA/inc/BookReader.inc @@ -107,6 +107,7 @@ class BookReader } $metaURL = BookReader::jsMetadataURL($server, $identifier, $mainDir, $subPrefix); + $locateURL = BookReader::jsLocateURL($identifier, $subPrefix); ?> @@ -149,8 +150,11 @@ class BookReader brConfig["mode"] = 2; - + + +
@@ -241,6 +245,17 @@ class BookReader return $url; } + // This returns a URL that finds the item then returns a redirect to BookReaderJSIA.php + // on the item's server. + public static function jsLocateURL($identifier, $subPrefix = '') + { + $locateURL = 'http://www.archive.org/bookreader/BookReaderJSLocate.php?id=' . $identifier; + if ($subPrefix) { + $locateURL .= '&subPrefix=' . $subPrefix; + } + return $locateURL; + } + // Return the URL for the requested /download/$path, or null public static function getURL($path, $item) { // $path should look like {itemId}/{operator}/{filename}