public function getBookGdata($isbn_id) { $objGdata = new Zend_Gdata_Books(); $query = $objGdata->newVolumeQuery(); $isbnno = 'isbn:' . $isbn_id; $query->setQuery($isbnno); $feed = $objGdata->getVolumeFeed($query); $thumbnail_img = null; foreach ($feed as $entry) { $thumbnailLink = $entry->getThumbnailLink(); if ($thumbnailLink) { $thumbnail = $thumbnailLink->href; } else { $thumbnail = null; } $preview = $entry->getPreviewLink()->href; $thumbnail_img = !$thumbnail ? '' : '<a href="' . $preview . '"><img src="' . $thumbnail . '"/></a>'; } return $thumbnail_img; }
} print <<<HTML </table></div></td> <td width=50% id="previewcell"><div id="viewport"></div> </td></tr></table><br></body></html> HTML; } /* * The main controller logic of the Books volume browser demonstration app. */ $queryType = isset($_GET['queryType']) ? $_GET['queryType'] : null; include 'interface.html'; if ($queryType === null) { /* display the entire interface */ } else { $books = new Zend_Gdata_Books(); $query = $books->newVolumeQuery(); /* display a list of volumes */ if (isset($_GET['searchTerm'])) { $searchTerm = $_GET['searchTerm']; $query->setQuery($searchTerm); } if (isset($_GET['startIndex'])) { $startIndex = $_GET['startIndex']; $query->setStartIndex($startIndex); } if (isset($_GET['maxResults'])) { $maxResults = $_GET['maxResults']; $query->setMaxResults($maxResults); } if (isset($_GET['minViewability'])) {