{$_ERRORS['trainer']['nosuch_title']}
{$_ERRORS['trainer']['nosuch_msg']}
"; return; } $bio_data = xml_parse_file($bio_path); // parse the xml into an associative array $bio_name = $_CMDS['query'][1]; // the name of the bio is the second element of the query array (see main_get_commands) if(!empty($bio_data['trainer']['biography'])) { $bio_desc = ''; if(isset($bio_data['trainer']['biography'][0])) { // ...['biography'] will be an array if there are descriptions in more than one language for this guy foreach($bio_data['trainer']['biography'] as $biography) { // if there is more than one language if($biography['lang'] == $_LANG) { // find the right language desc and collect all the paragraphs of the description $bio_desc = $biography; } } } else { if($bio_data['trainer']['biography']['lang'] == $_LANG) { $bio_desc = $bio_data['trainer']['biography']; } } $paras = xml_force_array($bio_desc['paragraph']); if(!empty($paras)) { $desc = ''; foreach($paras as $para) { $desc .= "

$para

\n"; } } } $img = $_DOC_ROOT."/data/trainer_pics/thumb_{$bio_data['trainer']['portrait']}"; // make bio picture image html $height = 80; if(file_exists($img)) { list($width,$height) = getimagesize($img); $img = ""; } else { $img = ''; } $notes = ''; if(!empty($bio_data['trainer']['note'])) { // add notes to the details, if they are present $note = ''; if(isset($bio_data['trainer']['note'][0])) { foreach($bio_data['trainer']['note'] as $note_info) { if($note_info['lang'] == $_LANG) { $note = $note_info; } } } else { if($bio_data['trainer']['note']['lang'] == $_LANG) { $note = $bio_data['trainer']['note']; } } $notes .= "({$note['content']})"; } $contact = ''; foreach($bio_data['trainer']['contact'] as $key => $value) { // get contact information if(!empty($value)) { if($key == 'email') $contact .= "{$_WORDS[$key]}:$value\n"; else $contact .= "{$_WORDS[$key]}:$value\n"; } } if(!empty($contact)) { // put the contact info in correct html $contact = "
{$_MENU['contact']} Information
$contact
"; } if(!empty($bio_data['trainer']['title'][$_LANG])) { $bio_data['trainer']['title'][$_LANG] = "
{$bio_data['trainer']['title'][$_LANG]}"; } if(!empty($bio_data['trainer']['degrees'])) { $bio_data['trainer']['name'] .= ','; } print "
{$bio_data['trainer']['name']} {$bio_data['trainer']['degrees']} {$bio_data['trainer']['title'][$_LANG]} $notes
$img $contact
{$_WORDS['biography']}
$desc
"; ?>