i18n::translate('GEDCOM Statistics'),
'type'=>'both',
'descr'=>i18n::translate('The GEDCOM Statistics block shows the visitor some basic information about the database, such as when it was created and how many people are in it.
It also has a list of the most frequent surnames. You can configure this block to not show the Frequent Surnames list, and you can also configure the GEDCOM to remove or add names to this list. You can set the occurrence threshold for this list in the GEDCOM configuration.'),
'canconfig'=>true,
'config'=>array(
'cache' =>1,
'show_common_surnames'=>'yes',
'stat_indi' =>'yes',
'stat_fam' =>'yes',
'stat_sour' =>'yes',
'stat_other' =>'yes',
'stat_media' =>'yes',
'stat_surname' =>'yes',
'stat_events' =>'yes',
'stat_users' =>'yes',
'stat_first_birth' =>'yes',
'stat_last_birth' =>'yes',
'stat_first_death' =>'yes',
'stat_last_death' =>'yes',
'stat_long_life' =>'yes',
'stat_avg_life' =>'yes',
'stat_most_chil' =>'yes',
'stat_avg_chil' =>'yes',
'stat_link' =>'yes'
)
);
//-- function to print the gedcom statistics block
function print_gedcom_stats($block=true, $config='', $side, $index) {
global $WT_BLOCKS, $ALLOW_CHANGE_GEDCOM, $ctype, $COMMON_NAMES_THRESHOLD, $WT_IMAGE_DIR, $WT_IMAGES, $MULTI_MEDIA;
global $top10_block_present;
if (empty($config)) $config = $WT_BLOCKS['print_gedcom_stats']['config'];
if (!isset($config['stat_indi'])) $config = $WT_BLOCKS['print_gedcom_stats']['config'];
if (!isset($config['stat_first_death'])) $config['stat_first_death'] = $WT_BLOCKS['print_gedcom_stats']['config']['stat_first_death'];
if (!isset($config['stat_last_death'])) $config['stat_last_death'] = $WT_BLOCKS['print_gedcom_stats']['config']['stat_last_death'];
if (!isset($config['stat_media'])) $config['stat_media'] = $WT_BLOCKS['print_gedcom_stats']['config']['stat_media'];
if (!isset($config['stat_link'])) $config['stat_link'] = $WT_BLOCKS['print_gedcom_stats']['config']['stat_link'];
$id = 'gedcom_stats';
$title='';
if ($WT_BLOCKS['print_gedcom_stats']['canconfig']) {
if ($ctype=='gedcom' && WT_USER_GEDCOM_ADMIN || $ctype=='user' && WT_USER_ID) {
if ($ctype=='gedcom') {
$name = WT_GEDCOM;
} else {
$name = WT_USER_NAME;
}
$title .= "";
$title .= "";
}
}
$title.=i18n::translate('GEDCOM Statistics').help_link('index_stats');
$stats=new stats(WT_GEDCOM);
$content = "".PrintReady(strip_tags(get_gedcom_setting(WT_GED_ID, 'title')))." ";
$head = find_other_record('HEAD', WT_GED_ID);
$ct=preg_match('/1 SOUR (.*)/', $head, $match);
if ($ct>0) {
$softrec = get_sub_record(1, '1 SOUR', $head);
$tt= preg_match('/2 NAME (.*)/', $softrec, $tmatch);
if ($tt>0) $software = printReady(trim($tmatch[1]));
else $software = trim($match[1]);
if (!empty($software)) {
$tt = preg_match('/2 VERS (.*)/', $softrec, $tmatch);
if ($tt>0) $version = printReady(trim($tmatch[1]));
else $version='';
$content .= i18n::translate('This GEDCOM was created using %s %s', $software, $version);
}
}
if (preg_match('/1 DATE (.+)/', $head, $match)) {
if (empty($software)) {
$content.=i18n::translate('This GEDCOM was created on %s', $stats->gedcomDate());
} else {
$content.=i18n::translate(' on %s', $stats->gedcomDate());
}
}
$content .= '