@@ -591,7 +591,6 @@ } $output = array(); - // Get current time before we start fetching. Fetching shouldnt take // long, but in theory there could be a really small window in which // a record could be created in and not fetched, and man that would @@ -618,9 +617,10 @@ // Get the last fetch date, if we cant get the earliest date stamp // and if we cant do that, die. $from = variable_get('oai_pmh_'. $repo .'_last_fetch', - variable_get('oai_pmh_'. $repo .'_earliest_datestamp', FALSE)); + variable_get('oai_pmh_'. $repo .'_earliest_datestamp',FALSE)); + if(!isset($from) || $from=="") + $from = variable_get('oai_pmh_'. $repo .'_earliest_datestamp',FALSE); } - // Define the request limit. $day_span_to_harvest = 60; // TODO: Remove hardcoded option $until = date($date_format, strtotime($from) + ($day_span_to_harvest * 3600 * 24)); @@ -652,13 +652,12 @@ } } else {*/ - $output[] = t('Processing @repository, dates @start - @end', array('@repository' => $repo, '@start' => $from, '@end' => $until)); $request = '?verb=ListRecords&from='. _oai_pmh_clean_url($from) . '&until=' . _oai_pmh_clean_url($until) . '&metadataPrefix=oai_dc'; #$request = "?verb=ListRecords&from=2010-01-01T19%3A20%3A30Z&until=2010-01-11T13%3A01%3A30Z&metadataPrefix=oai_dc"; - $result = oai_pmh_do_work($repo, $request, $record_store['store']); + $result = oai_pmh_do_work($repo, $request, $record_store['store']); $output[] = theme('item_list', array($result['output'])); if ((bool)$result['error']) { $error = true; @@ -716,7 +715,6 @@ } else { $s = simplexml_load_string($xml); - if (!$s) { die('SimpleXML load string error: '. $xml); } @@ -814,10 +812,10 @@ if ((isset($dc_node->subject)) && ($vid != '-1')) { foreach ($dc_node->subject as $term) { // Remove all numbers - $numbers = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); - $term = str_replace($numbers, '', $term); + //$numbers = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); + //$term = str_replace($numbers, '', $term); // Escape quotes - $term = str_replace('"', '\\"', $term); + /*$term = str_replace('"', '\\"', $term); //Here strip all the tags that the user would like to remove $term = str_replace($strip_tags, '', $term); @@ -836,7 +834,8 @@ $term = str_replace('::', '","', $term); $term = str_replace('--', '","', $term); $term = str_replace('-', '","', $term); - $term = str_replace(':', '","', $term); + $term = str_replace(':', '","', $term);*/ + $term = str_replace('DoajSubjectTerm: ', '', $term); $term = trim($term); if ($term != "") { $term = '"'. $term . '"'; @@ -866,8 +865,8 @@ $vid = variable_get('oai_pmh_'. $repo .'_creator',''); $term=""; $tags_this_vid=""; - if ((isset($dc_node->creator))&&($vid!='-1')) { - foreach ($dc_node->creator as $term) { + if ((isset($dc_node->publisher))&&($vid!='-1')) { + foreach ($dc_node->publisher as $term) { //Here strip all the tags that the user would like to remove for ($i = 0, $size = sizeof($strip_tags); $i < $size; ++$i) { $term = str_replace($strip_tags[$i], '', $term);