Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Topic started by: Bobn on April 23, 2012, 07:56:18 PM

Title: Repeating Events for Calendar
Post by: Bobn on April 23, 2012, 07:56:18 PM
Anyone know how to do this? The only mods wont work with 2.0.2 :(
Title: Re: Repeating Events for Calendar
Post by: Colin on April 23, 2012, 08:03:13 PM
You are right. I can't find any either. Hopefully a mod will come out soon.
Title: Re: Repeating Events for Calendar
Post by: Bobn on April 23, 2012, 08:05:03 PM
Quote from: Colin on April 23, 2012, 08:03:13 PM
You are right. I can't find any either. Hopefully a mod will come out soon.

We have allot of monthly events and its a pain to add them all ;)
Title: Re: Repeating Events for Calendar
Post by: Colin on April 23, 2012, 08:07:11 PM
I completely agree. I suggest submitting a MOD request for this. You can do that here: http://www.simplemachines.org/community/index.php?board=79.0

Sorry I can't be of more help.

Title: Re: Repeating Events for Calendar
Post by: andershz on April 24, 2012, 02:24:14 AM
I have made an (unpublished) mod for my own use, called "Poor Man's Recurring Events".
This mod creates, not recurring, but rather "migrating" events in the calendar.
The events are created as normal events in the calender, but once a day a scheduled task is run, checking if the end date of any event marked as recurring is in the past.
In that case the interval defined for the recurring event is added to the start and end dates for the event, moving the event to the next occurrence.
The interval is defined in a global mod setting where an event title prefix is mapped to an interval in days.
For instance: Daily:'=>1, 'Weekly:'=>7, 'Cheese Tasting'>=14
So in this case any event whose title begins with "Weekly:" will be moved forward seven days after each occurrence.
It's a bit primitive, but it works for my needs until I get the time to implement proper recurring events.
Title: Re: Repeating Events for Calendar
Post by: Bobn on April 24, 2012, 08:26:15 AM
Quote from: andershz on April 24, 2012, 02:24:14 AM
I have made an (unpublished) mod for my own use, called "Poor Man's Recurring Events".
This mod creates, not recurring, but rather "migrating" events in the calendar.
The events are created as normal events in the calender, but once a day a scheduled task is run, checking if the end date of any event marked as recurring is in the past.
In that case the interval defined for the recurring event is added to the start and end dates for the event, moving the event to the next occurrence.
The interval is defined in a global mod setting where an event title prefix is mapped to an interval in days.
For instance: Daily:'=>1, 'Weekly:'=>7, 'Cheese Tasting'>=14
So in this case any event whose title begins with "Weekly:" will be moved forward seven days after each occurrence.
It's a bit primitive, but it works for my needs until I get the time to implement proper recurring events.

Will it remember things like every 3rd Saturday of the month?
Title: Re: Repeating Events for Calendar
Post by: andershz on April 24, 2012, 08:44:03 AM
Nope.
Just the number of days between instances of the event.
Title: Re: Repeating Events for Calendar
Post by: Greybrow on April 25, 2012, 04:58:08 PM
There are (kind of) repeating events in smf.
In admin center / calendar choose adding new holiday.
Those can repeat every year, so for monthly events you should create twelve of them, but it's still better than nothing.
Title: Re: Repeating Events for Calendar
Post by: Bobn on April 25, 2012, 06:28:25 PM
Quote from: Greybrow on April 25, 2012, 04:58:08 PM
There are (kind of) repeating events in smf.
In admin center / calendar choose adding new holiday.
Those can repeat every year, so for monthly events you should create twelve of them, but it's still better than nothing.

Agreed but just as well might add them one at a time like it is now :(  You would think something like this would be a standard feature by now. Oh Well,, I'll wait for the feller above to write his! :)
Title: Re: Repeating Events for Calendar
Post by: andershz on April 26, 2012, 04:36:53 AM
Quote from: Bobn on April 25, 2012, 06:28:25 PM...Oh Well,, I'll wait for the feller above to write his! :)

Don't hold your breath!
The feller has a day job and it may take some time to come up with mod, if ever.
I have started a bit of brainstorming, but I don't think the support thread is the right place for that.
Interested parties can follow me to the SMF Coding Discussion (http://www.simplemachines.org/community/index.php?topic=475163.0).
Title: Re: Repeating Events for Calendar
Post by: T3CHN0 on February 05, 2014, 06:04:08 AM
Quote from: Bobn on April 25, 2012, 06:28:25 PM
Quote from: Greybrow on April 25, 2012, 04:58:08 PM
There are (kind of) repeating events in smf.
In admin center / calendar choose adding new holiday.
Those can repeat every year, so for monthly events you should create twelve of them, but it's still better than nothing.

Agreed but just as well might add them one at a time like it is now<$1alt="" title="" onresizestart="return false;" id="smiley__$2" style="padding: 0 3px 0 3px;" />  You would think something like this would be a standard feature by now. Oh Well,, I'll wait for the feller above to write his!<$1alt="" title="" onresizestart="return false;" id="smiley__$2" style="padding: 0 3px 0 3px;" />
Champ; I was looking for something like this, pity it doesn't have a message body as well to put an event message with it.
can only add the one line. event name only. :/
Title: Re: Repeating Events for Calendar
Post by: T3CHN0 on February 05, 2014, 06:17:30 AM
Quote from: andershz on April 24, 2012, 02:24:14 AM
I have made an (unpublished) mod for my own use, called "Poor Man's Recurring Events".
This mod creates, not recurring, but rather "migrating" events in the calendar.
The events are created as normal events in the calender, but once a day a scheduled task is run, checking if the end date of any event marked as recurring is in the past.
In that case the interval defined for the recurring event is added to the start and end dates for the event, moving the event to the next occurrence.
The interval is defined in a global mod setting where an event title prefix is mapped to an interval in days.
For instance: Daily:'=>1, 'Weekly:'=>7, 'Cheese Tasting'>=14
So in this case any event whose title begins with "Weekly:" will be moved forward seven days after each occurrence.
It's a bit primitive, but it works for my needs until I get the time to implement proper recurring events.

After install in the custom section at the bottom of the page I see this message

Recurring Events. Comma separated list of pairs like 'beginning of title' => interval in days. ('Daily' => 1, 'Weekly' => 7)
does this mean in the field next to it I put in something like this('Yearly' => 365) or (Yearly => 365) or just (yearly 365)
Title: Re: Repeating Events for Calendar
Post by: andershz on February 05, 2014, 08:52:07 AM
'Yearly' => 365

BTW, I just noticed that the earlier posted code doesn't work in PHP 5.4 or newer.
It must be slightly modified in that case.

BTW2, If you just want yearly events it might be easier to just add it as custom holidays.