-
Notifications
You must be signed in to change notification settings - Fork 1
/
proxy.php
32 lines (26 loc) · 902 Bytes
/
proxy.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
//
define('ROOT_DIR', dirname(dirname(__FILE__)));
set_include_path('.' . PATH_SEPARATOR . ROOT_DIR . '/library'
. PATH_SEPARATOR . get_include_path());
require_once 'zoteroconfig.php';
require_once 'library/libZoteroSingle.php';
$library = new Zotero_Library($libraryType, $userID, $userSlug, $apiKey);
$fetchParameters = array('limit'=>10, 'collectionKey'=>'AWB4B3P4');
$items = $library->loadItemsTop($fetchParameters);
//var_dump($items);
$displayFields = array('title', 'creator', 'dateAdded');
//output the list of fetched items with the chosen fields
$output = '';
$output .= "<ul class='zoteroItems'>";
foreach($items as $item){
$output .= "<li class='zoteroItem'>";
foreach($displayFields as $field){
$output .= htmlspecialchars($item->formatItemField($field) . " - ");
}
$output .= "</li>";
}
$output .= "</ul>";
echo $output;
//var_dump($output);
?>