$v) { $namestr.=$prefix . $mm[1][$k] . ", " . $mm[2][$k]; $prefix="; "; } } } $ret=$orig; if ($key=="pmid") { $match='/"date":"(.*?)",/ism'; if (preg_match($match, $orig, $m)) { $match="/([0-9]{4}) +([A-Za-z]{3}) +([0-9]{1,2})/ism"; if (preg_match("/([0-9]{4}) +([A-Za-z]{3}) +([0-9]{1,2})/ism", $m[1], $mm)) { $date_str=date("j.n.Y", strtotime(trim($mm[3] ." " . $mm[2] ." " .$mm[1]))); } else if (preg_match("/([0-9]{1,2}) +([A-Za-z]{3}) +([0-9]{4})/ism", $m[1], $mm)) { $date_str=date("j.n.Y", strtotime(trim($mm[1] ." " . $mm[2] ." " .$mm[3]))); } else if (preg_match("/([0-9]{1,2})-([0-9]{1,2})-([0-9]{4})/ism", $m[1], $mm)) { $date_str=$mm[1] ."." . $mm[2] ."." .$mm[3]; } else if (preg_match("/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/ism", $m[1], $mm)) { $date_str=$mm[3] ."." . $mm[2] ."." .$mm[1]; } else $date_str=$m[1]; $ret=str_replace('"date"', '"date_fi":"' . $date_str .'","date"', $orig); } } $authors_fi_param='"authors_fi":"' . $namestr .'"'; //$ret=str_replace('"authors":', $authors_fi_param .',"authors":', $orig); //$script=";\$j('.cite-" . $template ."-authors').css('background-color','red');"; echo $ret; ?>