Example #1
0
}
// Check that we have all the arguments we need
if (empty($_GET['library'])) {
    echo 'Missing parameter: library';
    exit;
}
if (empty($_GET['q']) && empty($_GET['id'])) {
    echo 'Missing parameter: q OR id';
    exit;
}
// Check that page is a number, set it to 0 otherwise
if (!empty($_GET['page']) && !is_int((int) $_GET['page'])) {
    $_GET['page'] = 0;
}
$data = '';
// Search
if (!empty($_GET['q']) && !empty($_GET['library'])) {
    $args = array('q' => $_GET['q'], 'library' => $_GET['library'], 'format' => $_GET['format'] ? $_GET['format'] : 'simple', 'page' => $_GET['page'] ? $_GET['page'] : 0, 'sort_by' => $_GET['sort_by'] ? $_GET['sort_by'] : 'year', 'sort_order' => $_GET['sort_order'] ? $_GET['sort_order'] : 'descending', 'content_type' => true, 'loggedin_user' => $_GET['loggedin_user'] ? 'dummyuser' : '');
    $data = glitre_search($args);
    // Display one record
} elseif (!empty($_GET['id'])) {
    $args = array('id' => $_GET['id'], 'library' => $_GET['library'], 'format' => $_GET['format'] ? $_GET['format'] : 'simple', 'loggedin_user' => $_GET['loggedin_user'] ? 'dummyuser' : '');
    $data = glitre_search($args);
}
// Do the actual output
if ($data && !empty($data['content_type'])) {
    header('Content-type: ' . $data['content_type']);
    echo $data['data'];
} else {
    echo $data;
}
Example #2
0
<p style="text-align: center;">
Z39.50: 
<a href="?library=stavanger&system=Aleph (Z39.50)">Aleph</a>
<a href="?library=deich&system=Bibliofil (Z39.50)">Bibliofil</a>
<a href="?library=hig&system=BIBSYS (Z39.50)">BIBSYS</a>
<a href="?library=sksk&system=Koha (Z39.50)">Koha</a>
<a href="?library=kristiansund&system=Mikromarc (Z39.50)">Mikromarc</a>
Reindex
Tidemann
<br />
SRU: 
<a href="?library=higsru&system=BIBSYS (SRU)">BIBSYS</a>
<a href="?library=pode&system=Koha (SRU)">Koha</a>
</p>

<?php 
/* 
This file is intended to test the different sorting behaviours of our target systems. 
*/
include '../inc.glitre.php';
if (!empty($_GET['library'])) {
    if (!empty($_GET['system'])) {
        echo '<h1>' . $_GET['system'] . '</h1>';
    }
    $args = array('q' => 'oslo', 'library' => $_GET['library'], 'format' => 'plugin.simple', 'page' => 1, 'per_page' => 20);
    echo glitre_search($args);
}
?>

</body>
</html>