fetch_from_crossref($doi); extract($response); } } if (empty($title)) { if (isset($_GET['failed']) && $_GET['failed'] == '1') { $string = preg_replace($patterns, ' ', $string); $string = preg_replace('/(^|\\s)\\S{1,2}(\\s|$)/', ' ', $string); $string = preg_replace('/\\s{2,}/', " ", $string); $fulltext_array = array(); $fulltext_unique = array(); $fulltext_array = explode(" ", $string); $fulltext_unique = array_unique($fulltext_array); $string = implode(" ", $fulltext_unique); database_connect($database_path, 'library'); record_unknown($dbHandle, $orig_filename, $string, $file, $userID); $put = " ({$i}) " . basename($orig_filename) . ": Recorded into category !unknown. No database record found.<br>"; } else { $put = " ({$i}) " . basename($orig_filename) . ": No database record found.<br>"; } } if (!empty($title)) { database_connect($database_path, 'library'); if (!empty($authors)) { $authors_ascii = utf8_deaccent($authors); } $title_ascii = utf8_deaccent($title); if (!empty($abstract)) { $abstract_ascii = utf8_deaccent($abstract); } ########## record publication data, table library ##########
fetch_from_crossref($doi); extract($response); } } if (empty($title)) { if (isset($_GET['failed']) && $_GET['failed'] == '1') { $string = preg_replace($patterns, ' ', $string); $string = preg_replace('/(^|\\s)\\S{1,2}(\\s|$)/', ' ', $string); $string = preg_replace('/\\s{2,}/', " ", $string); $fulltext_array = array(); $fulltext_unique = array(); $fulltext_array = explode(" ", $string); $fulltext_unique = array_unique($fulltext_array); $string = implode(" ", $fulltext_unique); database_connect($database_path, 'library'); record_unknown($dbHandle, '', $string, $file, $userID); $put = " ({$i}) " . basename($file) . ": Recorded into category !unknown. No database record found.<br>"; file_put_contents($log, $put, FILE_APPEND); } else { $put = " ({$i}) " . basename($file) . ": No database record found.<br>"; file_put_contents($log, $put, FILE_APPEND); } } if (!empty($title)) { database_connect($database_path, 'library'); if (!empty($authors)) { $authors_ascii = utf8_deaccent($authors); } $title_ascii = utf8_deaccent($title); if (!empty($abstract)) { $abstract_ascii = utf8_deaccent($abstract);