"
.$_LOGIN['logout'].''
." || "
.$_WORDS['administrate'].'');
}
else {
return($_LOGIN['mesg_loggedout']
." || "
.$_LOGIN['login']
.'');
}
}
###################################################################################################### gets the page title
# parameters: none
# returns: correct title of page
function html_get_page_title()
{
global $_MENU,$_CMDS;
$title = isset($_CMDS['query'][0]) ? $_MENU[$_CMDS['query'][0]] : $_MENU['home'];
return($title);
}
###################################################################################################### gets the ouline of the page
# parameters: none
# returns: the html for the current page's outline
function html_get_page_outline()
{
global $_LANG,$_CMDS,$_DOC_ROOT,$_PATH_PREFIX;
$html = '';
$file = $_DOC_ROOT."/data/outlines/{$_LANG}_ol-{$_CMDS['query'][0]}.txt";
if(!file_exists($file)) {
return;
}
$outline = file_get_contents($file); // get the outline for this page
if(empty($outline)) { // each page needs a file, but it can be empty
return;
}
$outline = explode("\n",$outline); // break the outline file contents apart by line
foreach($outline as $line) {
$line = ltrim(rtrim($line));
if(empty($line)) {
continue;
}
list($type,$text,$link) = explode('=',$line);
if(preg_match("/^(\[#([\w_]+)\])/",$link,$matches)) {
$replacement = '';
eval('$replacement = $'.$matches[2].';');
$link = str_replace($matches[1],$replacement,$link);
}
if($type == 'section') {
$html .= "~ $text
\n";
}
else if($type == 'subsection') {
$html .= " - $text
\n";
}
else { $html .= $text; }
}
return($html);
}
###################################################################################################### gets the select box to choose the language
# parameters: none
# returns: the html for the select box for language selection
function html_get_lang_select()
{
global $_LANG,$_CONFIG,$_CLEAN_PATH,$_LANG_LONG;
$select_box = "[ ";
foreach($_CONFIG['langs'] as $lang) {
if($_LANG == $lang) { continue; }
$lang_path = preg_replace("/^\/?$_LANG/","$lang",$_CLEAN_PATH); // replace the current language with this selectable language
//$lang_path = str_replace('.php','',$lang_path); // take out the .php in pae.php (only works when MultiViews works
$select_box .= "{$_LANG_LONG[$lang]}\n";
}
$select_box .= "]
";
return($select_box);
}
###################################################################################################### prints a trainer's biography
# parameters: 1) path to bios; 2) name of specific bio
# returns: nothing
function html_print_bio($bios_path,$bio,$type)
{
global $_PATH_PREFIX,$_TRAINERS,$_MENU,$_WORDS,$_LANG,$_DOC_ROOT;
$bio_data = xml_parse_file($bios_path.$bio); // parse this trainer's xml file
$bio_name = str_replace('.xml','',$bio); // the name for the link will be the same as the file name without the extension
$desc = '
'.$_TRAINERS['default_desc'].'
'; // if no description in the current language is found if(!empty($bio_data['trainer']['biography'])) { if(isset($bio_data['trainer']['biography'][0])) { // if there are several language present foreach($bio_data['trainer']['biography'] as $biography) { // step through each biography (in a different language) if($biography['lang'] == $_LANG) { // if there is one for the current language $desc = "{$biography['paragraph'][0]}
"; $c = 1; while((250 - strlen($desc)) > 20) { // we just want a snippet for the who we are page, not the whole biography $desc .= "{$biography['paragraph'][$c]}
"; // but we also want whole paragraphs, so we don't end in the middle of one $c++; } } } } else { // if only one language is present if($bio_data['trainer']['biography']['lang'] == $_LANG) { $desc = "{$bio_data['trainer']['biography']['paragraph'][0]}
"; // same as above for many languages $c = 1; while((250 - strlen($desc)) > 20) { $desc .= "{$bio_data['trainer']['biography']['paragraph'][$c]}
"; $c++; } } } } $img = $_DOC_ROOT."/data/trainer_pics/thumb_{$bio_data['trainer']['portrait']}"; // the picture file indicated in the xml doc $height = 80; // default height of each trainers div if(file_exists($img)) { // make sure the image file exists list($width,$height) = getimagesize($img); // get the image size, all we will use is the height $img = "';
if(is_array($para)) {
foreach($para as $key => $value) {
switch($key) {
case 'line':
if(is_array($value)) {
foreach($value as $line) { $page_content .= '
'.$line; }
}
else { $page_content .= '
'.$value; }
break;
case 'paracontent':
$page_content .= $value;
break;
case 'list':
$page_content .= "