diff --git a/isbn/b3kat.php b/isbn/b3kat.php index 0f6a78f..c5819a8 100644 --- a/isbn/b3kat.php +++ b/isbn/b3kat.php @@ -28,7 +28,7 @@ include 'lib.php'; -$id = yaz_connect(B3KAT_URL, array("user" => B3KAT_USER, "password" => B3KAT_PASSWORD));//"mab2; charset=iso5426,utf8" +$id = yaz_connect(B3KAT_URL, array("user" => B3KAT_USER, "password" => B3KAT_PASSWORD)); //"mab2; charset=iso5426,utf8" yaz_syntax($id, B3KAT_SYNTAX); yaz_range($id, 1, 10); yaz_element($id, B3KAT_ELEMENTSET); @@ -41,10 +41,10 @@ if (isset($_GET['isbn'])) { $n = trim($_GET['isbn']); $nArray = explode(",", $n); - if (count($nArray)>1) { + if (count($nArray) > 1) { //mehrere ISBNs, z.B. f @or @or @attr 1=7 "9783937219363" @attr 1=7 "9780521369107" @attr 1=7 "9780521518147" //Anfuehrungsstriche muessen demaskiert werden, egal ob String mit ' gemacht wird - $suchString = str_repeat("@or ", count($nArray)-1) . '@attr 1=7 \"' . implode('\" @attr 1=7 \"', $nArray) . '\"'; + $suchString = str_repeat("@or ", count($nArray) - 1) . '@attr 1=7 \"' . implode('\" @attr 1=7 \"', $nArray) . '\"'; yaz_search($id, "rpn", $suchString); } else { yaz_search($id, "rpn", '@attr 5=100 @attr 1=7 "' . $n . '"'); @@ -57,7 +57,7 @@ $error = yaz_error($id); if (!empty($error)) { echo "Error Number: " . yaz_errno($id); - echo "Error Description: " . $error ; + echo "Error Description: " . $error; echo "Additional Error Information: " . yaz_addinfo($id); } @@ -67,23 +67,23 @@ for ($p = 1; $p <= yaz_hits($id); $p++) { - $record = yaz_record($id, $p, "render;charset=iso5426,utf8");//render;charset=iso5426,utf8 - $recordArray = explode("\x1e", $record); + $record = yaz_record($id, $p, "render;charset=iso5426,utf8"); //render;charset=iso5426,utf8 + $recordArray = explode("\x1e", $record); $header = substr($recordArray[0], 0, 24); - $recordContent = ''."\n"; + $recordContent = '' . "\n"; $recordContent .= printLine(substr($recordArray[0], 24)); for ($j = 1; $j < count($recordArray); $j++) { $recordContent .= printLine($recordArray[$j]); } - $recordContent .= ''."\n"; - $outputString .= $recordContent; + $recordContent .= '' . "\n"; + $outputString .= $recordContent; array_push($outputArray, $recordContent); } -$outputString .= ""; +$outputString .= ""; yaz_close($id); $map = $standardMabMap; @@ -93,7 +93,7 @@ header('Content-type: text/xml'); echo $outputString; -} else if ($_GET['format']=='json') { +} else if ($_GET['format'] == 'json') { $outputXml = simplexml_load_string($outputString); $outputMap = performMapping($map, $outputXml); diff --git a/isbn/hebis.php b/isbn/hebis.php index a4187fd..9a7df16 100644 --- a/isbn/hebis.php +++ b/isbn/hebis.php @@ -29,7 +29,7 @@ include 'lib.php'; $id = yaz_connect(HEBIS_URL); -yaz_syntax($id, HEBIS_SYNTAX);// +yaz_syntax($id, HEBIS_SYNTAX); // yaz_range($id, 1, 10); yaz_element($id, HEBIS_ELEMENTSET); // @@ -43,7 +43,7 @@ if (count($nArray) > 1) { //mehrere ISBNs, z.B. f @or @or @attr 1=7 "9783937219363" @attr 1=7 "9780521369107" @attr 1=7 "9780521518147" //Anfuehrungsstriche muessen demaskiert werden, egal ob String mit ' gemacht wird - $suchString = str_repeat("@or ", count($nArray)-1) . '@attr 1=7 \"' . implode('\" @attr 1=7 \"', $nArray) . '\"'; + $suchString = str_repeat("@or ", count($nArray) - 1) . '@attr 1=7 \"' . implode('\" @attr 1=7 \"', $nArray) . '\"'; yaz_search($id, "rpn", $suchString); } else { yaz_search($id, "rpn", '@attr 5=100 @attr 1=7 "' . $n . '"'); @@ -55,7 +55,7 @@ $error = yaz_error($id); if (!empty($error)) { echo "Error Number: " . yaz_errno($id); - echo "Error Description: " . $error ; + echo "Error Description: " . $error; echo "Additional Error Information: " . yaz_addinfo($id); } @@ -64,13 +64,13 @@ $outputArray = []; for ($p = 1; $p <= yaz_hits($id); $p++) { - $record = yaz_record($id, $p, "xml");//Umwandlung in XML + $record = yaz_record($id, $p, "xml"); //Umwandlung in XML //namespace löschen $record = str_replace('xmlns="http://www.loc.gov/MARC21/slim"', '', $record); - $outputString .= $record; + $outputString .= $record; array_push($outputArray, $record); } -$outputString .= ""; +$outputString .= ""; yaz_close($id); $map = $standardMarcMap; @@ -80,7 +80,7 @@ if (!isset($_GET['format'])) { header('Content-type: text/xml'); echo $outputString; -} else if ($_GET['format']=='json') { +} else if ($_GET['format'] == 'json') { $outputXml = simplexml_load_string($outputString); $outputMap = performMapping($map, $outputXml); $outputIndividualMap = []; diff --git a/isbn/lib.php b/isbn/lib.php index 943d267..7443d2c 100644 --- a/isbn/lib.php +++ b/isbn/lib.php @@ -229,14 +229,14 @@ function printLine($line) $ind = substr($line, 3, 1); $inhalt = substr($line, 4); if (strstr($inhalt, "\x1f")) { - $lineArray = explode("\x1f", $inhalt); + $lineArray = explode("\x1f", $inhalt); $output .= "\n"; for ($k = 1; $k < count($lineArray); $k++) { - $output .= ''.printMabContent(substr($lineArray[$k], 1)).''."\n"; + $output .= '' . printMabContent(substr($lineArray[$k], 1)) . '' . "\n"; } $output .= ""; } else { - $output .= ''.printMabContent($inhalt).''."\n"; + $output .= '' . printMabContent($inhalt) . '' . "\n"; } } return $output; diff --git a/isbn/man-sru.php b/isbn/man-sru.php index edcc5fb..d1a59d5 100644 --- a/isbn/man-sru.php +++ b/isbn/man-sru.php @@ -62,7 +62,7 @@ @$doc->loadHTML($result); $xpath = new DOMXPath($doc); -$records = $xpath->query("//records/record/recorddata/record");//beachte: kein CamelCase sondern alles klein schreiben +$records = $xpath->query("//records/record/recorddata/record"); //beachte: kein CamelCase sondern alles klein schreiben $outputString = "\n"; $outputString .= "\n"; @@ -70,10 +70,10 @@ foreach ($records as $record) { - $outputString .= $doc->saveXML($record); + $outputString .= $doc->saveXML($record); array_push($outputArray, $doc->saveXML($record)); } -$outputString .= ""; +$outputString .= ""; $map = $standardMarcMap; @@ -82,7 +82,7 @@ if (!isset($_GET['format'])) { header('Content-type: text/xml'); echo $outputString; -} else if ($_GET['format']=='json') { +} else if ($_GET['format'] == 'json') { $outputXml = simplexml_load_string($outputString); $outputMap = performMapping($map, $outputXml); @@ -97,7 +97,7 @@ header('Content-type: application/json'); echo json_encode($outputMap, JSON_PRETTY_PRINT); -} else if ($_GET['format']=='holdings') { +} else if ($_GET['format'] == 'holdings') { echo "\n\n Bestand UB Mannheim zu ISBN-Suche\n \n \n\n\n"; $outputXml = simplexml_load_string($outputString); $avaNodes = $outputXml->xpath('//datafield[@tag="AVA"]'); @@ -149,7 +149,7 @@ echo '
Bestand der UB Mannheim: '; foreach ($bestand as $loc => $n) { - echo $n . "x" . $loc . ", "; + echo $n . "x" . $loc . ", "; } if ($aveNodes) { echo "E"; @@ -177,17 +177,17 @@ echo '
Bestand der UB Mannheim: eventuell da (' . $size . ")
\n"; echo '
See SRU Result
'; } else { - $urlSWB='http://swb.bsz-bw.de/DB=2.1/SET=11/TTL=2/CMD?ACT=SRCHM&ACT0=SRCH&IKT0=2135&TRM0=%60180%60&ACT1=*&IKT1=1016&TRM1=' . str_replace(" ", "+", $suchStringSWB); + $urlSWB = 'http://swb.bsz-bw.de/DB=2.1/SET=11/TTL=2/CMD?ACT=SRCHM&ACT0=SRCH&IKT0=2135&TRM0=%60180%60&ACT1=*&IKT1=1016&TRM1=' . str_replace(" ", "+", $suchStringSWB); $contentSWB = utf8_decode(file_get_contents($urlSWB)); //echo $contentSWB; - if (strpos($contentSWB, "Es wurde nichts gefunden")===false) { + if (strpos($contentSWB, "Es wurde nichts gefunden") === false) { $nhits = substr_count($contentSWB, 'class="hit"'); if ($nhits !== 0) {//multiple results - $nhits = $nhits/2; + $nhits = $nhits / 2; } else {//single result $nhits = substr_count($contentSWB, 'class="Z3988"'); } - echo '
Bestand der UB Mannheim: SWB sagt ja (' . $nhits .' Treffer)
'; + echo '
Bestand der UB Mannheim: SWB sagt ja (' . $nhits . ' Treffer)
'; } else { echo 'Es wurde nichts gefunden'; diff --git a/isbn/nebis.php b/isbn/nebis.php index 0e2d95d..259a547 100644 --- a/isbn/nebis.php +++ b/isbn/nebis.php @@ -43,7 +43,7 @@ if (count($nArray) > 1) { //mehrere ISBNs, z.B. f @or @or @attr 1=7 "9783937219363" @attr 1=7 "9780521369107" @attr 1=7 "9780521518147" //Anfuehrungsstriche muessen demaskiert werden, egal ob String mit ' gemacht wird - $suchString = str_repeat("@or ", count($nArray)-1) . '@attr 1=7 \"' . implode('\" @attr 1=7 \"', $nArray) . '\"'; + $suchString = str_repeat("@or ", count($nArray) - 1) . '@attr 1=7 \"' . implode('\" @attr 1=7 \"', $nArray) . '\"'; yaz_search($id, "rpn", $suchString); } else { yaz_search($id, "rpn", '@attr 5=100 @attr 1=7 "' . $n . '"'); @@ -56,7 +56,7 @@ $error = yaz_error($id); if (!empty($error)) { echo "Error Number: " . yaz_errno($id); - echo "Error Description: " . $error ; + echo "Error Description: " . $error; echo "Additional Error Information: " . yaz_addinfo($id); } @@ -68,10 +68,10 @@ $record = yaz_record($id, $p, "xml"); //namespace löschen $record = str_replace('xmlns="http://www.loc.gov/MARC21/slim"', '', $record); - $outputString .= $record; + $outputString .= $record; array_push($outputArray, $record); } -$outputString .= ""; +$outputString .= ""; yaz_close($id); @@ -83,7 +83,7 @@ header('Content-type: text/xml'); echo $outputString; -} else if ($_GET['format']=='json') { +} else if ($_GET['format'] == 'json') { $outputXml = simplexml_load_string($outputString); $outputMap = performMapping($map, $outputXml);