Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
buechereielektrik:unapi:picarecord.php [2009-12-15 20:55] – Added function "getJson" to class "Picappn". Made ISBN in getBibTex() unique. Filtered some characters in getArrayNice(). strols | buechereielektrik:unapi:picarecord.php [2009-12-26 14:44] – rosenke | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | < | + | < |
<?php | <?php | ||
Line 27: | Line 27: | ||
/* Changelog | /* Changelog | ||
* | * | ||
+ | | ||
+ | | ||
+ | | ||
| | ||
| | ||
Line 124: | Line 127: | ||
$ch = substr($str, | $ch = substr($str, | ||
$tag = $this-> | $tag = $this-> | ||
+ | | ||
| | ||
- | |||
case 30: // | case 30: // | ||
| | ||
- | |||
case 226: //pica two byte char accent like " | case 226: //pica two byte char accent like " | ||
$ch = substr($str, | $ch = substr($str, | ||
- | $res .= $this-> | + | $res[$tag] |
| | ||
- | |||
default: | default: | ||
| | ||
| | ||
} //switch | } //switch | ||
- | |||
} | } | ||
return $res; | return $res; | ||
Line 385: | Line 385: | ||
break; | break; | ||
} | } | ||
- | | + | //return $res; |
} | } | ||
/** public -- parse dublin core data */ | /** public -- parse dublin core data */ | ||
//client functionality | //client functionality | ||
+ | // comment out if using PHP4 | ||
function readDublinCore($str) { | function readDublinCore($str) { | ||
$doc = new DomDocument(); | $doc = new DomDocument(); | ||
Line 414: | Line 415: | ||
/** public -- parse dublin core data */ | /** public -- parse dublin core data */ | ||
// experimental, | // experimental, | ||
+ | /* | ||
function readRDF_DC($str) { | function readRDF_DC($str) { | ||
$doc = new DomDocument(); | $doc = new DomDocument(); | ||
Line 435: | Line 437: | ||
| | ||
} | } | ||
+ | */ | ||
/** private -- read tag content from string */ | /** private -- read tag content from string */ | ||
Line 595: | Line 598: | ||
if (substr($record_nice[' | if (substr($record_nice[' | ||
//Type | //Type | ||
- | $res .= "@book {"; | + | $res = "@book {"; |
//create identifier | //create identifier | ||
Line 618: | Line 621: | ||
/** private -- get data via pica xml interface */ | /** private -- get data via pica xml interface */ | ||
function getData($ppn) { | function getData($ppn) { | ||
- | $ch = curl_init(" | + | |
- | curl_setopt($ch, | + | if (function_exists(' |
- | curl_setopt($ch, | + | |
- | // | + | curl_setopt($ch, |
- | curl_setopt($ch, | + | curl_setopt($ch, |
- | $res = curl_exec($ch); | + | // |
- | curl_close($ch); | + | curl_setopt($ch, |
+ | $res = curl_exec($ch); | ||
+ | curl_close($ch); | ||
+ | } else { | ||
+ | $res = file_get_contents(" | ||
+ | } | ||
return $res; | return $res; | ||
} | } | ||
Line 650: | Line 658: | ||
| | ||
$res .= "< | $res .= "< | ||
- | .$this-> | + | .$this-> |
$res .= "< | $res .= "< | ||
$res .= "< | $res .= "< | ||
Line 777: | Line 785: | ||
$record_nice = $this-> | $record_nice = $this-> | ||
$keys_nice = $this-> | $keys_nice = $this-> | ||
+ | $res = ""; | ||
if (substr($record_nice[' | if (substr($record_nice[' |