try{
$urlPath = HttpInput::Str(GET, 'url-path');
if($urlPath !== null){
$identifier = EBOOKS_IDENTIFIER_PREFIX . trim(str_replace('.', '', $urlPath), '/'); // Contains the portion of the URL (without query string) that comes after `https://standardebooks.org/ebooks/`.
$project = Project::GetByIdentifierAndIsActive($identifier);
}
else{
$project = Project::Get(HttpInput::Int(GET, 'project-id'));
}
$indent = HttpInput::Bool(GET, 'indent') ?? false;
$output = new stdClass();
$output->Name = $project->Reviewer->Name;
$output->SortName = $project->Reviewer->SortName;
switch($output->Name){
case 'Alex Cabal':
$output->Url = 'https://alexcabal.com';
break;
case 'Emma Sweeney':
$output->Url = 'https://www.linkedin.com/in/emma-sweeney-554927190/';
break;
case 'Weijia Cheng':
$output->Url = 'https://weijiarhymeswith.asia';
break;
case 'Robin Whittleton':
$output->Url = 'https://www.robinwhittleton.com';
break;
case 'Vince Rice':
$output->Url = 'https://www.brokenandsaved.com';
break;
case 'David Reimer':
$output->Url = 'https://github.com/dajare';
$output->NacoafUrl = 'http://id.loc.gov/authorities/names/n92075987';
break;
}
header('Content-type: text/plain');
}
catch(Exceptions\ProjectNotFoundException){
Template::ExitWithCode(Enums\HttpCode::NotFound);
}
?>
if($indent){ ?> } ?>= Formatter::EscapeXml($output->Name) ?>
if($indent){ ?> } ?>= Formatter::EscapeXml($output->SortName) ?>
if(isset($output->Url)){ ?>
if($indent){ ?> } ?>= Formatter::EscapeXml($output->Url) ?>
} ?>
if(isset($output->NacoafUrl)){ ?>
if($indent){ ?> } ?>= Formatter::EscapeXml($output->NacoafUrl) ?>
} ?>
if($indent){ ?> } ?>pfr