News:

SMF 2.1.2 has been released! Take it for a spin! Read more.

Main Menu

Repeating Events for Calendar

Started by Bobn, April 23, 2012, 07:56:18 PM

Previous topic - Next topic

Bobn

Anyone know how to do this? The only mods wont work with 2.0.2 :(

Colin

You are right. I can't find any either. Hopefully a mod will come out soon.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Bobn

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 ;)

Colin

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.

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

andershz

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.

Bobn

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?

andershz

Nope.
Just the number of days between instances of the event.

Greybrow

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.

Bobn

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! :)

andershz

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.

T3CHN0

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. :/

T3CHN0

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)

andershz

'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.

Advertisement: