/*
* PHP Gedcom Viewer
* Copyright (C) 2002-2003 Nicolas de Vulpian
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
?>
include_once( './include/adodb/adodb.inc.php' );
include_once( './admin/config.php' );
if ( !empty( $ul ) ) { $lang = $ul; }
include_once( './lang/'.$lang.'.php');
include_once( './functions.php' );
if ( $cache_level > 0 ) {
if ( ( $cache_level == 2 ) && ( ( $page == 'surnames_list' ) || ( $page == 'surname' ) || ( $page == 'stats' ) ) ) {
include_once( './include/jpcache/cache.php' );
} elseif ( $cache_level == 1 ) {
include_once( './include/jpcache/cache.php' );
}
}
$root_path = dirname(__FILE__);
if ( empty( $page ) ) {
$flags_html = '
';
$dir = opendir( './lang/' );
while ( $file = readdir($dir) ) {
$file = str_replace( '.php' , '' , $file );
if ( $file != '.' AND $file != '..' ) {
$flags_html .= '

';
}
}
closedir($dir);
$flags_html .= '
';
}
if ( $gen_name != '' ) {
$result = $db->Execute( 'SELECT table_name , title FROM gv_tables_info WHERE table_name="'.$gen_name.'";' );
if ( $result === false ) die ('Failed');
$table = $result->fields[table_name];
$table_individuals = $table."_individuals";
$title = stripslashes( $result->fields[title] );
include_once( './templates/'.$template.'/header.php' );
echo $flags_html.''.stripslashes( $title ).'
';
} else {
$table = "gv_global_index";
$table_individuals = $table;
$table_ID = "genID ,";
$title = GV_GLOBAL_INDEX;
include_once( './templates/'.$default_template.'/header.php' );
echo $flags_html.''.GV_GLOBAL_INDEX.'
';
}
switch ($page) {
case 'list' :
include('./html/list.php');
break;
case 'stats' :
include('./html/stats.php');
break;
case 'search' :
include ('./html/search.php');
break;
case "surnames_list" :
include('./html/surnames_list.php');
break;
case "surname" :
include('./html/surname.php');
break;
case 'ind' :
include('./html/ind.php');
break;
case 'indiv_note' :
include('./html/indiv_note.php');
break;
case 'couple_note' :
include('./html/couple_note.php');
break;
case 'tree' :
include('./html/tree.php');
break;
// Welcome page
default :
include('./html/welcome.php');
break;
}
if ( $logo == true ) {
echo '
by Nicolas de Vulpian ';
} else {
echo '
';
}
if ( $gen_name != '' ) {
include_once( './templates/'.$template.'/footer.php' );
} else {
include_once( './templates/'.$default_template.'/footer.php' );
}
?>