SMF Support > SMF 2.0.x Support

Calendar UK

<< < (2/2)

MrPhil:
What you could do is go into the file install_2-0_mysql.sql and snip out the sections for INSERT INTO {$db_prefix}calendar_holidays into MyHolidays.sql. There are two sections: more or less worldwide holidays, and American holidays. Change {$db_prefix} to your prefix (default: smf_). Edit to remove American holidays and insert British holidays (Guy Fawkes Day, Queen's Birthday, etc.). Go into phpMyAdmin and EMPTY the <prefix>calendar_holidays table. IMPORT MyHolidays.sql (your revised holiday list) into the database.

Of course, this requires that you manually set up the list of holidays appropriate for your country. Perhaps the holiday list could be kept separate, as part of the language installation, although that wouldn't help that much if you have members on both sides of the Pond. The ultimate fix would be as K@ suggested to add some sort of country code for each member, and have that country code in the database so that the appropriate holidays could be pulled up.

igirisjin:
If it was automatic then someone would have to keep it up to date as holidays do change each year in many countries... or a source where they are all available!
Manual isnt that bad.

MrPhil:
If it's not a fixed month and day (as well as Common Era calendar; not religious calendars), SMF cannot figure it out. You'll see that floating date holidays are simply listed year by year for many years out. Perhaps something could be done in the style of an advanced "cron" (Memorial Day = last Monday in May = 5,Mon/L, or Election Day = day after first Monday in November = 11,1+Mon/1). I hate to think of how complicated Easter and related holidays would be! That would probably require a dedicated function.

It would not be hard to build a little utility to build the SQL for your country's holidays, and every few years either manually or on a cron job empty out the old calendar table and import the new holidays. A PHP utility could even directly connect to the database and remove past calendar table rows and add new ones. I will leave the raw list of available holidays to some other source.

Navigation

[0] Message Index

[*] Previous page

Go to full version