<!DOCTYPE html> <?php require_once './config.php'; //library credentials require_once '../../build/libZoteroSingle.php'; $library = new Zotero_Library($libraryType, $libraryID, $librarySlug, $apiKey); $library->setCacheTtl(300); //load a couple items with multiple content types $items = $library->fetchItems(array('content' => 'bib,coins', 'linkwrap' => 1, 'style' => 'chicago-fullnote-bibliography', 'collectionKey' => $collectionKey)); ?> <html> <head> <title>Publications</title> <meta charset="utf-8"> </head> <body> <h2>Publications</h2> <?php foreach ($items as $item) { ?> <p><?php echo $item->bibContent; ?> <a href="./download.php?itemkey=<?php echo $item->itemKey; ?> ">Download</a></p> <?php echo htmlspecialchars_decode($item->subContents['coins']); ?> <?php
$offset = 0; $length = 50; $index = count($unknownItemKeys); try { while ($offset < $index) { if ($index - $offset > $length) { $uindex = $offset + $length; } else { $uindex = $index; } // echo "fetching set of items from $offset to $uindex \n\n"; $itemKeysToFetch = array_slice($unknownItemKeys, $offset, $length); $offset = $uindex; $params['itemKey'] = implode(',', $itemKeysToFetch); // echo $params['itemKey'] . "\n"; $fetchedSet = $library->fetchItems($params); // echo "Got items up to $uindex \n\n"; } } catch (Exception $e) { echo "Error fetching items\n"; echo $e->getMessage() . "\n"; $lastResponse = $library->getLastResponse(); var_dump($lastResponse); echo "Last Response Body: " . $lastResponse->getRawBody() . " \n"; die("Leaving\n"); } $library->items->addChildKeys(); $items = array(); foreach ($itemKeys as $key) { $item = $library->items->getItem($key); if ($item !== false && empty($item->links['up'])) {