Beispiel #1
0
<?php

include 'app/app.php';
$customparams = loadCustomParams($c, decryptCookie($_COOKIE['oauth_consumer_key']));
require_once 'rest/EBSCOAPI.php';
$clean = strip_tags_deep($_REQUEST);
$an = $clean['an'];
$db = $clean['db'];
$api = new EBSCOAPI($c, $customparams);
$record = $api->apiRetrieve($an, $db);
//Call Retrieve Method to get the PDF Link from the record
if (empty($record['pdflink'])) {
    echo "<p>Oops!  There has been an error.  Please click back in your browser and try the link again.  If you continue to see this error, please contact your library.  Error: PDF-1.</p>";
} else {
    header("location: {$record['pdflink']}");
}
<?php

include 'app/app.php';
if (!isset($_COOKIE['currentListId'])) {
    echo "<div class='readingListLink'>Please open a reading list via your course website before using this feature.</div>";
    die;
}
$customparams = loadCustomParams($c, decryptCookie($_COOKIE['oauth_consumer_key']));
include 'rest/EBSCOAPI.php';
$api = new EBSCOAPI($c, $customparams);
$clean = strip_tags_deep($_REQUEST);
if (!isset($clean['db']) || !isset($clean['db'])) {
    echo "<div class='readingListLink'>Error: couldn't add this to the reading list.</div>";
    die;
} else {
    $db = $clean['db'];
    $an = $clean['an'];
}
$highlight = "";
$result = $api->apiRetrieve($an, $db, $highlight);
if (isset($result['error'])) {
    $error = $result['error'];
    echo "<div class='readingListLink'>Error: " . $result['error'] . "</div>";
    die;
} else {
    $error = null;
}
$variables = array('result' => $result, 'error' => $error, 'id' => 'record', 'c' => $c, 'customparams' => $customparams, 'an' => $an, 'db' => $db, 'currentListId' => decryptCookie($_COOKIE['currentListId']));
ebsco_render('add_to_list.html', 'layout.html', $variables);
include 'app/app.php';
$customparams = loadCustomParams($c, decryptCookie($_COOKIE['oauth_consumer_key']));
include 'rest/EBSCOAPI.php';
$api = new EBSCOAPI($c, $customparams);
$clean = strip_tags_deep($_REQUEST);
$db = $clean['db'];
$an = $clean['an'];
//echo $db . " - " . $an;
if (!isset($_COOKIE['login'])) {
    $end = lastIndexOf($_SERVER['PHP_SELF'], "/");
    $loginURL = $proxyprefix . $baseURLfull . $authURL . "&path=fulltext&an=" . $an . "&db=" . $db;
    //echo $loginURL;
    header("Location: " . $loginURL);
} else {
    $result = $api->apiRetrieve($an, $db);
    // Set error
    if (isset($result['error'])) {
        $error = $result['error'];
    } else {
        $error = null;
    }
    // Link priority:
    // 1. PDF and HTML full-text native to EDS
    // 2. eBook full-text links
    // 3. Custom links
    // get PDF or HTML redirect links
    if (!empty($result['pdflink'])) {
        $redirectURL = $result['pdflink'];
    } else {
        if (!empty($result['htmllink'])) {