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 .= "\"".i18n::translate('Configure')."\""; } } $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 .= '
'; if ($config['stat_indi']=='yes') { $content.=''; $content.=''; $content.=''; } if ($config['stat_surname']=='yes') { $content .= ''; } if ($config['stat_fam']=='yes') { $content .= ''; } if ($config['stat_sour']=='yes') { $content .= ''; } if ($config['stat_media']=='yes' && $MULTI_MEDIA==true) { $content .= ''; } if ($config['stat_other']=='yes') { $content .= ''; } if ($config['stat_events']=='yes') { $content .= ''; } if ($config['stat_users']=='yes') { $content .= ''; } if (!$block) { $content .= '
'.i18n::translate('Individuals').'
'.i18n::translate('Males').'
'.$stats->totalSexMales().'
'.$stats->totalSexMalesPercentage().'%
'.i18n::translate('Females').'
'.$stats->totalSexFemales().'
'.$stats->totalSexFemalesPercentage().'%
'.i18n::translate('Total surnames').'
'. i18n::translate('Families').'
'. i18n::translate('Sources').'
'. i18n::translate('Media objects').'
'. i18n::translate('Other records').'
'.$stats->totalOtherRecords().'
'. i18n::translate('Total events').'
'.$stats->totalEvents().'
'. i18n::translate('Total users').'
'; if (WT_USER_GEDCOM_ADMIN){ $content .= ''.$stats->totalUsers().''; } else { $content .= $stats->totalUsers(); } $content .= '

'; } if ($config['stat_first_birth']=='yes') { $content .= ''; if (!$block) { $content .= ''; } $content .= ''; } if ($config['stat_last_birth']=='yes') { $content .= ''; if (!$block){ $content .= ''; } $content .= ''; } if ($config['stat_first_death']=='yes') { $content .= ''; if (!$block){ $content .= ''; } $content .= ''; } if ($config['stat_last_death']=='yes') { $content .= ''; if (!$block){ $content .= ''; } $content .=''; } if ($config['stat_long_life']=='yes') { $content .= ''; if (!$block){ $content .= ''; } $content .= ''; } if ($config['stat_avg_life']=='yes') { $content .= ''; if (!$block) { $content .= ''; } $content .= ''; } if ($config['stat_most_chil']=='yes' && !$block) { $content .= ''; if (!$block) { $content .= ''; } $content .= ''; } if ($config['stat_avg_chil']=='yes') { $content .= ''; if (!$block) { $content .= ''; } $content .= ''; } $content .= '
'. i18n::translate('Earliest birth year').'
'.$stats->firstBirthYear().'
'.$stats->firstBirth().'
'. i18n::translate('Latest birth year').'
'.$stats->lastBirthYear().'
'.$stats->lastBirth().'
'. i18n::translate('Earliest death year').'
'.$stats->firstDeathYear().'
'.$stats->firstDeath().'
'. i18n::translate('Latest death year') .'
'.$stats->lastDeathYear().'
'.$stats->lastDeath().'
'. i18n::translate('Person who lived the longest').'
'.$stats->LongestLifeAge().'
'.$stats->LongestLife().'
'. i18n::translate('Average age at death').'
'.$stats->averageLifespan().'
'.i18n::translate('Males').': '.$stats->averageLifespanMale(); $content .= '   '.i18n::translate('Females').': '.$stats->averageLifespanFemale().'
'. i18n::translate('Family with the most children').'
'.$stats->largestFamilySize().'
'.$stats->largestFamily().'
'. i18n::translate('Average number of children per family').'
'.$stats->averageChildren().'
 
'; if ($config['stat_link']=='yes') { $content .= ''.i18n::translate('View statistics as graphs').'
'; } // NOTE: Print the most common surnames if ($config['show_common_surnames']=='yes') { $surnames = get_common_surnames($COMMON_NAMES_THRESHOLD); if (count($surnames)>0) { $content .= '
'.i18n::translate('Most Common Surnames').''; $content .= help_link('index_common_names'); $content .= '
'; $i=0; foreach($surnames as $indexval => $surname) { if (stristr($surname['name'], '@N.N')===false) { if ($i>0) { $content .= ', '; } $content .= ''.PrintReady($surname['name']).''; $i++; } } } } global $THEME_DIR; if ($block) { require $THEME_DIR.'templates/block_small_temp.php'; } else { require $THEME_DIR.'templates/block_main_temp.php'; } } function print_gedcom_stats_config($config) { global $ctype, $WT_BLOCKS, $TEXT_DIRECTION; 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']; if (!isset($config['cache'])) $config['cache'] = $WT_BLOCKS['print_gedcom_stats']['config']['cache']; ?>
/> />
/> />
/> />
/> />
/> />
/> />
/> />
/> />
'; echo i18n::translate('Cache file life'), help_link('cache_life'); echo ''; echo ''; echo ''; } } ?>