metadataGrabber->mainDir . '/'); foreach ($item->getFiles() as $location => $fileInfo) { $filename = substr($location, $baseLength); if ($checkOldScandata) { if ($filename == 'scandata.xml' || $filename == 'scandata.zip') { $foundScandata = $filename; } } if ($filename == $targetScandata) { $foundScandata = $filename; } if (preg_match($imageFormatRegex, $filename)) { $foundImageStack = $filename; } } if ($foundScandata && $foundImageStack) { return true; } return false; } // Finds the prefix to use for the book given the part of the URL trailing after /stream/ public static function findPrefix($urlPortion) { if (!preg_match('#[^/&?]+#', $urlPortion, $matches)) { return false; } $prefix = $matches[0]; // identifier // $$$ Currently swallows the rest of the URL. // If we want to support e.g. /stream/itemid/subdir/prefix/page/23 will need to adjust. if (preg_match('#[^/&?]+/([^&?]+)#', $urlPortion, $matches)) { $prefix = $matches[1]; // sub prefix } return $prefix; } // $$$ would be cleaner to use different templates instead of the uiMode param // // @param subprefix Optional prefix to display a book inside an item (e.g. if does not match identifier) public static function draw($server, $mainDir, $identifier, $subPrefix, $title, $coverLeaf=null, $titleStart='Internet Archive', $uiMode='full') { // Set title to default if not set if (!$title) { $title = 'Bookreader'; } $id = $identifier; // manually update with Launchpad version number at each checkin so that browsers // do not use old cached version // see https://bugs.launchpad.net/gnubook/+bug/330748 $version = "0.9.21"; if ("" == $id) { echo "No identifier specified!"; die(-1); } $metaURL = BookReader::jsMetadataURL($server, $identifier, $mainDir, $subPrefix); ?> <? echo $title; ?>
Internet Archive BookReader
Internet Archive Bookreader

Search results
Internet Archive
$identifier, 'itemPath' => $mainDir, 'server' => $server ); if ($subPrefix) { $params['subPrefix'] = $subPrefix; } $keys = array_keys($params); $lastParam = end($keys); $url = "http://{$serverBaseURL}/BookReader/BookReaderJSIA.php?"; foreach($params as $param=>$value) { $url .= $param . '=' . $value; if ($param != $lastParam) { $url .= '&'; } } return $url; } } ?>