Closed hartenthaler closed 6 months ago
I changed the event count field d_file to d_fact, but I'm not sure if the result is correct. This number has not changed on my website.
I do not know if your number is correct or if the number of events in the statistics block is accurate, but they are still different. Maybe you can check how webtrees calculates the number of events in the statistics block.
Initially, I searched for statistical fields in the forum to see if I could find a way to customize them. After seeing this post on the forum, I decided to write this module. The code from FISHAREBEST makes me feel that the method is approaching:
SELECT gedcom_name, (SELECT COUNT(*) FROM wt_individuals WHERE gedcom_id=i_file) AS Individuals, (SELECT COUNT(*) FROM wt_families WHERE gedcom_id=f_file) AS Families, (SELECT COUNT(*) FROM wt_sources WHERE gedcom_id=s_file) AS Sources, (SELECT COUNT(*) FROM wt_media WHERE gedcom_id=m_file) AS Media, (SELECT COUNT(*) FROM wt_other WHERE gedcom_id=o_file AND o_type='REPO') AS Repositories, (SELECT COUNT(*) FROM wt_dates WHERE gedcom_id=d_file) AS Events, (SELECT COUNT(DISTINCT n_surn) FROM wt_name WHERE gedcom_id=n_file) AS Surnames, (SELECT page_count FROM wt_hit_counter WHERE wt_gedcom.gedcom_id=wt_hit_counter.gedcom_id AND page_name='index.php' AND page_parameter LIKE 'gedcom:%') AS Hits FROM wt_gedcom WHERE gedcom_id > 0 ORDER BY gedcom_name;
His code is to count all the records in the date table as events, and that's how my event field came about.
Perhaps this statistical result should be called "facts and events".
Fixed the issue of counting the number of events.
in your code you use HAED instead of HEAD.
Fixed in the new version.
Your module shows for one of my trees:
However, the statistics block of this tree shows only 21755 events. All other values are correct. Do you use another interpretation of "event"?