Publications


ADS.'."

\n"; //USING NORMAL PHP METHOD $xmlstr = file_get_contents($ads_url); //USING WORDPRESS METHOD: //$xmlstr = wp_remote_fopen($ads_url); $xml = new SimpleXMLElement($xmlstr); foreach ($xml->record as $record) { $nmax = 5; $n = 0; $m = 0; $limited = array(); $showname = array(); foreach($record->author as $a) { $name = $a; /*explode(',', $a);*/ //$surname = $ns[0]; $showname = false; if ($boldnames != null) { foreach ($boldnames as $s) { if (substr_count($name, $s)) { $name = '' . $a . ''; $showname = true; } } } $limited[] = $name; /* if ($n < $nmax) { $limited[] = $surname; $m = $n; } else if ($showname) { if ($n > $m + 1) { $limited[] = '...'; } $limited[] = $surname; $m = $n; } $n = $n + 1;*/ } /* if ($n > $m + 1) { $limited[] = 'et al.'; }*/ $authors = implode('; ', $limited); $pubdate = explode(' ', $record->pubdate); $year = $pubdate[1]; $link = ''; foreach ($record->link as $l) { if ($l['type'] == 'ABSTRACT') { $link = $l->url; break; } } // echo "
-----
\n"; echo '' . $record->title . "
\n"; echo $authors, ",
\n", $year, ", ", $record->journal, "

\n"; } ?>

Thanks to Steven Bamford for this script.