$row) {
$year = intval($row->year);
if ($previousYear > $year) {
// close previous year if any
if ($previousYear) {
echo "";
}
$previousYear = $year;
// start new year section
echo "
" . $year . "
"; echo "- ";
}
echo "
- ";
// format authors as "Last AB" from "Last, Adam B"
$authors = explode(" and ", $row->author);
array_walk($authors, function(&$value, $key) {
$parts = explode(", ", $value);
$cnt = count($parts);
//$output = $parts[$cnt - 1]; // last name
$output = $parts[0]; // last name
$output .= " ";
$parts = explode(" ", $parts[1]);
$cnt = count($parts);
for ($i = 0; $i < $cnt; $i++) {
$output .= strtoupper(mb_substr($parts[$i], 0, 1));
}
$value = $output;
}); // array_walk
$authorsStr = implode(", ", $authors);
echo $authorsStr . ": ";
echo $row->title . " ";
echo "";
if ($row->journal) {
echo $row->journal . ", ";
}
if ($row->volume) {
echo $row->volume;
if ($row->number) {
echo "(" . $row->number . ")";
}
echo ", ";
}
if ($row->pages) {
echo $row->pages . ", ";
}
echo $year;
echo ". ";
$doiUrl = "https://dx.doi.org/" . $row->doi;
echo "(DOI)";
//echo " (" . $row->type . ")";
//echo "Date: " . $row->date . "
"; /* // TAGS DISABLED FOR NOW... echo "Tags: "; // fields: name. tag_id, pub_id, con_id $tags = tp_tags::get_tags(array('pub_id' => $row->pub_id)); $names = array(); foreach ($tags as $tag) { $names[$tag->tag_id] = $tag->name; } $tagline = implode(", ", $names); echo $tagline; echo "
"; */ echo " ";
}
// end list if any
if ($publications) {
echo "