vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Calendar Enhancements - Automatic Calendar Reminders (https://vborg.vbsupport.ru/showthread.php?t=127415)

Farcaster 09-23-2006 10:00 PM

Automatic Calendar Reminders
 
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):
Quote:

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:
HTML Code:

<!-- 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:
PHP Code:

AND event.visible 
"); 

Replace with the following:
PHP Code:

AND event.visible 
".$calendar_subscription); 

Above that, near the top of the reminder.php file, find:
PHP Code:

$eventlist = array(); 
$eventcache = array(); 
$userinfo = array(); 

Below that add:
PHP Code:

$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" 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 09-24-2006 07:06 AM

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 09-24-2006 12:40 PM

Please how to fix this problem? This hack uncached all calendar templates

Barakat 09-24-2006 01:17 PM

thanks installed

Farcaster 09-24-2006 02:32 PM

Quote:

Originally Posted by Lionel
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 09-24-2006 02:42 PM

In addition to that, in normal calendar view (when you first access it), only this template 'calendar_subscribe_bit ' is not cached.

bada_bing 09-24-2006 03:04 PM

will this work with vb calander events hack?

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

Farcaster 09-24-2006 03:26 PM

The caching problem is now resolved. See the upgrade instructions. Additionally, I added a plugin to cache the new subscription templates.

Farcaster 09-24-2006 03:30 PM

Quote:

Originally Posted by bada_bing
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.

Quote:

Originally Posted by bada_bing
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 09-24-2006 03:48 PM

Thanks, will check this out soon...

Lionel 09-24-2006 04:11 PM

Quote:

Originally Posted by Farcaster
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 09-25-2006 12:02 AM

Quote:

Originally Posted by Farcaster
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 09-25-2006 01:13 AM

Quote:

Originally Posted by Farcaster
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 09-25-2006 10:42 AM

Just what I've been looking for!

GrandAmGuru 09-25-2006 05:57 PM

oooh.. can't wait for the 3.5 version!

bada_bing 09-26-2006 02:10 AM

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 09-26-2006 02:51 AM

*INSTALLED* Thank you!

Farcaster 09-26-2006 03:01 AM

Quote:

Originally Posted by bada_bing
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 09-26-2006 05:20 AM

Quote:

Originally Posted by bada_bing
PLease let us all know when the 3.5.x version is out I would love this.

Done. You can get it here.

maroceve 09-26-2006 09:34 AM

I see that the email sent is already translated to french.

Great.

Thanks.

JuGgOlOw22 09-26-2006 12:51 PM

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 09-28-2006 04:29 PM

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.



Quote:

Originally Posted by JuGgOlOw22
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 09-29-2006 11:57 AM

1. Yes, that would be good to have
2. Awesome. Thanks for looking!

Code9 09-29-2006 06:20 PM

Will this work for vB 3.6.1?

Farcaster 09-29-2006 06:26 PM

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 09-29-2006 07:26 PM

Great hack easy install 3.6.0 zero problems!!!

Thxs
MarkAnthony

Xoxideforums 10-12-2006 03:57 PM

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 10-12-2006 09:21 PM

Quote:

Originally Posted by Xoxideforums
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.

Code:

select * from datastore where title = 'lastautoremind'

JuGgOlOw22 10-17-2006 11:28 PM

Have you gotten a chance to check out those options?

AWJunkies 11-26-2006 06:49 PM

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 03-02-2007 04:47 PM

Can this work with VB Event Calendar and Event Attendance?

Chris

Farcaster 03-03-2007 01:24 AM

It should work with it, but it doesn't integrate with either hack in any way.

dricho 07-25-2007 10:35 AM

This is excellent - works perfectly for me....thankyou!

AWJunkies 01-10-2008 11:10 PM

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 03-14-2008 03:04 PM

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 05-07-2008 10:03 AM

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 07-11-2008 07:11 AM

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 09-13-2008 12:17 AM

Quote:

Originally Posted by JuGgOlOw22 (Post 1099219)
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 10-21-2008 09:00 PM

To automatically get new members subscribed, add a new plugin to the hook:
register_addmember_complete

Something to this effect, ymmv -
PHP Code:

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


vbboarder 02-13-2009 03:53 PM

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


All times are GMT. The time now is 04:03 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01455 seconds
  • Memory Usage 1,868KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_html_printable
  • (5)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete