PDA

View Full Version : Calendar Enhancements - Automatic Calendar Reminders


Farcaster
24 Sep 2006, 08:42
What does it do?
This hack allows your members to receive automatic reminders for all upcoming events in one or more calendars of their choice without having to request individual reminders for each event. In effect, this operates like a subscription to a calendar.

How does it work?
When opening a calendar, the user will be presented with an option just under the calendar title to subscribe or unsubscribe to the calendar. Members can request automatic reminders for all events on the calendar for one, two or three days in advance. Once per day, a digest of all upcoming events will be sent to the user advising them of upcoming events in the time frame they chose. (see attached screenshot)

Users can also unsubscribe from a calendar by going to the UserCP and Event Reminders section (see attached screenshot)

Example Email (uses the event reminder email template): Dear Farcaster,

The following events are scheduled to begin soon at YOUR FORUM NAME.

Upcoming events:
************
Test Event 1 (In less than 23 hour(s))
http://YOUR_URL_HERE/calendar.php?do=getinfo&e=1
In Calendar: Calendar #1 Name
************
Test Event 3 (In less than 47 hour(s))
http://YOUR_URL_HERE/calendar.php?do=getinfo&e=3
In Calendar: Calendar #2 Name
************
Test Event 2 (In less than 47 hour(s))
http://YOUR_URL_HERE/calendar.php?do=getinfo&e=2
In Calendar: Calendar #3 Name


All the best,
YOUR FORUM NAME

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unsubscription information:

To unsubscribe from this email, please visit this page and delete any future reminders:
http://YOUR_URL_HERE/calendar.php?do=viewreminder
Upgrading from previous version:
You do not need to uninstall the previous version.

To upgrade from previous version to 1.0.3:
1. Remove the Calendar Subscription cron job if it exists.
2. Delete the file includes/cron/calendar_reminder.php
3. Make the changes to the reminder.php file as specified in the instructions below.


Installation Instructions
- 1 XML upload
- 1 template modification
- 1 file edit

1. Use the Product Manager to import the product file product-rah_calendar_autoremind_1_0_3.xml

3. Use the Style Manager to add the following code to the bottom of your CALENDAR_REMINDER template:
<!-- calendar subscriptions table -->
<br />
<form action="calendar.php?do=dosubscriptions" method="post" name="unsubscribe">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="do" value="dosubscriptions" />


<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat" colspan="3">
Calendar Subscriptions
</td>
</tr>
<if condition="$show['havesubscriptions']">
<tr>
<td class="thead">
Calendar
</td>
<td class="thead" nowrap="nowrap"><a href="$sorturl&order=asc&sort=reminder">$vbphrase[reminder]</a> $sortarrow[reminder]</td>
<td class="thead" align="center"><input name="allbox" type="checkbox" value="Check All" title="$vbphrase[check_uncheck_all]" onclick="checkall(this.form);" /></td>
</tr>
$subscriptionbits
<tr>
<td class="tfoot" colspan="5" align="$stylevar[right]"><div class="smallfont">

$vbphrase[selected_events]
<select name="what">
<optgroup label="$vbphrase[delete_reminders]">
<option value="delete">$vbphrase[delete]</option>
</optgroup>
</select>$gobutton

</div></td>
</tr>
<else />
<tr>
<td class="alt1" align="center" colspan="5">
<br />
You have no calendar subscriptions.
<br />
<br />
</td>
</tr>
</if>
</table>

</form>
4. Open a copy of the includes/cron/reminder.php file and find the following:
AND event.visible = 1
"); Replace with the following:
AND event.visible = 1
".$calendar_subscription);
Above that, near the top of the reminder.php file, find:
$eventlist = array();
$eventcache = array();
$userinfo = array(); Below that add:
$dsq = $vbulletin->db->query_read("
SELECT *
FROM " . TABLE_PREFIX . "datastore
WHERE title = 'lastautoremind'
");
$ds = $vbulletin->db->fetch_array($dsq);

$daynumber = round($timenow/86400);

if ($ds['data'] < $daynumber) {
build_datastore('lastautoremind',$daynumber);

$calendar_subscription = "UNION ALL
SELECT event.eventid, event.title, recurring, recuroption, dateline_from, dateline_to, IF (dateline_to = 0, 1, 0) AS singleday,
dateline_from AS dateline_from_user, dateline_to AS dateline_to_user, utc, dst, event.calendarid,
subscribecalendar.userid, 0 as lastreminder, 0 as subscribeeventid, subscribecalendar.reminder,
user.email, user.languageid, user.usergroupid, user.username, user.timezoneoffset, IF(user.options & 128, 1, 0) AS dstonoff,
calendar.title AS calendar_title
FROM " . TABLE_PREFIX . "event AS event
INNER JOIN " . TABLE_PREFIX . "subscribecalendar AS subscribecalendar ON (subscribecalendar.calendarid = event.calendarid)
INNER JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = subscribecalendar.userid)
LEFT JOIN " . TABLE_PREFIX . "calendar AS calendar ON (event.calendarid = calendar.calendarid)
WHERE ((dateline_to >= $beginday AND dateline_from < $endday) OR (dateline_to = 0 AND dateline_from >= $beginday AND dateline_from <= $endday ))
AND event.visible = 1";
}

(Note: If a user chooses to receive a reminder 3 days in advance, they will receive a daily reminder on each day from the 3 days out to 1 day out)

And, that's it. I hope you enjoy. Please click "install (http://www.vbulletin.org/forum/vborg_miscactions.php?do=installhack&threadid=127415)" if you use this hack.

I have not tested this with 3.6.1 yet, but there shouldn't be any reason it won't work with it.

Revision History
Version 1.0.0 - Initial Release
Version 1.0.1 - Fixed caching bug that caused calendar templates to become uncached when the user clicked the subscribe or unsubscribe link.
Version 1.0.2 - Fixed problem were reminders were sent for 3 days in advance regardless of the setting a member chose.
Version 1.0.3 - Removed calendar_reminder.php and merged email code with existing reminder.php.

A parallel version for 3.5.x forums is now available here.

Farcaster
24 Sep 2006, 09:06
Limitations:

Calendar Reminders are sent once per day at or after midnight based on the system time. The time is not configurable. This will be resolved in a future revision.

Lionel
24 Sep 2006, 14:40
Please how to fix this problem? This hack uncached all calendar templates

Barakat
24 Sep 2006, 15:17
thanks installed

Farcaster
24 Sep 2006, 16:32
Please how to fix this problem? This hack uncached all calendar templates

I'm working on this now. It looks like the caching problem only happens when the user is clicking on the subscribe or unsubscribe link. Other times, the cache is not effected. To see what I mean, if you have debug on, subscribe to a calendar and then browse back to the main page, and then back to the calendar again.

Lionel
24 Sep 2006, 16:42
In addition to that, in normal calendar view (when you first access it), only this template 'calendar_subscribe_bit ' is not cached.

bada_bing
24 Sep 2006, 17:04
will this work with vb calander events hack?

Also will it work with the 3.5.3 & 3.5.4 flavors of vb?

Farcaster
24 Sep 2006, 17:26
The caching problem is now resolved. See the upgrade instructions. Additionally, I added a plugin to cache the new subscription templates.

Farcaster
24 Sep 2006, 17:30
will this work with vb calander events hack?
It works with both Event Attendance 2.0 and with the vB Event Forums. However, the subscription link only shows up on the calendar, so users will not see a subscribe link when viewing an event in the Event Forums.

Also will it work with the 3.5.3 & 3.5.4 flavors of vb?
No, but I am working on a seperate version that will work with 3.5.x.

Snake
24 Sep 2006, 17:48
Thanks, will check this out soon...

Lionel
24 Sep 2006, 18:11
The caching problem is now resolved. See the upgrade instructions. Additionally, I added a plugin to cache the new subscription templates.

It is fixed, thanks.

ChurchMedia
25 Sep 2006, 02:02
No, but I am working on a separate version that will work with 3.5.x.

Count me in on installing a 3.5 version of this hack. My users would love it!

Thanks!

bada_bing
25 Sep 2006, 03:13
It works with both Event Attendance 2.0 and with the vB Event Forums. However, the subscription link only shows up on the calendar, so users will not see a subscribe link when viewing an event in the Event Forums.


No, but I am working on a seperate version that will work with 3.5.x.
PLease let us all know when the 3.5.x version is out I would love this.

ctrl-alt-del
25 Sep 2006, 12:42
Just what I've been looking for!

GrandAmGuru
25 Sep 2006, 19:57
oooh.. can't wait for the 3.5 version!

bada_bing
26 Sep 2006, 04:10
I like this hack but I would like to request a more granular feature.. On you next release expecially the 3.5.x version;) can you had it so that the member can get a reminder for only the selected calandar event rather then the entire calandar.

I would hate to get a bunch of emails from a calandar that is busy with events I dont care about rather then getting a reminder from the events I care to be reminded of

Any thoughts?

Gripemaster
26 Sep 2006, 04:51
*INSTALLED* Thank you!

Farcaster
26 Sep 2006, 05:01
I like this hack but I would like to request a more granular feature.. On you next release expecially the 3.5.x version;) can you had it so that the member can get a reminder for only the selected calandar event rather then the entire calandar.

I would hate to get a bunch of emails from a calandar that is busy with events I dont care about rather then getting a reminder from the events I care to be reminded of

Any thoughts?

Would the existing event reminders do what your wanting? Out of the box, vBulletin members can request a reminder to a particular event and get notified up to 3 days in advance. This hack adds the ability to subscribe to the entire calendar for users who may want to receive reminders for every event without having to come back to the calendar and request one.

Farcaster
26 Sep 2006, 07:20
PLease let us all know when the 3.5.x version is out I would love this.

Done. You can get it here.

maroceve
26 Sep 2006, 11:34
I see that the email sent is already translated to french.

Great.

Thanks.

JuGgOlOw22
26 Sep 2006, 14:51
Would there be any way to do the following:

1. Set it to automatically subscribe all members to the reminder?
2. I want to be able to send out a weekly Events Email. I have the cron set to run on Sundays, but would love to be able to set it up to where they could see the whole week.

Thanks!

Farcaster
28 Sep 2006, 18:29
This hack has been updated to merge the calendar_reminder.php with the existing reminder.php file. No additional functionality was added in this revision.



Would there be any way to do the following:

1. Set it to automatically subscribe all members to the reminder?
2. I want to be able to send out a weekly Events Email. I have the cron set to run on Sundays, but would love to be able to set it up to where they could see the whole week.

Thanks!

1> Do you want users to be able to unsubscribe from the calendar?
2> There would be a minor change required in the reminder.php file to accommodate this. I'll take a look.

JuGgOlOw22
29 Sep 2006, 13:57
1. Yes, that would be good to have
2. Awesome. Thanks for looking!

Code9
29 Sep 2006, 20:20
Will this work for vB 3.6.1?

Farcaster
29 Sep 2006, 20:26
I have not tested it in 3.6.1 yet, but there is no reason that I can see that it would not work.

oberheimhaven
29 Sep 2006, 21:26
Great hack easy install 3.6.0 zero problems!!!

Thxs
MarkAnthony

Xoxideforums
12 Oct 2006, 17:57
This hack is exactly what I'm looking for. I have it running on a fairly fresh version of 3.6 (very few additional plugins).

I have double checked that I installed it exactly how you stated, everything seems to be there.

The table in the DB was created, my members are being inserted to the table when they subscribe. But no one is recieving emails about the event.

The mail function definately works because subscriptions to certain forums are working just fine.

Any Ideas?

Farcaster
12 Oct 2006, 23:21
The table in the DB was created, my members are being inserted to the table when they subscribe. But no one is recieving emails about the event.

The mail function definately works because subscriptions to certain forums are working just fine.

Any Ideas?

My first thought would be to check the modification to the reminder.php file to make sure that is all in order. If it is, and you've tried subscribing to the calendar, run the below SQL query either from the AdminCP or from phpMyAdmin and PM me with the results. Be sure to put your table prefix in front of the word datastore if you specified on when installing, like: vb_datastore.

select * from datastore where title = 'lastautoremind'

JuGgOlOw22
18 Oct 2006, 01:28
Have you gotten a chance to check out those options?

AWJunkies
26 Nov 2006, 20:49
I would love to see this integrated with the upcoming events subscribe. For instance if a person subscribes to a calendar to get notified on the events within 3 days. It would also add those events to the subscribe table and notify them by message at the top and for stats purposes so someone doesnt have to subscribe to every event he can just see a stat that says, "New Upcoming Events: X and click it to see event subscriptions. The X is defined by the calendar subscription mod events within the specified days and also adds the events registered to manually. So that way it gets all events on all calendars subscribed to for a specific range and if there are events months out that you did manually. I started to code some of this but cant seem to get your mod integrated with it. Thanks for this awesome mod.

ravencr
02 Mar 2007, 18:47
Can this work with VB Event Calendar and Event Attendance?

Chris

Farcaster
03 Mar 2007, 03:24
It should work with it, but it doesn't integrate with either hack in any way.

dricho
25 Jul 2007, 12:35
This is excellent - works perfectly for me....thankyou!

AWJunkies
11 Jan 2008, 01:10
does this work for 3.6.8 P2 with php 5+ ??
It worked perfect before now since I upgraded to 5+ it is throwing errors along with your other mods. I am trying to find out the root of it.

Caerydd
14 Mar 2008, 17:04
I'll be testing this out, but I really want a version that simply emails subscribers at the moment a new event is added.

maroceve
07 May 2008, 12:03
Guys is there a hack or a mod that enables your forum to permit a user to subscribe DURING REGISTRATION To a specific Calendar.

Thanks.

William2509
11 Jul 2008, 09:11
Any possiblity of getting a 3.7.x version of this? I tried this version on my 3.7.2 board and did not working.

MediaHound
13 Sep 2008, 02:17
Have you gotten a chance to check out those options?

Bump for you. I'm also looking for it to automatically subscribe all members to the reminder. I can connect the dots in the database and make a third script to funnel new members into the setting, but having it in the UI for the first big sweep and as an automatic cron for the new members thereafter would be a great feature.

MediaHound
21 Oct 2008, 23:00
To automatically get new members subscribed, add a new plugin to the hook:
register_addmember_complete

Something to this effect, ymmv -
$uid = $vbulletin->userinfo['userid'];
$sql = 'INSERT INTO `subscribecalendar` VALUES (null, '.$uid.', 1, 86400);';
$db->query_write($sql);

vbboarder
13 Feb 2009, 17:53
Will you be upgrading this to VB 3.8? This would make an excellent Farcaster's Calendar Triad: Auto Calendar Reminders + Event Attendance 2 + Social Group Calendar. Thanks for all your cool mods! :D

videotom
28 Jan 2010, 21:03
We installed this on our current vBulletin version (3.8.4), added the XML, and changed the style templates as indicated, then when we test it, we get the following error:

"Your submission could not be processed because a security token was missing."

ahobilam
18 Oct 2011, 20:42
Will it work on latest version of VB 4.1.7
or
anybody can inform me about similar mod compatible for 4.1.7?

I tried this and getting an error - some if condition is missing its beginning tag.
please help.

ahobilam
26 Oct 2011, 10:54
I am having vb4.1.7
after editing the reminder.php
I am getting this error while clicking the calendar
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/includes/class_bootstrap.php(1340) : eval()'d code on line 182
Unable to add cookies, header already sent.
File: /home/brahmins/public_html/forums/includes/class_core.php
Line: 5554

tomsch
08 Jun 2014, 15:33
any chance getting this updated for vb 4.2.2???

ozzy47
08 Jun 2014, 19:41
any chance getting this updated for vb 4.2.2???

Note likely, the developer has not been online in almost a year.